about summary refs log tree commit diff
path: root/pkgs/applications/audio
diff options
context:
space:
mode:
authorSam Doshi <sam@metal-fish.co.uk>2019-10-07 15:33:09 +0100
committerJon <jonringer@users.noreply.github.com>2020-02-12 08:45:55 -0800
commit8bccdc4b81183b65cf6117cb3ce32b7910a71a7f (patch)
treec9961a559c9a980700b002fb3dc65091efe9c24c /pkgs/applications/audio
parent3be3ba4519cb7a61070b3f0ae418c21f4cb3e3d3 (diff)
downloadnixlib-8bccdc4b81183b65cf6117cb3ce32b7910a71a7f.tar
nixlib-8bccdc4b81183b65cf6117cb3ce32b7910a71a7f.tar.gz
nixlib-8bccdc4b81183b65cf6117cb3ce32b7910a71a7f.tar.bz2
nixlib-8bccdc4b81183b65cf6117cb3ce32b7910a71a7f.tar.lz
nixlib-8bccdc4b81183b65cf6117cb3ce32b7910a71a7f.tar.xz
nixlib-8bccdc4b81183b65cf6117cb3ce32b7910a71a7f.tar.zst
nixlib-8bccdc4b81183b65cf6117cb3ce32b7910a71a7f.zip
squeezelite: git -> 1.9.1196
Fix mp3, aac and ogg support, add extra codecs.
Diffstat (limited to 'pkgs/applications/audio')
-rw-r--r--pkgs/applications/audio/squeezelite/default.nix54
1 files changed, 43 insertions, 11 deletions
diff --git a/pkgs/applications/audio/squeezelite/default.nix b/pkgs/applications/audio/squeezelite/default.nix
index 4648c9b5ab32..ce0153e9f26e 100644
--- a/pkgs/applications/audio/squeezelite/default.nix
+++ b/pkgs/applications/audio/squeezelite/default.nix
@@ -1,38 +1,70 @@
-{ stdenv, fetchFromGitHub, alsaLib, faad2, flac, libmad, libvorbis, makeWrapper, mpg123 }:
+{ stdenv, fetchFromGitHub
+, alsaLib, flac, libmad, libvorbis, mpg123
+, dsdSupport ? true
+, faad2Support ? true, faad2
+, ffmpegSupport ? true, ffmpeg
+, opusSupport ? true, opusfile
+, resampleSupport ? true, soxr
+, sslSupport ? true, openssl
+}:
 
 let
-  runtimeDeps  = [ faad2 flac libmad libvorbis mpg123 ];
-  rpath = stdenv.lib.makeLibraryPath runtimeDeps;
+  concatStringsSep = stdenv.lib.concatStringsSep;
+  optional = stdenv.lib.optional;
+  opts = [ "-DLINKALL" ]
+    ++ optional dsdSupport "-DDSD"
+    ++ optional (!faad2Support) "-DNO_FAAD"
+    ++ optional ffmpegSupport "-DFFMPEG"
+    ++ optional opusSupport "-DOPUS"
+    ++ optional resampleSupport "-DRESAMPLE"
+    ++ optional sslSupport "-DUSE_SSL";
+
 in stdenv.mkDerivation {
-  name = "squeezelite-git-2018-08-14";
+  pname = "squeezelite";
+
+  # versions are specified in `squeezelite.h`
+  # see https://github.com/ralph-irving/squeezelite/issues/29
+  version = "1.9.6.1196";
 
   src = fetchFromGitHub {
     owner  = "ralph-irving";
     repo   = "squeezelite";
-    rev    = "ecb6e3696a42113994640e5345d0b5ca2e77d28b";
-    sha256 = "0di3d5qy8fhawijq6bxy524fgffvzl08dprrws0fs2j1a70fs0fh";
+    rev    = "2b508464dce2cbdb2a3089c58df2a6fbc36328c0";
+    sha256 = "024ypr1da2r079k3hgiifzd3d3wcfprhbl5zdm40zm0c7frzmr8i";
   };
 
-  buildInputs = [ alsaLib ] ++ runtimeDeps;
-  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ alsaLib flac libmad libvorbis mpg123 ]
+    ++ optional faad2Support faad2
+    ++ optional ffmpegSupport ffmpeg
+    ++ optional opusSupport opusfile
+    ++ optional resampleSupport soxr
+    ++ optional sslSupport openssl;
 
   enableParallelBuilding = true;
 
+  postPatch = ''
+    substituteInPlace opus.c \
+      --replace "<opusfile.h>" "<opus/opusfile.h>"
+  '';
+
+  preBuild = ''
+    export OPTS="${concatStringsSep " " opts}"
+  '';
+
   installPhase = ''
     runHook preInstall
 
     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
   '';
 
   meta = with stdenv.lib; {
     description = "Lightweight headless squeezebox client emulator";
     homepage = https://github.com/ralph-irving/squeezelite;
-    license = licenses.gpl3;
+    license = with licenses; [ gpl3 ] ++ optional dsdSupport bsd2;
+    maintainers = with maintainers; [ samdoshi ];
     platforms = platforms.linux;
   };
-  RPATH = rpath;
 }