Merge pull request #24008 from phile314/slimserver

slimserver: Init at 7.9.0 (pkg + module)
This commit is contained in:
Michael Raskin 2017-04-08 17:43:41 +02:00 committed by GitHub
commit 861726579b
5 changed files with 344 additions and 0 deletions

View file

@ -130,6 +130,7 @@
./services/audio/liquidsoap.nix
./services/audio/mpd.nix
./services/audio/mopidy.nix
./services/audio/slimserver.nix
./services/audio/squeezelite.nix
./services/audio/ympd.nix
./services/backup/almir.nix

View file

@ -0,0 +1,69 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.slimserver;
in {
options = {
services.slimserver = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable slimserver.
'';
};
package = mkOption {
type = types.package;
default = pkgs.slimserver;
defaultText = "pkgs.slimserver";
description = "Slimserver package to use.";
};
dataDir = mkOption {
type = types.path;
default = "/var/lib/slimserver";
description = ''
The directory where slimserver stores its state, tag cache,
playlists etc.
'';
};
};
};
###### implementation
config = mkIf cfg.enable {
systemd.services.slimserver = {
after = [ "network.target" ];
description = "Slim Server for Logitech Squeezebox Players";
wantedBy = [ "multi-user.target" ];
preStart = "mkdir -p ${cfg.dataDir} && chown -R slimserver:slimserver ${cfg.dataDir}";
serviceConfig = {
User = "slimserver";
PermissionsStartOnly = true;
ExecStart = "${cfg.package}/slimserver.pl --logdir ${cfg.dataDir}/logs --prefsdir ${cfg.dataDir}/prefs --cachedir ${cfg.dataDir}/cache";
};
};
users = {
users.slimserver = {
description = "Slimserver daemon user";
home = cfg.dataDir;
group = "slimserver";
};
groups.slimserver = {};
};
};
}

View file

