nixpkgs/pkgs/servers/slimserver/default.nix

105 lines
2.8 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, makeWrapper
, perlPackages, flac, faad2, sox, lame, monkeysAudio, wavpack }:
2017-03-02 22:38:06 +03:00
perlPackages.buildPerlPackage rec {
pname = "slimserver";
2018-05-16 21:42:09 +03:00
version = "7.9.1";
2017-03-02 22:38:06 +03:00
2017-03-16 21:54:27 +03:00
src = fetchurl {
url = "https://github.com/Logitech/slimserver/archive/${version}.tar.gz";
2018-05-16 21:42:09 +03:00
sha256 = "0szp5zkmx2b5lncsijf97asjnl73fyijkbgbwkl1i7p8qnqrb4mp";
2017-03-02 22:38:06 +03:00
};
buildInputs = [
2018-05-19 11:20:00 +03:00
makeWrapper
perlPackages.perl
perlPackages.AnyEvent
2017-03-02 22:38:06 +03:00
perlPackages.AudioScan
perlPackages.CarpClan
perlPackages.CGI
2017-03-16 00:34:10 +03:00
perlPackages.ClassXSAccessor
2017-03-15 00:54:58 +03:00
perlPackages.DataDump
perlPackages.DataURIEncode
perlPackages.DBDSQLite
2017-03-14 23:20:55 +03:00
perlPackages.DBI
perlPackages.DBIxClass
2017-03-14 23:20:55 +03:00
perlPackages.DigestSHA1
perlPackages.EV
perlPackages.ExporterLite
perlPackages.FileBOM
2017-03-15 00:54:58 +03:00
perlPackages.FileCopyRecursive
perlPackages.FileNext
2017-03-16 00:34:10 +03:00
perlPackages.FileReadBackwards
perlPackages.FileSlurp
perlPackages.FileWhich
2017-03-14 23:20:55 +03:00
perlPackages.HTMLParser
perlPackages.HTTPCookies
2017-03-15 00:54:58 +03:00
perlPackages.HTTPDaemon
perlPackages.HTTPMessage
2017-03-02 22:38:06 +03:00
perlPackages.ImageScale
perlPackages.IOSocketSSL
perlPackages.IOString
2017-03-14 23:20:55 +03:00
perlPackages.JSONXSVersionOneAndTwo
perlPackages.LogLog4perl
perlPackages.LWP
perlPackages.NetHTTP
perlPackages.ProcBackground
2017-03-14 23:20:55 +03:00
perlPackages.SubName
2017-03-16 00:39:03 +03:00
perlPackages.TemplateToolkit
perlPackages.TextUnidecode
perlPackages.TieCacheLRU
perlPackages.TieCacheLRUExpires
perlPackages.TieRegexpHash
perlPackages.TimeDate
perlPackages.URI
2017-03-15 00:54:58 +03:00
perlPackages.URIFind
perlPackages.UUIDTiny
2017-03-14 23:20:55 +03:00
perlPackages.XMLParser
perlPackages.XMLSimple
perlPackages.YAMLLibYAML
2017-03-02 22:38:06 +03:00
];
prePatch = ''
2017-03-16 00:34:10 +03:00
mkdir CPAN_used
2017-03-16 22:50:10 +03:00
# slimserver doesn't work with current DBIx/SQL versions, use bundled copies
2017-03-16 00:39:03 +03:00
mv CPAN/DBIx CPAN/SQL CPAN_used
rm -rf CPAN
rm -rf Bin
touch Makefile.PL
# relax audio scan version constraints
substituteInPlace lib/Audio/Scan.pm --replace "0.93" "1.01"
substituteInPlace modules.conf --replace "Audio::Scan 0.93 0.95" "Audio::Scan 0.93"
'';
preConfigurePhase = "";
2018-05-19 11:20:00 +03:00
buildPhase = ''
mv lib tmp
mkdir -p ${perlPackages.perl.libPrefix}
mv CPAN_used/* ${perlPackages.perl.libPrefix}
cp -rf tmp/* ${perlPackages.perl.libPrefix}
2018-05-19 11:20:00 +03:00
'';
doCheck = false;
2017-03-02 22:38:06 +03:00
installPhase = ''
cp -r . $out
2018-05-19 11:20:00 +03:00
wrapProgram $out/slimserver.pl \
--prefix PATH : "${stdenv.lib.makeBinPath [ lame flac faad2 sox monkeysAudio wavpack ]}"
2017-03-02 22:38:06 +03:00
'';
outputs = [ "out" ];
2017-03-02 22:38:06 +03:00
meta = with stdenv.lib; {
homepage = "https://github.com/Logitech/slimserver";
2017-03-02 22:38:06 +03:00
description = "Server for Logitech Squeezebox players. This server is also called Logitech Media Server";
2017-03-16 22:59:12 +03:00
# the firmware is not under a free license!
# https://github.com/Logitech/slimserver/blob/public/7.9/License.txt
license = licenses.unfree;
2017-03-02 22:38:06 +03:00
maintainers = [ maintainers.phile314 ];
platforms = platforms.unix;
2017-03-02 22:38:06 +03:00
};
}