2022-12-19 17:17:39 +01:00
|
|
|
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
2023-05-19 16:04:15 +02:00
|
|
|
;;; Copyright © 2022, 2023 Giacomo Leidi <goodoldpaul@autistici.org>
|
2022-11-06 01:28:31 +01:00
|
|
|
;;; Copyright © 2022 Mathieu Othacehe <m.othacehe@gmail.com>
|
|
|
|
;;; Copyright © 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de>
|
|
|
|
|
|
|
|
(define-module (nongnu packages chrome)
|
|
|
|
#:use-module (gnu packages base)
|
|
|
|
#:use-module (gnu packages compression)
|
2022-12-11 01:43:36 +01:00
|
|
|
#:use-module (gnu packages curl)
|
|
|
|
#:use-module (gnu packages fonts)
|
|
|
|
#:use-module (gnu packages freedesktop)
|
2022-11-06 01:28:31 +01:00
|
|
|
#:use-module (gnu packages gl)
|
|
|
|
#:use-module (gnu packages gtk)
|
2022-12-11 01:43:36 +01:00
|
|
|
#:use-module (gnu packages image)
|
2022-11-06 01:28:31 +01:00
|
|
|
#:use-module (gnu packages linux)
|
2022-12-11 01:43:36 +01:00
|
|
|
#:use-module (gnu packages pciutils)
|
|
|
|
#:use-module (gnu packages photo)
|
2023-12-10 15:30:29 +01:00
|
|
|
#:use-module (gnu packages qt)
|
2022-12-11 01:43:36 +01:00
|
|
|
#:use-module (gnu packages video)
|
|
|
|
#:use-module (gnu packages wget)
|
|
|
|
#:use-module (gnu packages xiph)
|
2022-11-06 01:28:31 +01:00
|
|
|
#:use-module (gnu packages xorg)
|
|
|
|
#:use-module (guix download)
|
|
|
|
#:use-module (guix gexp)
|
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module (guix build-system gnu)
|
2023-05-19 16:04:15 +02:00
|
|
|
#:use-module (nonguix build-system chromium-binary)
|
2022-11-06 01:28:31 +01:00
|
|
|
#:use-module (nonguix licenses)
|
|
|
|
#:use-module (ice-9 string-fun))
|
|
|
|
|
|
|
|
(define-public (make-google-chrome repo version hash)
|
|
|
|
(let* ((name (string-append "google-chrome-" repo))
|
|
|
|
(appname (if (string=? repo "stable")
|
|
|
|
"chrome"
|
2023-05-19 16:04:15 +02:00
|
|
|
(string-replace-substring name "google-" ""))))
|
2022-11-06 01:28:31 +01:00
|
|
|
(package
|
|
|
|
(name name)
|
|
|
|
(version version)
|
|
|
|
(source (origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri
|
|
|
|
(string-append
|
|
|
|
"https://dl.google.com/linux/chrome/deb/pool/main/g/"
|
|
|
|
name "/" name "_" version "-1_amd64.deb"))
|
|
|
|
(sha256
|
|
|
|
(base32 hash))))
|
2023-05-19 16:04:15 +02:00
|
|
|
(build-system chromium-binary-build-system)
|
2022-11-06 01:28:31 +01:00
|
|
|
(arguments
|
|
|
|
(list
|
|
|
|
;; almost 300MB, faster to download and build from Google servers
|
|
|
|
#:substitutable? #f
|
2023-05-19 16:04:15 +02:00
|
|
|
#:wrapper-plan
|
|
|
|
#~(let ((path (string-append "opt/google/" #$appname "/")))
|
2022-11-06 01:28:31 +01:00
|
|
|
(map (lambda (file)
|
2023-05-19 16:04:15 +02:00
|
|
|
(string-append path file))
|
2022-11-06 01:28:31 +01:00
|
|
|
'("chrome"
|
|
|
|
"chrome-sandbox"
|
|
|
|
"chrome_crashpad_handler"
|
|
|
|
"libEGL.so"
|
2023-12-10 15:30:29 +01:00
|
|
|
"libGLESv2.so"
|
|
|
|
"liboptimization_guide_internal.so"
|
|
|
|
"libqt5_shim.so"
|
|
|
|
"libqt6_shim.so"
|
|
|
|
"libvk_swiftshader.so"
|
|
|
|
"libvulkan.so.1"
|
2024-01-31 22:29:30 +01:00
|
|
|
"WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")))
|
2022-11-06 01:28:31 +01:00
|
|
|
#:install-plan
|
|
|
|
#~'(("opt/" "/share")
|
|
|
|
("usr/share/" "/share"))
|
|
|
|
#:phases
|
|
|
|
#~(modify-phases %standard-phases
|
|
|
|
(add-before 'install 'patch-assets
|
|
|
|
;; Many thanks to
|
|
|
|
;; https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/google-chrome/default.nix
|
|
|
|
(lambda _
|
|
|
|
(let* ((bin (string-append #$output "/bin"))
|
|
|
|
(share (string-append #$output "/share"))
|
|
|
|
(opt "./opt")
|
|
|
|
(usr/share "./usr/share")
|
|
|
|
(old-exe (string-append "/opt/google/" #$appname "/google-" #$appname))
|
|
|
|
(exe (string-append bin "/google-" #$appname)))
|
|
|
|
;; This allows us to override CHROME_WRAPPER later.
|
|
|
|
(substitute* (string-append opt "/google/" #$appname "/google-" #$appname)
|
|
|
|
(("CHROME_WRAPPER") "WRAPPER"))
|
|
|
|
(substitute* (string-append usr/share "/applications/google-" #$appname ".desktop")
|
|
|
|
(("^Exec=.*") (string-append "Exec=" exe "\n")))
|
|
|
|
(substitute* (string-append usr/share "/gnome-control-center/default-apps/google-" #$appname ".xml")
|
|
|
|
((old-exe) exe))
|
|
|
|
(substitute* (string-append usr/share "/menu/google-" #$appname ".menu")
|
|
|
|
(("/opt") share)
|
2023-07-31 19:48:44 +02:00
|
|
|
((old-exe) exe)))))
|
|
|
|
(add-after 'install 'install-icons
|
|
|
|
(lambda _
|
|
|
|
(define (format-icon-size name)
|
|
|
|
(car
|
|
|
|
(string-split
|
|
|
|
(string-drop-right (string-drop name 13) 4)
|
|
|
|
#\_)))
|
|
|
|
(let ((icons (string-append #$output "/share/icons/hicolor"))
|
|
|
|
(share (string-append #$output "/share/google/" #$appname)))
|
|
|
|
(for-each (lambda (icon)
|
|
|
|
(let* ((icon-name (basename icon))
|
|
|
|
(icon-size (format-icon-size icon-name))
|
|
|
|
(target (string-append icons "/" icon-size "x" icon-size "/apps/google-" #$appname ".png")))
|
|
|
|
(mkdir-p (dirname target))
|
|
|
|
(rename-file icon target)))
|
|
|
|
(find-files share "product_logo_.*\\.png")))))
|
2023-05-19 16:04:15 +02:00
|
|
|
(add-before 'install-wrapper 'install-exe
|
2022-11-06 01:28:31 +01:00
|
|
|
(lambda _
|
|
|
|
(let* ((bin (string-append #$output "/bin"))
|
|
|
|
(exe (string-append bin "/google-" #$appname))
|
|
|
|
(share (string-append #$output "/share"))
|
2023-05-19 16:04:15 +02:00
|
|
|
(chrome-target (string-append share "/google/" #$appname "/google-" #$appname)))
|
2022-11-06 01:28:31 +01:00
|
|
|
(mkdir-p bin)
|
|
|
|
(symlink chrome-target exe)
|
|
|
|
(wrap-program exe
|
|
|
|
'("CHROME_WRAPPER" = (#$appname)))))))))
|
|
|
|
(inputs
|
2023-05-19 16:04:15 +02:00
|
|
|
(list bzip2
|
2022-12-11 01:43:36 +01:00
|
|
|
curl
|
|
|
|
flac
|
|
|
|
font-liberation
|
|
|
|
gdk-pixbuf
|
|
|
|
harfbuzz
|
|
|
|
libexif
|
|
|
|
libglvnd
|
|
|
|
libpng
|
|
|
|
libva
|
|
|
|
libxscrnsaver
|
|
|
|
opus
|
|
|
|
pciutils
|
2023-01-08 19:10:17 +01:00
|
|
|
pipewire
|
2023-12-10 15:30:29 +01:00
|
|
|
qtbase-5
|
|
|
|
qtbase
|
2022-12-11 01:43:36 +01:00
|
|
|
snappy
|
|
|
|
util-linux
|
|
|
|
xdg-utils
|
2023-05-19 16:04:15 +02:00
|
|
|
wget))
|
2022-11-06 01:28:31 +01:00
|
|
|
(synopsis "Freeware web browser")
|
|
|
|
(supported-systems '("x86_64-linux"))
|
|
|
|
(description "Google Chrome is a cross-platform web browser developed by Google.")
|
|
|
|
(home-page "https://www.google.com/chrome/")
|
|
|
|
(license (nonfree "https://www.google.com/intl/en/chrome/terms/")))))
|
|
|
|
|
|
|
|
(define-public google-chrome-stable
|
2024-08-13 22:43:44 +02:00
|
|
|
(make-google-chrome "stable" "127.0.6533.99" "0n6dxjzvbc5p4nhpa9f68isgfvs42d59j4argkiga2xqm14qphd4"))
|
2022-11-13 14:44:57 +01:00
|
|
|
|
|
|
|
(define-public google-chrome-beta
|
2024-08-13 22:44:10 +02:00
|
|
|
(make-google-chrome "beta" "128.0.6613.27" "1v5p4zvln8yyh4622fla4hdpf5kfxlf1j3ydj8n2i2glb1vmmnrm"))
|
2022-11-13 15:26:41 +01:00
|
|
|
|
|
|
|
(define-public google-chrome-unstable
|
2024-08-13 22:44:15 +02:00
|
|
|
(make-google-chrome "unstable" "129.0.6643.2" "08kc914p5fk1mgn59nvb1qkfndinmzvwk0yzfsc2z4maicg4isqn"))
|