15 enableUnfreeFirmware ? false,
19 binPath = lib.makeBinPath (
27 ++ (lib.optional stdenv.hostPlatform.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
81 # FileNext # https://github.com/LMS-Community/slimserver/pull/1140
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.hostPlatform.isDarwin perlPackages.MacFSEvents)
121 ++ (lib.optional stdenv.hostPlatform.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/ CPAN_used/File/
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/File/Next.pm CPAN_used/File/
133 cp -rv CPAN/Log CPAN_used/
134 cp -rv CPAN/SQL/* CPAN_used/SQL/
138 # another set of vendored/modified modules exist in lib, more selectively cleaned for now
141 ${lib.optionalString (!enableUnfreeFirmware) ''
142 # remove unfree firmware
153 wrapProgram $out/slimserver.pl --prefix LD_LIBRARY_PATH : "${libPath}" --prefix PATH : "${binPath}"
154 wrapProgram $out/scanner.pl --prefix LD_LIBRARY_PATH : "${libPath}" --prefix PATH : "${binPath}"
156 ln -s $out/slimserver.pl $out/bin/slimserver
163 inherit (nixosTests) slimserver;
166 updateScript = ./update.nu;
170 homepage = "https://lyrion.org/";
171 changelog = "https://github.com/LMS-Community/slimserver/blob/${version}/Changelog${lib.versions.major version}.html";
172 description = "Lyrion Music Server (formerly Logitech Media Server) is open-source server software which controls a wide range of Squeezebox audio players";
173 # the firmware is not under a free license, so we do not include firmware in the default package
174 # https://github.com/LMS-Community/slimserver/blob/public/8.3/License.txt
175 license = if enableUnfreeFirmware then licenses.unfree else licenses.gpl2Only;
176 mainProgram = "slimserver";
177 maintainers = with maintainers; [
181 platforms = platforms.unix;
182 broken = stdenv.hostPlatform.isDarwin;