1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 12:11:28 +00:00
nixpkgs/pkgs/servers/slimserver/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

106 lines
2.9 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper
, perlPackages, flac, faad2, sox, lame, monkeysAudio, wavpack }:
perlPackages.buildPerlPackage rec {
pname = "slimserver";
version = "7.9.2";
src = fetchurl {
url = "https://github.com/Logitech/slimserver/archive/${version}.tar.gz";
sha256 = "1rn9y7xvg5aqmgcbfpi7lcqy8d7hgwqx8b2llzpzrv7854zm1wcw";
};
buildInputs = [
makeWrapper
perlPackages.perl
perlPackages.AnyEvent
perlPackages.ArchiveZip
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.LogLog4perl
perlPackages.LWP
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
# 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 = "";
buildPhase = ''
mv lib tmp
mkdir -p ${perlPackages.perl.libPrefix}
mv CPAN_used/* ${perlPackages.perl.libPrefix}
cp -rf tmp/* ${perlPackages.perl.libPrefix}
'';
doCheck = false;
installPhase = ''
cp -r . $out
wrapProgram $out/slimserver.pl \
--prefix PATH : "${stdenv.lib.makeBinPath [ lame flac faad2 sox monkeysAudio wavpack ]}"
'';
outputs = [ "out" ];
meta = with 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.unix;
};
}