15 enableUnfreeFirmware ? false,
19 binPath = lib.makeBinPath (
27 ++ (lib.optional stdenv.isLinux monkeysAudio)
29 libPath = lib.makeLibraryPath [
34 perlPackages.buildPerlPackage rec {
38 src = fetchFromGitHub {
39 owner = "LMS-Community";
42 hash = "sha256-262SHaxt5ow3nJtNVk10sbiPUfDb/U+Ab97DRjkJZFI=";
45 nativeBuildInputs = [ makeWrapper ];
59 # ClassC3Componentised # Error: DBIx::Class::Row::throw_exception(): DBIx::Class::Relationship::BelongsTo::belongs_to(): Can't infer join condition for track
74 # DBIxClass # https://github.com/LMS-Community/slimserver/issues/138
95 JSONXSVersionOneAndTwo
96 # LogLog4perl # Internal error: Root Logger not initialized.
104 # SQLAbstract # DBI Exception: DBD::SQLite::db prepare_cached failed: no such function: ARRAY
120 # ++ (lib.optional stdenv.isDarwin perlPackages.MacFSEvents)
121 ++ (lib.optional stdenv.isLinux perlPackages.LinuxInotify2);
124 # remove vendored binaries
127 # remove most vendored modules, keeping necessary ones
128 mkdir -p CPAN_used/Class/C3/ CPAN_used/SQL
129 rm -r CPAN/SQL/Abstract/Limit.pm
130 cp -rv CPAN/Class/C3/Componentised.pm CPAN_used/Class/C3/
131 cp -rv CPAN/DBIx CPAN_used/
132 cp -rv CPAN/Log CPAN_used/
133 cp -rv CPAN/SQL/* CPAN_used/SQL/
137 # another set of vendored/modified modules exist in lib, more selectively cleaned for now
140 ${lib.optionalString (!enableUnfreeFirmware) ''
141 # remove unfree firmware
152 wrapProgram $out/slimserver.pl --prefix LD_LIBRARY_PATH : "${libPath}" --prefix PATH : "${binPath}"
153 wrapProgram $out/scanner.pl --prefix LD_LIBRARY_PATH : "${libPath}" --prefix PATH : "${binPath}"
155 ln -s $out/slimserver.pl $out/bin/slimserver
162 inherit (nixosTests) slimserver;
165 updateScript = ./update.nu;
169 homepage = "https://lyrion.org/";
170 changelog = "https://github.com/LMS-Community/slimserver/blob/${version}/Changelog${lib.versions.major version}.html";
171 description = "Lyrion Music Server (formerly Logitech Media Server) is open-source server software which controls a wide range of Squeezebox audio players";
172 # the firmware is not under a free license, so we do not include firmware in the default package
173 # https://github.com/LMS-Community/slimserver/blob/public/8.3/License.txt
174 license = if enableUnfreeFirmware then licenses.unfree else licenses.gpl2Only;
175 mainProgram = "slimserver";
176 maintainers = with maintainers; [
180 platforms = platforms.unix;
181 broken = stdenv.isDarwin;