2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2021-06-10 03:57:09 +01:00
|
|
|
, alsa-lib, flac, libmad, libvorbis, mpg123
|
2019-10-07 15:33:09 +01:00
|
|
|
, dsdSupport ? true
|
|
|
|
, faad2Support ? true, faad2
|
2021-05-09 16:29:28 +01:00
|
|
|
, ffmpegSupport ? true, ffmpeg
|
2019-10-07 15:33:09 +01:00
|
|
|
, opusSupport ? true, opusfile
|
|
|
|
, resampleSupport ? true, soxr
|
|
|
|
, sslSupport ? true, openssl
|
|
|
|
}:
|
2016-06-11 13:45:24 +01:00
|
|
|
|
2019-12-27 20:49:32 +00:00
|
|
|
let
|
2021-01-15 13:21:58 +00:00
|
|
|
concatStringsSep = lib.concatStringsSep;
|
|
|
|
optional = lib.optional;
|
2019-10-07 15:33:09 +01:00
|
|
|
opts = [ "-DLINKALL" ]
|
|
|
|
++ optional dsdSupport "-DDSD"
|
|
|
|
++ optional (!faad2Support) "-DNO_FAAD"
|
|
|
|
++ optional ffmpegSupport "-DFFMPEG"
|
|
|
|
++ optional opusSupport "-DOPUS"
|
|
|
|
++ optional resampleSupport "-DRESAMPLE"
|
|
|
|
++ optional sslSupport "-DUSE_SSL";
|
|
|
|
|
2019-12-27 20:49:32 +00:00
|
|
|
in stdenv.mkDerivation {
|
2019-10-07 15:33:09 +01:00
|
|
|
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";
|
2019-10-07 15:33:09 +01:00
|
|
|
rev = "2b508464dce2cbdb2a3089c58df2a6fbc36328c0";
|
|
|
|
sha256 = "024ypr1da2r079k3hgiifzd3d3wcfprhbl5zdm40zm0c7frzmr8i";
|
2016-06-11 13:45:24 +01:00
|
|
|
};
|
|
|
|
|
2021-06-10 03:57:09 +01:00
|
|
|
buildInputs = [ alsa-lib flac libmad libvorbis mpg123 ]
|
2019-10-07 15:33:09 +01:00
|
|
|
++ optional faad2Support faad2
|
2021-05-09 16:29:28 +01:00
|
|
|
++ optional ffmpegSupport ffmpeg
|
2019-10-07 15:33:09 +01:00
|
|
|
++ 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;
|
|
|
|
|
2019-10-07 15:33:09 +01:00
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-11 13:45:24 +01:00
|
|
|
description = "Lightweight headless squeezebox client emulator";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/ralph-irving/squeezelite";
|
2019-10-07 15:33:09 +01:00
|
|
|
license = with licenses; [ gpl3 ] ++ optional dsdSupport bsd2;
|
|
|
|
maintainers = with maintainers; [ samdoshi ];
|
2016-06-11 13:45:24 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|