2023-09-14 23:57:05 +00:00
|
|
|
(define-module (ryan-packages mozilla)
|
|
|
|
#:use-module (gnu)
|
|
|
|
#:use-module (guix download)
|
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
|
|
|
#:use-module (gnu packages bash)
|
|
|
|
#:use-module (gnu packages linux)
|
|
|
|
#:use-module (nonguix build-system binary)
|
|
|
|
#:use-module (guix build-system trivial)
|
|
|
|
#:use-module (nongnu packages mozilla))
|
|
|
|
|
2024-03-26 14:05:44 +00:00
|
|
|
(define-public firefox-wrapped
|
2023-09-14 23:57:05 +00:00
|
|
|
(package
|
2024-03-26 14:05:44 +00:00
|
|
|
(name "firefox-wrapped")
|
|
|
|
(source #f)
|
|
|
|
(version "0.1")
|
|
|
|
(synopsis "Simple wrapper for pipewire in firefox")
|
|
|
|
(description "Simple wrapper for pipewire in firefox")
|
|
|
|
(home-page "http://mozilla.org/")
|
|
|
|
(license license:mpl2.0)
|
2023-09-14 23:57:05 +00:00
|
|
|
(inputs
|
|
|
|
`(("bash" ,bash-minimal)
|
|
|
|
("pipewire" ,pipewire)
|
2024-02-29 20:55:10 +00:00
|
|
|
("firefox" ,firefox)))
|
2023-09-14 23:57:05 +00:00
|
|
|
(build-system trivial-build-system)
|
|
|
|
(arguments
|
|
|
|
'(#:modules ((guix build utils))
|
|
|
|
#:builder
|
|
|
|
(begin
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
(let* ((bash (assoc-ref %build-inputs "bash"))
|
|
|
|
(firefox (assoc-ref %build-inputs "firefox"))
|
|
|
|
(pipewire (assoc-ref %build-inputs "pipewire"))
|
|
|
|
(out (assoc-ref %outputs "out"))
|
|
|
|
(exe (string-append out "/bin/firefox")))
|
|
|
|
(mkdir-p (dirname exe))
|
|
|
|
|
|
|
|
(call-with-output-file exe
|
|
|
|
(lambda (port)
|
|
|
|
;; NOTE: added "export LD_LIBRARY_PATH=pipewire"
|
|
|
|
;; maybe this can be done better with `wrap-programm'
|
|
|
|
(format port "#!~a \n
|
|
|
|
export LD_LIBRARY_PATH=~a \n
|
|
|
|
export MOZ_ENABLE_WAYLAND=1 \n
|
2024-03-20 05:13:02 +00:00
|
|
|
export MOZ_USE_XINPUT2=1 \n
|
2023-09-14 23:57:05 +00:00
|
|
|
exec ~a $@\n"
|
|
|
|
(string-append bash "/bin/bash")
|
|
|
|
(string-append pipewire "/lib")
|
|
|
|
(string-append firefox "/bin/firefox"))))
|
|
|
|
(chmod exe #o555)
|
|
|
|
|
|
|
|
;; Provide the manual and .desktop file.
|
|
|
|
(copy-recursively (string-append firefox "/share")
|
|
|
|
(string-append out "/share"))
|
|
|
|
(substitute* (string-append
|
|
|
|
out "/share/applications/firefox.desktop")
|
|
|
|
((firefox) out))
|
|
|
|
#t))))))
|