From 562facfb81267f012bfa3301238bfdd970e6d233 Mon Sep 17 00:00:00 2001 From: Alberto Berti Date: Fri, 27 Dec 2019 21:49:32 +0100 Subject: [PATCH] squeezelite: Fix codec libraries loading by using a wrapper Fix args declaration --- pkgs/applications/audio/squeezelite/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/audio/squeezelite/default.nix b/pkgs/applications/audio/squeezelite/default.nix index 3184f89ced95..4648c9b5ab32 100644 --- a/pkgs/applications/audio/squeezelite/default.nix +++ b/pkgs/applications/audio/squeezelite/default.nix @@ -1,6 +1,9 @@ -{ stdenv, fetchFromGitHub, alsaLib, faad2, flac, libmad, libvorbis, mpg123 }: +{ stdenv, fetchFromGitHub, alsaLib, faad2, flac, libmad, libvorbis, makeWrapper, mpg123 }: -stdenv.mkDerivation { +let + runtimeDeps = [ faad2 flac libmad libvorbis mpg123 ]; + rpath = stdenv.lib.makeLibraryPath runtimeDeps; +in stdenv.mkDerivation { name = "squeezelite-git-2018-08-14"; src = fetchFromGitHub { @@ -10,7 +13,8 @@ stdenv.mkDerivation { sha256 = "0di3d5qy8fhawijq6bxy524fgffvzl08dprrws0fs2j1a70fs0fh"; }; - buildInputs = [ alsaLib faad2 flac libmad libvorbis mpg123 ]; + buildInputs = [ alsaLib ] ++ runtimeDeps; + nativeBuildInputs = [ makeWrapper ]; enableParallelBuilding = true; @@ -20,6 +24,7 @@ stdenv.mkDerivation { install -Dm755 -t $out/bin squeezelite install -Dm644 -t $out/share/doc/squeezelite *.txt *.md + wrapProgram $out/bin/squeezelite --set LD_LIBRARY_PATH $RPATH runHook postInstall ''; @@ -29,4 +34,5 @@ stdenv.mkDerivation { license = licenses.gpl3; platforms = platforms.linux; }; + RPATH = rpath; }