1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-04 19:45:54 +00:00
nixpkgs/pkgs/applications/audio/squeezelite/default.nix

71 lines
1.9 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub
, alsaLib, flac, libmad, libvorbis, mpg123
, dsdSupport ? true
, faad2Support ? true, faad2
, ffmpegSupport ? true, ffmpeg
, opusSupport ? true, opusfile
, resampleSupport ? true, soxr
, sslSupport ? true, openssl
}:
2016-06-11 13:45:24 +01:00
let
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 {
pname = "squeezelite";
# versions are specified in `squeezelite.h`
# see https://github.com/ralph-irving/squeezelite/issues/29
version = "1.9.6.1196";
2016-06-11 13:45:24 +01:00
src = fetchFromGitHub {
2018-03-29 09:58:09 +01:00
owner = "ralph-irving";
repo = "squeezelite";
rev = "2b508464dce2cbdb2a3089c58df2a6fbc36328c0";
sha256 = "024ypr1da2r079k3hgiifzd3d3wcfprhbl5zdm40zm0c7frzmr8i";
2016-06-11 13:45:24 +01:00
};
buildInputs = [ alsaLib flac libmad libvorbis mpg123 ]
++ optional faad2Support faad2
++ optional ffmpegSupport ffmpeg
++ optional opusSupport opusfile
++ optional resampleSupport soxr
++ optional sslSupport openssl;
2016-06-11 13:45:24 +01:00
2018-03-29 09:58:09 +01:00
enableParallelBuilding = true;
postPatch = ''
substituteInPlace opus.c \
--replace "<opusfile.h>" "<opus/opusfile.h>"
'';
preBuild = ''
export OPTS="${concatStringsSep " " opts}"
'';
2016-06-11 13:45:24 +01:00
installPhase = ''
2018-03-29 09:58:09 +01:00
runHook preInstall
install -Dm755 -t $out/bin squeezelite
install -Dm644 -t $out/share/doc/squeezelite *.txt *.md
runHook postInstall
2016-06-11 13:45:24 +01:00
'';
meta = with stdenv.lib; {
description = "Lightweight headless squeezebox client emulator";
homepage = "https://github.com/ralph-irving/squeezelite";
license = with licenses; [ gpl3 ] ++ optional dsdSupport bsd2;
maintainers = with maintainers; [ samdoshi ];
2016-06-11 13:45:24 +01:00
platforms = platforms.linux;
};
}