@ -0,0 +1,97 @@
{ stdenv, buildPerlPackage, fetchurl
, perl, perlPackages }:
buildPerlPackage rec {
name = "slimserver-${version}";
version = "7.9.0";
src = fetchurl {
url = "https://github.com/Logitech/slimserver/archive/${version}.tar.gz";
sha256 = "07rhqipg7m28x0nqdd83nyzi88dp9cf8rr2pamdyrfcwyp1h1b44";
};
buildInputs = [
perl
perlPackages.AnyEvent
perlPackages.AudioScan
perlPackages.CarpClan
perlPackages.CGI
perlPackages.ClassXSAccessor
perlPackages.DataDump
perlPackages.DataURIEncode
perlPackages.DBDSQLite
perlPackages.DBI
perlPackages.DBIxClass
perlPackages.DigestSHA1
perlPackages.EV
perlPackages.ExporterLite
perlPackages.FileBOM
perlPackages.FileCopyRecursive
perlPackages.FileNext
perlPackages.FileReadBackwards
perlPackages.FileSlurp
perlPackages.FileWhich
perlPackages.HTMLParser
perlPackages.HTTPCookies
perlPackages.HTTPDaemon
perlPackages.HTTPMessage
perlPackages.ImageScale
perlPackages.IOSocketSSL
perlPackages.IOString
perlPackages.JSONXSVersionOneAndTwo
perlPackages.Log4Perl
perlPackages.LWPUserAgent
perlPackages.NetHTTP
perlPackages.ProcBackground
perlPackages.SubName
perlPackages.TemplateToolkit
perlPackages.TextUnidecode
perlPackages.TieCacheLRU
perlPackages.TieCacheLRUExpires
perlPackages.TieRegexpHash
perlPackages.TimeDate
perlPackages.URI
perlPackages.URIFind
perlPackages.UUIDTiny
perlPackages.XMLParser
perlPackages.XMLSimple
perlPackages.YAMLLibYAML
];
prePatch = ''
mkdir CPAN_used
# slimserver doesn't work with current DBIx/SQL versions, use bundled copies
mv CPAN/DBIx CPAN/SQL CPAN_used
rm -rf CPAN
rm -rf Bin
touch Makefile.PL
'';
preConfigurePhase = "";
buildPhase = "
mv lib tmp
mkdir -p lib/perl5/site_perl
mv CPAN_used/* lib/perl5/site_perl
cp -rf tmp/* lib/perl5/site_perl
";
doCheck = false;
installPhase = ''
cp -r . $out
'';
outputs = [ "out" ];
meta = with stdenv.lib; {
homepage = https://github.com/Logitech/slimserver;
description = "Server for Logitech Squeezebox players. This server is also called Logitech Media Server";
# the firmware is not under a free license!
# https://github.com/Logitech/slimserver/blob/public/7.9/License.txt
license = licenses.unfree;
maintainers = [ maintainers.phile314 ];
platforms = platforms.linux;
};
}

View file

@ -11046,6 +11046,8 @@ with pkgs;
sipwitch = callPackage ../servers/sip/sipwitch { };
slimserver = callPackage ../servers/slimserver { };
smcroute = callPackage ../servers/smcroute { };
spawn_fcgi = callPackage ../servers/http/spawn-fcgi { };

View file

@ -459,6 +459,22 @@ let self = _self // overrides; _self = with self; {
};
};
AudioScan = buildPerlPackage rec {
name = "Audio-Scan-0.93";
src = fetchurl {
url = "mirror://cpan/authors/id/A/AG/AGRUNDMA/${name}.tar.gz";
sha256 = "03nwcm234y76jb1p20rlcky6vzv68i46s9mjfr7kzp65w3yg94js";
};
buildInputs = [ pkgs.zlib ModuleBuild ModuleBuildPluggablePPPort ];
propagatedBuildInputs = [ TestWarn ];
NIX_CFLAGS_COMPILE = "-I${pkgs.zlib.dev}/include";
NIX_CFLAGS_LINK = "-L${pkgs.zlib.out}/lib -lz";
meta = {
description = "Fast C metadata and tag reader for all common audio file formats";
license = stdenv.lib.licenses.gpl2;
};
};
AuthenDecHpwd = buildPerlPackage rec {
name = "Authen-DecHpwd-2.006";
src = fetchurl {
@ -865,6 +881,17 @@ let self = _self // overrides; _self = with self; {
buildInputs = [ TestMore ];
};
CanaryStability = buildPerlPackage rec {
name = "Canary-Stability-2012";
src = fetchurl {
url = "mirror://cpan/authors/id/M/ML/MLEHMANN/${name}.tar.gz";
sha256 = "fd240b111d834dbae9630c59b42fae2145ca35addc1965ea311edf0d07817107";
};
meta = {
license = stdenv.lib.licenses.gpl1Plus;
};
};
CaptchaReCAPTCHA = buildPerlPackage rec {
name = "Captcha-reCAPTCHA-0.97";
src = fetchurl {
@ -2040,6 +2067,20 @@ let self = _self // overrides; _self = with self; {
propagatedBuildInputs = [ ClassInspector ];
};
ClassVirtual = buildPerlPackage rec {
name = "Class-Virtual-0.08";
src = fetchurl {
url = "mirror://cpan/authors/id/M/MS/MSCHWERN/${name}.tar.gz";
sha256 = "c6499b42d3b4e5c6488a5e82fbc28698e6c9860165072dddfa6749355a9cfbb2";
};
propagatedBuildInputs = [ CarpAssert ClassDataInheritable ClassISA ];
meta = {
homepage = https://metacpan.org/release/Class-Virtual;
description = "Base class for virtual base classes";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
ClassXSAccessor = buildPerlPackage {
name = "Class-XSAccessor-1.19";
src = fetchurl {
@ -3050,6 +3091,17 @@ let self = _self // overrides; _self = with self; {
};
};
DataURIEncode = buildPerlPackage rec {
name = "Data-URIEncode-0.11";
src = fetchurl {
url = "mirror://cpan/authors/id/R/RH/RHANDOM/${name}.tar.gz";
sha256 = "51c9efbf8423853616eaa24841e4d1996b2db0036900617fb1dbc76c75a1f360";
};
meta = {
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
DataUUID = buildPerlPackage rec {
name = "Data-UUID-1.220";
src = fetchurl {
@ -4614,6 +4666,17 @@ let self = _self // overrides; _self = with self; {
};
};
enum = buildPerlPackage rec {
name = "enum-1.11";
src = fetchurl {
url = "mirror://cpan/authors/id/N/NE/NEILB/${name}.tar.gz";
sha256 = "d2f36b5015f1e35f640159867b60bf5d5cd66b56cd5e42d33f531be68e5eee35";
};
meta = {
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
Env = buildPerlPackage {
name = "Env-1.04";
src = fetchurl {
@ -4647,6 +4710,19 @@ let self = _self // overrides; _self = with self; {
};
};
EV = buildPerlPackage rec {
name = "EV-4.22";
src = fetchurl {
url = "mirror://cpan/authors/id/M/ML/MLEHMANN/${name}.tar.gz";
sha256 = "2ae7f8734e2e4945510252152c3bea4be35f4aa58aad3db0504c38844b08a991";
};
buildInputs = [ CanaryStability ];
propagatedBuildInputs = [ CommonSense ];
meta = {
license = stdenv.lib.licenses.gpl1Plus;
};
};
EvalClosure = buildPerlPackage {
name = "Eval-Closure-0.11";
src = fetchurl {
@ -5073,6 +5149,20 @@ let self = _self // overrides; _self = with self; {
propagatedBuildInputs = [ ModuleBuild ];
};
FileBOM = buildPerlPackage rec {
name = "File-BOM-0.15";
src = fetchurl {
url = "mirror://cpan/authors/id/M/MA/MATTLAW/${name}.tar.gz";
sha256 = "431c8b39397fd5ad5b1a1100d3647a06e9f94304d46db44ffc0a0e5c5c06a1c1";
};
buildInputs = [ ModuleBuild TestException ];
propagatedBuildInputs = [ Readonly ];
meta = {
description = "Utilities for handling Byte Order Marks";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
FileCheckTree = buildPerlPackage {
name = "File-CheckTree-4.42";
src = fetchurl {
@ -6569,6 +6659,21 @@ let self = _self // overrides; _self = with self; {
};
};
ImageScale = buildPerlPackage rec {
name = "Image-Scale-0.13";
src = fetchurl {
url = "mirror://cpan/authors/id/A/AG/AGRUNDMA/${name}.tar.gz";
sha256 = "5b2c92dc2dd635b488879461760cd251aa2b1feef41b64f17914a6e4bbe3e442";
};
buildInputs = [ pkgs.libpng pkgs.libjpeg ];
propagatedBuildInputs = [ TestNoWarnings pkgs.zlib ];
makeMakerFlags = "--with-jpeg-includes=${pkgs.libjpeg.dev}/include --with-jpeg-libs=${pkgs.libjpeg.out}/lib --with-png-includes=${pkgs.libpng.dev}/include --with-png-libs=${pkgs.libpng.out}/lib";
meta = {
description = "Fast, high-quality fixed-point image resizing";
license = stdenv.lib.licenses.gpl2Plus;
};
};
ImageSize = buildPerlPackage rec {
name = "Image-Size-3.232";
src = fetchurl {
@ -7123,6 +7228,18 @@ let self = _self // overrides; _self = with self; {
};
};
JSONXSVersionOneAndTwo = buildPerlPackage rec {
name = "JSON-XS-VersionOneAndTwo-0.31";
src = fetchurl {
url = "mirror://cpan/authors/id/L/LB/LBROCARD/${name}.tar.gz";
sha256 = "e6092c4d961fae777acf7fe99fb3cd6e5b710fec85765a6b90417480e4c94a34";
};
propagatedBuildInputs = [ JSONXS ];
meta = {
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
Later = buildPerlPackage rec {
version = "0.19";
name = "Object-Realize-Later-${version}";
@ -10616,6 +10733,16 @@ let self = _self // overrides; _self = with self; {
};
};
ProcBackground = buildPerlPackage rec {
name = "Proc-Background-1.10";
src = fetchurl {
url = "mirror://cpan/authors/id/B/BZ/BZAJAC/${name}.tar.gz";
sha256 = "1ce0dd78c0bb8393a2431b385a27b99fcc623a41ebec57b3cc09cc38cdb708ee";
};
meta = {
};
};
ProcProcessTable = buildPerlPackage {
name = "Proc-ProcessTable-0.51";
src = fetchurl {
@ -14194,6 +14321,31 @@ let self = _self // overrides; _self = with self; {
};
};
TieCacheLRU = buildPerlPackage rec {
name = "Tie-Cache-LRU-20150301";
src = fetchurl {
url = "mirror://cpan/authors/id/M/MS/MSCHWERN/${name}.tar.gz";
sha256 = "1bf740450d3a6d7c12b48c25f7da5964e44e7cc38b28572cfb76ff22464f4469";
};
propagatedBuildInputs = [ CarpAssert ClassDataInheritable ClassVirtual enum ];
meta = {
description = "A Least-Recently Used cache";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
TieCacheLRUExpires = buildPerlPackage rec {
name = "Tie-Cache-LRU-Expires-0.55";
src = fetchurl {
url = "mirror://cpan/authors/id/O/OE/OESTERHOL/${name}.tar.gz";
sha256 = "b316d849acd25f24346d55a9950d281fee0746398767c601234122159573eb9a";
};
propagatedBuildInputs = [ TieCacheLRU ];
meta = {
license = stdenv.lib.licenses.artistic1;
};
};
TieCycle = buildPerlPackage rec {
name = "Tie-Cycle-1.21";
src = fetchurl {
@ -14249,6 +14401,17 @@ let self = _self // overrides; _self = with self; {
};
};
TieRegexpHash = buildPerlPackage rec {
name = "Tie-RegexpHash-0.17";
src = fetchurl {
url = "mirror://cpan/authors/id/A/AL/ALTREUS/${name}.tar.gz";
sha256 = "0c207850e77efb16618e0aa015507926a3425b34aad5aa6e3e40d83989a085a3";
};
meta = {
license = stdenv.lib.licenses.artistic1;
};
};
TieToObject = buildPerlPackage {
name = "Tie-ToObject-0.03";
src = fetchurl {
@ -14644,6 +14807,18 @@ let self = _self // overrides; _self = with self; {
};
};
UUIDTiny = buildPerlPackage rec {
name = "UUID-Tiny-1.04";
src = fetchurl {
url = "mirror://cpan/authors/id/C/CA/CAUGUSTIN/${name}.tar.gz";
sha256 = "6dcd92604d64e96cc6c188194ae16a9d3a46556224f77b6f3d1d1312b68f9a3d";
};
meta = {
description = "Pure Perl UUID Support With Functional Interface";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
VariableMagic = buildPerlPackage rec {
name = "Variable-Magic-0.58";
src = fetchurl {