beets: remove `? null; remove with lib`
This commit is contained in:
@@ -1,24 +1,23 @@
|
|||||||
{ stdenv, lib, fetchFromGitHub, writeScript, glibcLocales, diffPlugins, substituteAll
|
{ stdenv, lib, fetchFromGitHub, writeScript, glibcLocales, diffPlugins, substituteAll
|
||||||
, pythonPackages, imagemagick, gobject-introspection, gst_all_1
|
, pythonPackages, imagemagick, gobject-introspection, gst_all_1
|
||||||
, runtimeShell
|
, runtimeShell, unstableGitUpdater
|
||||||
, unstableGitUpdater
|
|
||||||
|
|
||||||
# external plugins package set
|
# external plugins package set
|
||||||
, beetsExternalPlugins
|
, beetsExternalPlugins
|
||||||
|
|
||||||
, enableAbsubmit ? lib.elem stdenv.hostPlatform.system essentia-extractor.meta.platforms, essentia-extractor ? null
|
, enableAbsubmit ? lib.elem stdenv.hostPlatform.system essentia-extractor.meta.platforms, essentia-extractor
|
||||||
, enableAcousticbrainz ? true
|
, enableAcousticbrainz ? true
|
||||||
, enableAcoustid ? true
|
, enableAcoustid ? true
|
||||||
, enableBadfiles ? true, flac ? null, mp3val ? null
|
, enableBadfiles ? true, flac, mp3val
|
||||||
, enableBeatport ? true
|
, enableBeatport ? true
|
||||||
, enableBpsync ? true
|
, enableBpsync ? true
|
||||||
, enableConvert ? true, ffmpeg ? null
|
, enableConvert ? true, ffmpeg
|
||||||
, enableDeezer ? true
|
, enableDeezer ? true
|
||||||
, enableDiscogs ? true
|
, enableDiscogs ? true
|
||||||
, enableEmbyupdate ? true
|
, enableEmbyupdate ? true
|
||||||
, enableFetchart ? true
|
, enableFetchart ? true
|
||||||
, enableGmusic ? true
|
, enableGmusic ? true
|
||||||
, enableKeyfinder ? true, keyfinder-cli ? null
|
, enableKeyfinder ? true, keyfinder-cli
|
||||||
, enableKodiupdate ? true
|
, enableKodiupdate ? true
|
||||||
, enableLastfm ? true
|
, enableLastfm ? true
|
||||||
, enableLoadext ? true
|
, enableLoadext ? true
|
||||||
@@ -33,32 +32,14 @@
|
|||||||
|
|
||||||
# External plugins
|
# External plugins
|
||||||
, enableAlternatives ? false
|
, enableAlternatives ? false
|
||||||
, enableCheck ? false, liboggz ? null
|
, enableCheck ? false, liboggz
|
||||||
, enableCopyArtifacts ? false
|
, enableCopyArtifacts ? false
|
||||||
, enableExtraFiles ? false
|
, enableExtraFiles ? false
|
||||||
|
|
||||||
, bashInteractive, bash-completion
|
, bashInteractive, bash-completion
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert enableAbsubmit -> essentia-extractor != null;
|
|
||||||
assert enableAcoustid -> pythonPackages.pyacoustid != null;
|
|
||||||
assert enableBadfiles -> flac != null && mp3val != null;
|
|
||||||
assert enableBeatport -> pythonPackages.requests_oauthlib != null;
|
|
||||||
assert enableBpsync -> enableBeatport;
|
assert enableBpsync -> enableBeatport;
|
||||||
assert enableCheck -> flac != null && mp3val != null && liboggz != null;
|
|
||||||
assert enableConvert -> ffmpeg != null;
|
|
||||||
assert enableDiscogs -> pythonPackages.discogs_client != null;
|
|
||||||
assert enableFetchart -> pythonPackages.responses != null;
|
|
||||||
assert enableGmusic -> pythonPackages.gmusicapi != null;
|
|
||||||
assert enableKeyfinder -> keyfinder-cli != null;
|
|
||||||
assert enableLastfm -> pythonPackages.pylast != null;
|
|
||||||
assert enableMpd -> pythonPackages.mpd2 != null;
|
|
||||||
assert enableReplaygain -> ffmpeg != null;
|
|
||||||
assert enableSonosUpdate -> pythonPackages.soco != null;
|
|
||||||
assert enableThumbnails -> pythonPackages.pyxdg != null;
|
|
||||||
assert enableWeb -> pythonPackages.flask != null;
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
optionalPlugins = {
|
optionalPlugins = {
|
||||||
@@ -99,20 +80,20 @@ let
|
|||||||
"types" "unimported" "zero"
|
"types" "unimported" "zero"
|
||||||
];
|
];
|
||||||
|
|
||||||
enabledOptionalPlugins = attrNames (filterAttrs (_: id) optionalPlugins);
|
enabledOptionalPlugins = lib.attrNames (lib.filterAttrs (_: lib.id) optionalPlugins);
|
||||||
|
|
||||||
allPlugins = pluginsWithoutDeps ++ attrNames optionalPlugins;
|
allPlugins = pluginsWithoutDeps ++ lib.attrNames optionalPlugins;
|
||||||
allEnabledPlugins = pluginsWithoutDeps ++ enabledOptionalPlugins;
|
allEnabledPlugins = pluginsWithoutDeps ++ enabledOptionalPlugins;
|
||||||
|
|
||||||
testShell = "${bashInteractive}/bin/bash --norc";
|
testShell = "${bashInteractive}/bin/bash --norc";
|
||||||
completion = "${bash-completion}/share/bash-completion/bash_completion";
|
completion = "${bash-completion}/share/bash-completion/bash_completion";
|
||||||
|
|
||||||
# This is a stripped down beets for testing of the external plugins.
|
# This is a stripped down beets for testing of the external plugins.
|
||||||
externalTestArgs.beets = (beets.override {
|
externalTestArgs.beets = (lib.beets.override {
|
||||||
enableAlternatives = false;
|
enableAlternatives = false;
|
||||||
enableCopyArtifacts = false;
|
enableCopyArtifacts = false;
|
||||||
enableExtraFiles = false;
|
enableExtraFiles = false;
|
||||||
}).overrideAttrs (const {
|
}).overrideAttrs (lib.const {
|
||||||
doInstallCheck = false;
|
doInstallCheck = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -147,10 +128,10 @@ in pythonPackages.buildPythonApplication rec {
|
|||||||
pythonPackages.confuse
|
pythonPackages.confuse
|
||||||
pythonPackages.mediafile
|
pythonPackages.mediafile
|
||||||
gobject-introspection
|
gobject-introspection
|
||||||
] ++ optional enableAbsubmit essentia-extractor
|
] ++ lib.optional enableAbsubmit essentia-extractor
|
||||||
++ optional enableAcoustid pythonPackages.pyacoustid
|
++ lib.optional enableAcoustid pythonPackages.pyacoustid
|
||||||
++ optional enableBeatport pythonPackages.requests_oauthlib
|
++ lib.optional enableBeatport pythonPackages.requests_oauthlib
|
||||||
++ optional (enableFetchart
|
++ lib.optional (enableFetchart
|
||||||
|| enableDeezer
|
|| enableDeezer
|
||||||
|| enableEmbyupdate
|
|| enableEmbyupdate
|
||||||
|| enableKodiupdate
|
|| enableKodiupdate
|
||||||
@@ -160,19 +141,19 @@ in pythonPackages.buildPythonApplication rec {
|
|||||||
|| enableSubsonicupdate
|
|| enableSubsonicupdate
|
||||||
|| enableAcousticbrainz)
|
|| enableAcousticbrainz)
|
||||||
pythonPackages.requests
|
pythonPackages.requests
|
||||||
++ optional enableCheck beetsExternalPlugins.check
|
++ lib.optional enableCheck beetsExternalPlugins.check
|
||||||
++ optional enableConvert ffmpeg
|
++ lib.optional enableConvert ffmpeg
|
||||||
++ optional enableDiscogs pythonPackages.discogs_client
|
++ lib.optional enableDiscogs pythonPackages.discogs_client
|
||||||
++ optional enableGmusic pythonPackages.gmusicapi
|
++ lib.optional enableGmusic pythonPackages.gmusicapi
|
||||||
++ optional enableKeyfinder keyfinder-cli
|
++ lib.optional enableKeyfinder keyfinder-cli
|
||||||
++ optional enableLastfm pythonPackages.pylast
|
++ lib.optional enableLastfm pythonPackages.pylast
|
||||||
++ optional enableMpd pythonPackages.mpd2
|
++ lib.optional enableMpd pythonPackages.mpd2
|
||||||
++ optional enableSonosUpdate pythonPackages.soco
|
++ lib.optional enableSonosUpdate pythonPackages.soco
|
||||||
++ optional enableThumbnails pythonPackages.pyxdg
|
++ lib.optional enableThumbnails pythonPackages.pyxdg
|
||||||
++ optional enableWeb pythonPackages.flask
|
++ lib.optional enableWeb pythonPackages.flask
|
||||||
++ optional enableAlternatives beetsExternalPlugins.alternatives
|
++ lib.optional enableAlternatives beetsExternalPlugins.alternatives
|
||||||
++ optional enableCopyArtifacts beetsExternalPlugins.copyartifacts
|
++ lib.optional enableCopyArtifacts beetsExternalPlugins.copyartifacts
|
||||||
++ optional enableExtraFiles beetsExternalPlugins.extrafiles
|
++ lib.optional enableExtraFiles beetsExternalPlugins.extrafiles
|
||||||
;
|
;
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
@@ -209,12 +190,12 @@ in pythonPackages.buildPythonApplication rec {
|
|||||||
# bs1770gain, and set the absolute path there, to avoid impurities.
|
# bs1770gain, and set the absolute path there, to avoid impurities.
|
||||||
++ lib.optional enableReplaygain (substituteAll {
|
++ lib.optional enableReplaygain (substituteAll {
|
||||||
src = ./replaygain-default-ffmpeg.patch;
|
src = ./replaygain-default-ffmpeg.patch;
|
||||||
ffmpeg = getBin ffmpeg;
|
ffmpeg = lib.getBin ffmpeg;
|
||||||
})
|
})
|
||||||
# Put absolute Nix paths in place
|
# Put absolute Nix paths in place
|
||||||
++ lib.optional enableConvert (substituteAll {
|
++ lib.optional enableConvert (substituteAll {
|
||||||
src = ./convert-plugin-ffmpeg-path.patch;
|
src = ./convert-plugin-ffmpeg-path.patch;
|
||||||
ffmpeg = getBin ffmpeg;
|
ffmpeg = lib.getBin ffmpeg;
|
||||||
})
|
})
|
||||||
++ lib.optional enableBadfiles (substituteAll {
|
++ lib.optional enableBadfiles (substituteAll {
|
||||||
src = ./badfiles-plugin-nix-paths.patch;
|
src = ./badfiles-plugin-nix-paths.patch;
|
||||||
@@ -269,7 +250,7 @@ in pythonPackages.buildPythonApplication rec {
|
|||||||
EDITOR="${writeScript "beetconfig.sh" ''
|
EDITOR="${writeScript "beetconfig.sh" ''
|
||||||
#!${runtimeShell}
|
#!${runtimeShell}
|
||||||
cat > "$1" <<CFG
|
cat > "$1" <<CFG
|
||||||
plugins: ${concatStringsSep " " allEnabledPlugins}
|
plugins: ${lib.concatStringsSep " " allEnabledPlugins}
|
||||||
CFG
|
CFG
|
||||||
''}" HOME="$tmphome" "$out/bin/beet" config -e
|
''}" HOME="$tmphome" "$out/bin/beet" config -e
|
||||||
EDITOR=true HOME="$tmphome" "$out/bin/beet" config -e
|
EDITOR=true HOME="$tmphome" "$out/bin/beet" config -e
|
||||||
@@ -285,7 +266,7 @@ in pythonPackages.buildPythonApplication rec {
|
|||||||
updateScript = unstableGitUpdater { url = "https://github.com/beetbox/beets"; };
|
updateScript = unstableGitUpdater { url = "https://github.com/beetbox/beets"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = with lib; {
|
||||||
description = "Music tagger and library organizer";
|
description = "Music tagger and library organizer";
|
||||||
homepage = "http://beets.io";
|
homepage = "http://beets.io";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
|
|||||||
Reference in New Issue
Block a user