gnu: ungoogled-chromium-wayland: Use gexp.

* gnu/packages/chromium.scm (ungoogled-chromium-wayland): Use gexp.
[arguments](builder): Use gexp.
[inputs]: Rewrite inputs.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Nicolas Graves 2023-08-31 19:23:54 +02:00 committed by Maxim Cournoyer
parent 6548efcd73
commit c83c0a0093
No known key found for this signature in database
GPG Key ID: 1260E46482E63562

View File

@ -2,6 +2,7 @@
;;; Copyright © 2019-2023 Marius Bakke <marius@gnu.org> ;;; Copyright © 2019-2023 Marius Bakke <marius@gnu.org>
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com> ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2023 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2023 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -966,42 +967,39 @@ testing.")
(name "ungoogled-chromium-wayland") (name "ungoogled-chromium-wayland")
(native-inputs '()) (native-inputs '())
(inputs (inputs
`(("bash" ,bash-minimal) (list bash-minimal glibc-utf8-locales ungoogled-chromium))
("glibc-locales" ,glibc-utf8-locales)
("ungoogled-chromium" ,ungoogled-chromium)))
(build-system trivial-build-system) (build-system trivial-build-system)
(arguments (arguments
'(#:modules ((guix build utils)) (list
#:builder #:modules '((guix build utils))
(begin #:builder
(use-modules (guix build utils)) #~(begin
(let* ((bash (assoc-ref %build-inputs "bash")) (use-modules (guix build utils))
(chromium (assoc-ref %build-inputs "ungoogled-chromium")) (let* ((bash #$(this-package-input "bash-minimal"))
(locales (assoc-ref %build-inputs "glibc-locales")) (chromium #$(this-package-input "ungoogled-chromium"))
(out (assoc-ref %outputs "out")) (locales #$(this-package-input "glibc-utf8-locales"))
(exe (string-append out "/bin/chromium"))) (exe (string-append #$output "/bin/chromium")))
;; Use a Unicode locale so we can substitute the file below. ;; Use a Unicode locale so we can substitute the file below.
(setenv "GUIX_LOCPATH" (string-append locales "/lib/locale")) (setenv "GUIX_LOCPATH" (string-append locales "/lib/locale"))
(setlocale LC_ALL "en_US.utf8") (setlocale LC_ALL "en_US.utf8")
(mkdir-p (dirname exe)) (mkdir-p (dirname exe))
(symlink (string-append chromium "/bin/chromedriver") (symlink (string-append chromium "/bin/chromedriver")
(string-append out "/bin/chromedriver")) (string-append #$output "/bin/chromedriver"))
(call-with-output-file exe (call-with-output-file exe
(lambda (port) (lambda (port)
(format port "#!~a (format port "#!~a
exec ~a --enable-features=UseOzonePlatform --ozone-platform=wayland \ exec ~a --enable-features=UseOzonePlatform --ozone-platform=wayland \
--enable-features=WebRTCPipeWireCapturer $@" --enable-features=WebRTCPipeWireCapturer $@"
(string-append bash "/bin/bash") (string-append bash "/bin/bash")
(string-append chromium "/bin/chromium")))) (string-append chromium "/bin/chromium"))))
(chmod exe #o555) (chmod exe #o555)
;; Provide the manual and .desktop file. ;; Provide the manual and .desktop file.
(copy-recursively (string-append chromium "/share") (copy-recursively (string-append chromium "/share")
(string-append out "/share")) (string-append #$output "/share"))
(substitute* (string-append (substitute* (string-append
out "/share/applications/chromium.desktop") #$output "/share/applications/chromium.desktop")
((chromium) out)) ((chromium) #$output))))))))
#t))))))