1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022 Evgenii Lepikhin <johnlepikhin@gmail.com>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (johnlepikhin packages google-chromium)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages base)
#:use-module (gnu packages bootstrap)
#:use-module (gnu packages compression)
#:use-module (gnu packages kerberos)
#:use-module (gnu packages cups)
#:use-module (gnu packages elf)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gl)
#:use-module (gnu packages curl)
#:use-module (gnu packages video)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages gtk)
#:use-module (gnu packages linux)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages nss)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages audio)
#:use-module (gnu packages xiph)
#:use-module (gnu packages icu4c)
#:use-module (gnu packages ghostscript)
#:use-module (gnu packages pciutils)
#:use-module (gnu packages speech)
#:use-module (gnu packages libevent)
#:use-module (gnu packages libffi)
#:use-module (gnu packages image)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages freedesktop)
#:use-module (guix build-system copy)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (guix packages)
#:export (make-chromium google-chromium))
(define (make-chromium version version-uri checksum)
(package
(name "google-chromium")
(version version)
(source (origin
(method url-fetch/zipbomb)
(uri (string-append "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/" version-uri "/chrome-linux.zip"))
(sha256 (base32 checksum))))
(build-system copy-build-system)
(arguments
`(#:install-plan
`(("chrome-linux" "/")
("helper-script" "/bin/google-chromium"))
#:phases
(modify-phases
%standard-phases
(add-after 'unpack 'create-helper-script
(lambda* (#:key inputs #:allow-other-keys)
(let ((font-config (string-append (assoc-ref inputs "fontconfig") "/etc/fonts/")))
(with-output-to-file "helper-script"
(lambda _
(display
(string-append "#! /bin/sh\n\nFONTCONFIG_PATH=" font-config " $(dirname $(realpath $0))/../chrome-linux/chrome\n"))))
#t)))
(add-after
'patch-shebangs 'fix-binary
(lambda*
(#:key outputs inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(patchelf (string-append (assoc-ref inputs "patchelf") "/bin/patchelf"))
(binaries (string-append out "/chrome-linux/{chrome,chrome_sandbox,chrome_crashpad_handler,nacl_helper}"))
(libs (string-append out "/chrome-linux/*.so* " out "/chrome-linux/swiftshader/*.so"))
(dynamic-linker (string-append (assoc-ref inputs "libc") ,(glibc-dynamic-linker)))
(nss (string-append (assoc-ref inputs "nss") "/lib/nss")))
(system (string-append "chmod 755 " libs " " binaries " " out "/bin/google-chromium"))
(system
(string-append
patchelf
" --set-rpath \"$LIBRARY_PATH:" out "/chrome-linux:" nss "\""
" --set-interpreter " dynamic-linker
" " binaries))
(system
(string-append
patchelf
" --set-rpath \"$LIBRARY_PATH:" out "/chrome-linux:" nss "\" " libs))))))))
(synopsis "Google Chromium")
(description "Google Chromium")
(home-page "https://www.google.com/intl/ru_ru/chrome/")
(native-inputs `(("patchelf" ,patchelf)))
(inputs
`(("alsa-lib" ,alsa-lib)
("at-spi2-atk" ,at-spi2-atk)
("at-spi2-core" ,at-spi2-core)
("atk" ,atk)
("cairo" ,cairo)
("cups" ,cups)
("curl" ,curl)
("dbus" ,dbus)
("expat" ,expat)
("ffmpeg" ,ffmpeg)
("flac" ,flac)
("fontconfig" ,fontconfig)
("freetype" ,freetype)
("gcc:lib" ,(canonical-package gcc) "lib")
("gdk-pixbuf" ,gdk-pixbuf)
("glib" ,glib)
("glibc" ,glibc)
("gtk+" ,gtk+)
("harfbuzz" ,harfbuzz)
("lcms" ,lcms)
("libdrm" ,libdrm)
("libevent" ,libevent)
("libffi" ,libffi)
("libjpeg-turbo" ,libjpeg-turbo)
("libpng" ,libpng)
("libva" ,libva)
("libwebp" ,libwebp)
("libx11" ,libx11)
("libxcb" ,libxcb)
("libxcomposite" ,libxcomposite)
("libxcursor" ,libxcursor)
("libxdamage" ,libxdamage)
("libxext" ,libxext)
("libxfixes" ,libxfixes)
("libxi" ,libxi)
("libxkbcommon" ,libxkbcommon)
("libxml2" ,libxml2)
("libxrandr" ,libxrandr)
("libxrender" ,libxrender)
("libxscrnsaver" ,libxscrnsaver)
("libxshmfence" ,libxshmfence)
("libxslt" ,libxslt)
("libxtst" ,libxtst)
("mesa" ,mesa)
("minizip" ,minizip)
("mit-krb5" ,mit-krb5)
("nss" ,nss)
("openh264" ,openh264)
("openjpeg" ,openjpeg) ;PDFium only
("pango" ,pango)
("pciutils" ,pciutils)
("pipewire" ,pipewire)
("pulseaudio" ,pulseaudio)
("snappy" ,snappy)
("speech-dispatcher" ,speech-dispatcher)
("udev" ,eudev)
("vulkan-headers" ,vulkan-headers)
("wayland" ,wayland)
("xdg-utils" ,xdg-utils)))
(license (list license:bsd-3
license:bsd-2
license:expat
license:asl2.0
license:mpl1.1
license:mpl2.0
license:public-domain
license:isc
(license:non-copyleft "chrome://credits"
"See chrome://credits for more information.")
license:lgpl2.1+))))
;; release channels: https://chromereleases.googleblog.com/search/label/Stable%20updates
;; base positions: https://omahaproxy.appspot.com/
(define-public google-chromium-92.5087
(make-chromium "92.5087.rev9" "925087" "0bwbkvxcp3j0k15ns0kfmhknm6rrbhjbmv3xrnpwsqbp68abssdg"))
(define-public google-chromium google-chromium-92.5087)
|