2022-12-19 17:17:39 +01:00
|
|
|
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
2022-11-06 01:28:31 +01:00
|
|
|
;;; Copyright © 2022 Giacomo Leidi <goodoldpaul@autistici.org>
|
|
|
|
;;; 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)
|
2022-11-06 01:28:31 +01:00
|
|
|
#:use-module (gnu packages cups)
|
|
|
|
#:use-module (gnu packages fontutils)
|
2022-12-11 01:43:36 +01:00
|
|
|
#:use-module (gnu packages fonts)
|
|
|
|
#:use-module (gnu packages freedesktop)
|
2022-11-06 01:28:31 +01:00
|
|
|
#:use-module (gnu packages databases)
|
|
|
|
#:use-module (gnu packages gcc)
|
|
|
|
#:use-module (gnu packages gl)
|
|
|
|
#:use-module (gnu packages glib)
|
|
|
|
#:use-module (gnu packages gnome)
|
|
|
|
#: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)
|
|
|
|
#:use-module (gnu packages nss)
|
2022-12-11 01:43:36 +01:00
|
|
|
#:use-module (gnu packages pciutils)
|
|
|
|
#:use-module (gnu packages photo)
|
|
|
|
#:use-module (gnu packages video)
|
|
|
|
#:use-module (gnu packages wget)
|
2022-11-06 01:28:31 +01:00
|
|
|
#:use-module (gnu packages xdisorg)
|
2022-12-11 01:43:36 +01:00
|
|
|
#:use-module (gnu packages xiph)
|
2022-11-06 01:28:31 +01:00
|
|
|
#:use-module (gnu packages xml)
|
|
|
|
#:use-module (gnu packages xorg)
|
|
|
|
#:use-module (guix download)
|
|
|
|
#:use-module (guix gexp)
|
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
#:use-module (nonguix build-system binary)
|
|
|
|
#: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"
|
2022-12-11 01:43:36 +01:00
|
|
|
(string-replace-substring name "google-" "")))
|
|
|
|
(patchelf-inputs (list "alsa-lib" "at-spi2-atk" "at-spi2-core" "atk" "cairo" "cups"
|
|
|
|
"dbus" "eudev" "expat" "freetype" "fontconfig-minimal" "gcc" "gdk-pixbuf"
|
|
|
|
"glib" "gtk" "harfbuzz" "libdrm" "libnotify" "libsecret" "libx11"
|
|
|
|
"libxcb" "libexif" "libxcomposite" "libxcursor" "libxdamage"
|
|
|
|
"libxext" "libxfixes" "libxi" "libxkbcommon" "libxkbfile" "libxrandr"
|
|
|
|
"libxrender" "libxtst" "libnotify" "mesa" "nspr" "pango" "pipewire"
|
|
|
|
"sqlcipher" "xdg-utils" "zlib")))
|
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))))
|
|
|
|
(build-system binary-build-system)
|
|
|
|
(arguments
|
|
|
|
(list
|
|
|
|
;; almost 300MB, faster to download and build from Google servers
|
|
|
|
#:substitutable? #f
|
|
|
|
#:patchelf-plan
|
2022-12-11 01:43:36 +01:00
|
|
|
#~(let ((patchelf-inputs (list #$@patchelf-inputs))
|
2022-11-06 01:28:31 +01:00
|
|
|
(path (string-append "opt/google/" #$appname "/")))
|
|
|
|
(map (lambda (file)
|
|
|
|
(cons (string-append path file) (list patchelf-inputs)))
|
|
|
|
'("chrome"
|
|
|
|
"chrome-sandbox"
|
|
|
|
"chrome_crashpad_handler"
|
|
|
|
"nacl_helper"
|
|
|
|
"libEGL.so"
|
|
|
|
"libGLESv2.so")))
|
|
|
|
#:install-plan
|
|
|
|
#~'(("opt/" "/share")
|
|
|
|
("usr/share/" "/share"))
|
|
|
|
#:phases
|
|
|
|
#~(modify-phases %standard-phases
|
|
|
|
(add-after 'unpack 'unpack-deb
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
(invoke "ar" "x" #$source)
|
|
|
|
(invoke "rm" "-v" "control.tar.xz"
|
|
|
|
"debian-binary"
|
|
|
|
(string-append "google-chrome-" #$repo "_"
|
|
|
|
#$version
|
|
|
|
"-1_amd64.deb"))
|
|
|
|
(invoke "tar" "xf" "data.tar.xz")
|
|
|
|
(invoke "rm" "-vrf" "data.tar.xz" "etc")))
|
|
|
|
(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)
|
|
|
|
((old-exe) exe))
|
|
|
|
#t)))
|
|
|
|
(add-after 'install 'install-wrapper
|
|
|
|
(lambda _
|
|
|
|
(let* ((bin (string-append #$output "/bin"))
|
|
|
|
(exe (string-append bin "/google-" #$appname))
|
|
|
|
(share (string-append #$output "/share"))
|
2022-12-11 01:43:36 +01:00
|
|
|
(chrome-target (string-append share "/google/" #$appname "/google-" #$appname))
|
|
|
|
(patchelf-inputs-packages (list #$@(map (lambda (i) (this-package-input i)) patchelf-inputs)))
|
|
|
|
(ld-library-libs (map (lambda (input)
|
|
|
|
(string-append input "/lib"))
|
|
|
|
patchelf-inputs-packages)))
|
2022-11-06 01:28:31 +01:00
|
|
|
(mkdir-p bin)
|
|
|
|
(symlink chrome-target exe)
|
|
|
|
(wrap-program exe
|
|
|
|
`("FONTCONFIG_PATH" ":" prefix
|
|
|
|
(,(string-join
|
|
|
|
(list
|
|
|
|
(string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts")
|
|
|
|
#$output)
|
|
|
|
":")))
|
|
|
|
`("LD_LIBRARY_PATH" ":" prefix
|
|
|
|
(,(string-join
|
2022-12-11 01:43:36 +01:00
|
|
|
(append
|
|
|
|
ld-library-libs
|
|
|
|
(list
|
|
|
|
(string-append #$(this-package-input "nss") "/lib/nss")
|
|
|
|
#$output))
|
2022-11-06 01:28:31 +01:00
|
|
|
":")))
|
|
|
|
'("CHROME_WRAPPER" = (#$appname)))))))))
|
|
|
|
(native-inputs (list tar))
|
|
|
|
(inputs
|
|
|
|
(list alsa-lib
|
|
|
|
at-spi2-atk
|
|
|
|
at-spi2-core
|
|
|
|
atk
|
2022-12-11 01:43:36 +01:00
|
|
|
bzip2
|
2022-11-06 01:28:31 +01:00
|
|
|
cairo
|
2022-12-11 01:43:36 +01:00
|
|
|
curl
|
2022-11-06 01:28:31 +01:00
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
eudev
|
|
|
|
expat
|
2022-12-11 01:43:36 +01:00
|
|
|
flac
|
2022-11-06 01:28:31 +01:00
|
|
|
fontconfig
|
2022-12-11 01:43:36 +01:00
|
|
|
freetype
|
|
|
|
font-liberation
|
2022-11-06 01:28:31 +01:00
|
|
|
`(,gcc "lib")
|
2022-12-11 01:43:36 +01:00
|
|
|
gdk-pixbuf
|
2022-11-06 01:28:31 +01:00
|
|
|
glib
|
|
|
|
gtk
|
2022-12-11 01:43:36 +01:00
|
|
|
harfbuzz
|
2022-11-06 01:28:31 +01:00
|
|
|
libdrm
|
2022-12-11 01:43:36 +01:00
|
|
|
libexif
|
|
|
|
libglvnd
|
2022-11-06 01:28:31 +01:00
|
|
|
libnotify
|
2022-12-11 01:43:36 +01:00
|
|
|
libpng
|
2022-11-06 01:28:31 +01:00
|
|
|
librsvg
|
|
|
|
libsecret
|
2022-12-11 01:43:36 +01:00
|
|
|
libva
|
2022-11-06 01:28:31 +01:00
|
|
|
libx11
|
|
|
|
libxcb
|
|
|
|
libxcomposite
|
|
|
|
libxcursor
|
|
|
|
libxdamage
|
|
|
|
libxext
|
|
|
|
libxfixes
|
|
|
|
libxi
|
|
|
|
libxkbcommon
|
|
|
|
libxkbfile
|
|
|
|
libxrandr
|
2022-12-11 01:43:36 +01:00
|
|
|
libxscrnsaver
|
|
|
|
libxshmfence
|
2022-11-06 01:28:31 +01:00
|
|
|
libxrender
|
|
|
|
libxtst
|
|
|
|
mesa
|
|
|
|
nspr
|
|
|
|
nss
|
2022-12-11 01:43:36 +01:00
|
|
|
opus
|
2022-11-06 01:28:31 +01:00
|
|
|
pango
|
2022-12-11 01:43:36 +01:00
|
|
|
pciutils
|
2022-11-06 01:28:31 +01:00
|
|
|
pipewire-0.3
|
2022-12-11 01:43:36 +01:00
|
|
|
snappy
|
2022-11-06 01:28:31 +01:00
|
|
|
sqlcipher
|
2022-12-11 01:43:36 +01:00
|
|
|
util-linux
|
|
|
|
xdg-utils
|
|
|
|
wget
|
2022-11-06 01:28:31 +01:00
|
|
|
zlib))
|
|
|
|
(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
|
2022-12-11 01:43:36 +01:00
|
|
|
(make-google-chrome "stable" "108.0.5359.124" "00c11svz9dzkg57484jg7c558l0jz8jbgi5zyjs1w7xp24vpnnpg"))
|
2022-11-13 14:44:57 +01:00
|
|
|
|
|
|
|
(define-public google-chrome-beta
|
2022-12-22 22:38:28 +01:00
|
|
|
(make-google-chrome "beta" "109.0.5414.46" "199n8a7pjnhbgkm2dwh9hq7pzf39x932bh6b056jqp032d5c00ns"))
|
2022-11-13 15:26:41 +01:00
|
|
|
|
|
|
|
(define-public google-chrome-unstable
|
2022-12-22 22:40:31 +01:00
|
|
|
(make-google-chrome "unstable" "110.0.5464.2" "0hzv55bba4041400zjysgzz1n8svzvi156xyrayfr5ynapf7g2rd"))
|