nongnu: google-chrome: Parameterize toolkits.
Chrome supports both GTK and QT and the two newest versions of each for a total of four UI Toolkits. This impacts closure size and requires building a LOT of unnecessary packages (relevant to compile-your-own-system people like me and maybe others). The solution: gate off and parameterize these toolkits. The default is to build with all toolkits which is the same behavior currently.
This commit is contained in:
parent
b2ce94fe65
commit
7e56eeca56
|
@ -26,9 +26,12 @@
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
#:use-module (nonguix build-system chromium-binary)
|
#:use-module (nonguix build-system chromium-binary)
|
||||||
#:use-module (nonguix licenses)
|
#:use-module (nonguix licenses)
|
||||||
#:use-module (ice-9 string-fun))
|
#:use-module (ice-9 string-fun)
|
||||||
|
#:use-module (srfi srfi-26)
|
||||||
|
#:export (make-google-chrome))
|
||||||
|
|
||||||
(define-public (make-google-chrome repo version hash)
|
(define* (make-google-chrome repo version hash
|
||||||
|
#:key (toolkits '(gtk3 gtk4 qt5 qt6)))
|
||||||
(let* ((name (string-append "google-chrome-" repo))
|
(let* ((name (string-append "google-chrome-" repo))
|
||||||
(appname (if (string=? repo "stable")
|
(appname (if (string=? repo "stable")
|
||||||
"chrome"
|
"chrome"
|
||||||
|
@ -53,17 +56,22 @@
|
||||||
#~(let ((path (string-append "opt/google/" #$appname "/")))
|
#~(let ((path (string-append "opt/google/" #$appname "/")))
|
||||||
(map (lambda (file)
|
(map (lambda (file)
|
||||||
(string-append path file))
|
(string-append path file))
|
||||||
|
(append
|
||||||
'("chrome"
|
'("chrome"
|
||||||
"chrome-sandbox"
|
"chrome-sandbox"
|
||||||
"chrome_crashpad_handler"
|
"chrome_crashpad_handler"
|
||||||
"libEGL.so"
|
"libEGL.so"
|
||||||
"libGLESv2.so"
|
"libGLESv2.so"
|
||||||
"liboptimization_guide_internal.so"
|
"liboptimization_guide_internal.so"
|
||||||
"libqt5_shim.so"
|
|
||||||
"libqt6_shim.so"
|
|
||||||
"libvk_swiftshader.so"
|
"libvk_swiftshader.so"
|
||||||
"libvulkan.so.1"
|
"libvulkan.so.1"
|
||||||
"WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")))
|
"WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")
|
||||||
|
(if (member 'qt5 '#$toolkits)
|
||||||
|
'("libqt5_shim.so")
|
||||||
|
'())
|
||||||
|
(if (member 'qt6 '#$toolkits)
|
||||||
|
'("libqt6_shim.so")
|
||||||
|
'()))))
|
||||||
#:install-plan
|
#:install-plan
|
||||||
#~'(("opt/" "/share")
|
#~'(("opt/" "/share")
|
||||||
("usr/share/" "/share"))
|
("usr/share/" "/share"))
|
||||||
|
@ -116,12 +124,12 @@
|
||||||
(wrap-program exe
|
(wrap-program exe
|
||||||
'("CHROME_WRAPPER" = (#$appname)))))))))
|
'("CHROME_WRAPPER" = (#$appname)))))))))
|
||||||
(inputs
|
(inputs
|
||||||
|
(append
|
||||||
(list bzip2
|
(list bzip2
|
||||||
curl
|
curl
|
||||||
flac
|
flac
|
||||||
font-liberation
|
font-liberation
|
||||||
gdk-pixbuf
|
gdk-pixbuf
|
||||||
gtk
|
|
||||||
harfbuzz
|
harfbuzz
|
||||||
libexif
|
libexif
|
||||||
libglvnd
|
libglvnd
|
||||||
|
@ -131,23 +139,44 @@
|
||||||
opus
|
opus
|
||||||
pciutils
|
pciutils
|
||||||
pipewire
|
pipewire
|
||||||
qtbase-5
|
|
||||||
qtbase
|
|
||||||
snappy
|
snappy
|
||||||
util-linux
|
util-linux
|
||||||
xdg-utils
|
xdg-utils
|
||||||
wget))
|
wget)
|
||||||
|
;; TODO: Currently the chromium binary build system always adds GTK+ as
|
||||||
|
;; an input so gating it here wouldn't do anything.
|
||||||
|
;; (if (member 'gtk3 toolkits)
|
||||||
|
;; (list gtk+)
|
||||||
|
;; '())
|
||||||
|
(if (member 'gtk4 toolkits)
|
||||||
|
(list gtk)
|
||||||
|
'())
|
||||||
|
(if (member 'qt5 toolkits)
|
||||||
|
(list qtbase-5)
|
||||||
|
'())
|
||||||
|
(if (member 'qt6 toolkits)
|
||||||
|
(list qtbase)
|
||||||
|
'())))
|
||||||
(synopsis "Freeware web browser")
|
(synopsis "Freeware web browser")
|
||||||
(supported-systems '("x86_64-linux"))
|
(supported-systems '("x86_64-linux"))
|
||||||
(description "Google Chrome is a cross-platform web browser developed by Google.")
|
(description "Google Chrome is a cross-platform web browser developed by Google.")
|
||||||
(home-page "https://www.google.com/chrome/")
|
(home-page "https://www.google.com/chrome/")
|
||||||
(license (nonfree "https://www.google.com/intl/en/chrome/terms/")))))
|
(license (nonfree "https://www.google.com/intl/en/chrome/terms/")))))
|
||||||
|
|
||||||
|
(define-public make-google-chrome-stable
|
||||||
|
(cut make-google-chrome "stable" "127.0.6533.99" "0n6dxjzvbc5p4nhpa9f68isgfvs42d59j4argkiga2xqm14qphd4" <...>))
|
||||||
|
|
||||||
(define-public google-chrome-stable
|
(define-public google-chrome-stable
|
||||||
(make-google-chrome "stable" "127.0.6533.99" "0n6dxjzvbc5p4nhpa9f68isgfvs42d59j4argkiga2xqm14qphd4"))
|
(make-google-chrome-stable))
|
||||||
|
|
||||||
|
(define-public make-google-chrome-beta
|
||||||
|
(cut make-google-chrome "beta" "128.0.6613.27" "1v5p4zvln8yyh4622fla4hdpf5kfxlf1j3ydj8n2i2glb1vmmnrm" <...>))
|
||||||
|
|
||||||
(define-public google-chrome-beta
|
(define-public google-chrome-beta
|
||||||
(make-google-chrome "beta" "128.0.6613.27" "1v5p4zvln8yyh4622fla4hdpf5kfxlf1j3ydj8n2i2glb1vmmnrm"))
|
(make-google-chrome-beta))
|
||||||
|
|
||||||
|
(define-public make-google-chrome-unstable
|
||||||
|
(cut make-google-chrome "unstable" "129.0.6643.2" "08kc914p5fk1mgn59nvb1qkfndinmzvwk0yzfsc2z4maicg4isqn" <...>))
|
||||||
|
|
||||||
(define-public google-chrome-unstable
|
(define-public google-chrome-unstable
|
||||||
(make-google-chrome "unstable" "129.0.6643.2" "08kc914p5fk1mgn59nvb1qkfndinmzvwk0yzfsc2z4maicg4isqn"))
|
(make-google-chrome-unstable))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user