diff options
author | David Thompson <dthompson2@worcester.edu> | 2024-02-18 14:43:46 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2024-02-18 14:43:46 -0500 |
commit | 3b6cedf05c2b7b45043395f172a71e184c91fb90 (patch) | |
tree | 17a6f3fae8f995a7e091204d5730348fe0776ab1 /dthompson/home | |
parent | 18053b792abbac4adc9b6028bb60991dc00a5cd3 (diff) |
Wrap firefox so it can find pipewire libraries.
Diffstat (limited to 'dthompson/home')
-rw-r--r-- | dthompson/home/pipewire.scm | 33 |
1 files changed, 33 insertions, 0 deletions
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)))) |