about summary refs log tree commit diff
path: root/pkgs/applications/audio/bitwig-studio
diff options
context:
space:
mode:
authorEmery Hemingway <ehmry@posteo.net>2022-07-11 18:23:52 -0500
committerehmry <ehmry@posteo.net>2022-08-19 13:11:27 -0500
commitb5526585c2de2e66c9111a5484dee65806acbcf5 (patch)
tree72625ad307637114914f9266658d7ad78e52c785 /pkgs/applications/audio/bitwig-studio
parent1a9c66f883bd8ccd71279a7faabe1a5556b9ccb2 (diff)
treewide: inject xdg-open into wrappers as $PATH suffix
The xdg-open utility is only ever a runtime dependency and its
dependents only expect that it accept a URI as a command line
argument and do something with it that the user would expect.
For such as a trivial relationship it should be possible for
users to override xdg-open with something else in their PATH.
Diffstat (limited to 'pkgs/applications/audio/bitwig-studio')
-rw-r--r--pkgs/applications/audio/bitwig-studio/bitwig-studio1.nix7
-rw-r--r--pkgs/applications/audio/bitwig-studio/bitwig-studio3.nix9
-rw-r--r--pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix4
3 files changed, 8 insertions, 12 deletions
diff --git a/pkgs/applications/audio/bitwig-studio/bitwig-studio1.nix b/pkgs/applications/audio/bitwig-studio/bitwig-studio1.nix
index a66a5e6c9dc44..d803b09c198b9 100644
--- a/pkgs/applications/audio/bitwig-studio/bitwig-studio1.nix
+++ b/pkgs/applications/audio/bitwig-studio/bitwig-studio1.nix
@@ -27,10 +27,6 @@ stdenv.mkDerivation rec {
     libxkbfile pixman xcbutil xcbutilwm zlib
   ];
 
-  binPath = lib.makeBinPath [
-    xdg-utils zenity ffmpeg
-  ];
-
   installPhase = ''
     mkdir -p $out
     cp -r opt/bitwig-studio $out/libexec
@@ -77,7 +73,8 @@ stdenv.mkDerivation rec {
       -not -path '*/resources/*' | \
     while IFS= read -r f ; do
       wrapProgram $f \
-        --prefix PATH : "${binPath}" \
+        --suffix PATH : "${lib.makeBinPath [ ffmpeg zenity ]}" \
+        --prefix PATH : "${lib.makeBinPath [ xdg-utils ]}" \
         "''${gappsWrapperArgs[@]}" \
         --set LD_PRELOAD "${libxkbcommon.out}/lib/libxkbcommon.so" || true
     done
diff --git a/pkgs/applications/audio/bitwig-studio/bitwig-studio3.nix b/pkgs/applications/audio/bitwig-studio/bitwig-studio3.nix
index 6b272a408ab0e..5eb94f8445e02 100644
--- a/pkgs/applications/audio/bitwig-studio/bitwig-studio3.nix
+++ b/pkgs/applications/audio/bitwig-studio/bitwig-studio3.nix
@@ -27,10 +27,6 @@ stdenv.mkDerivation rec {
     alsa-lib cairo freetype gdk-pixbuf glib gtk3 libxcb xcbutil xcbutilwm zlib libXtst libxkbcommon pulseaudio libjack2 libX11 libglvnd libXcursor stdenv.cc.cc.lib
   ];
 
-  binPath = lib.makeBinPath [
-    xdg-utils ffmpeg
-  ];
-
   ldLibraryPath = lib.strings.makeLibraryPath buildInputs;
 
   installPhase = ''
@@ -60,8 +56,9 @@ stdenv.mkDerivation rec {
       patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $f
       wrapProgram $f \
         "''${gappsWrapperArgs[@]}" \
-        --prefix PATH : "${binPath}" \
-        --suffix LD_LIBRARY_PATH : "${ldLibraryPath}"
+        --prefix LD_LIBRARY_PATH : "${ldLibraryPath}" \
+        --prefix PATH : "${lib.makeBinPath [ ffmpeg ]}" \
+        --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}"
     done
 
   '';
diff --git a/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix b/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix
index 2ad0b6bf6aff0..b51419784d189 100644
--- a/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix
+++ b/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix
@@ -53,9 +53,11 @@ stdenv.mkDerivation rec {
       -not -path '*/resources/*' | \
     while IFS= read -r f ; do
       patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $f
+      # make xdg-open overrideable at runtime
       wrapProgram $f \
         "''${gappsWrapperArgs[@]}" \
-        --prefix PATH : "${lib.makeBinPath [ xdg-utils ffmpeg ]}" \
+        --prefix PATH : "${lib.makeBinPath [ ffmpeg ]}" \
+        --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \
         --suffix LD_LIBRARY_PATH : "${lib.strings.makeLibraryPath buildInputs}"
     done