From 3b6cedf05c2b7b45043395f172a71e184c91fb90 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 18 Feb 2024 14:43:46 -0500 Subject: Wrap firefox so it can find pipewire libraries. --- dthompson/home/pipewire.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'dthompson/home') diff --git a/dthompson/home/pipewire.scm b/dthompson/home/pipewire.scm index 600db49..9faa64c 100644 --- a/dthompson/home/pipewire.scm +++ b/dthompson/home/pipewire.scm @@ -146,3 +146,36 @@ ctl_type.pipewire { (description (package-description pkg)) (home-page (package-home-page pkg)) (license (package-license pkg)))) + +(define-public (package-with-pw-wrapper pkg program) + (package + (name (package-name pkg)) + (version (package-version pkg)) + (source #f) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build union) + (guix build utils)) + #:builder + #~(begin + (use-modules (ice-9 match) + (guix build union) + (guix build utils)) + (let* ((program (string-append #$output "/bin/" #$program)) + (desktop (string-append #$output "/share/applications/" + #$program ".desktop")) + (pw-lib (string-append #$pipewire "/lib"))) + (union-build #$output (list #$pkg) + #:create-all-directories? #t) + (when (file-exists? desktop) + (substitute* desktop + (("Exec=.*") + (string-append "Exec=" program "\n")))) + (wrap-program program + #:sh (string-append #$bash-minimal "/bin/sh") + `("LD_LIBRARY_PATH" ":" prefix (,pw-lib))))))) + (synopsis (package-synopsis pkg)) + (description (package-description pkg)) + (home-page (package-home-page pkg)) + (license (package-license pkg)))) -- cgit v1.2.3