From f864ef703e4a4051ae619fec2f42acd7d1399e2b Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 26 Oct 2015 10:26:48 +0100 Subject: [PATCH] beets: Add dependencies for "badfiles" plugin. I have to admit that I did very poor testing in d7307d8 and didn't notice that the "badfiles" plugin relies on mp3val (thanks to @devhell for packaging in 6e1ef13) and flac to be actually useful. We now patch in the store locations of these binaries and make "badfiles" an optional dependency (though enabled by default). Now, I have tested "beet bad" on my whole music collection and it worked fine (well, it has found errors... but that's what it is for). Signed-off-by: aszlig --- pkgs/tools/audio/beets/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index c8c1196791c..123b183f2d3 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -2,6 +2,7 @@ , buildPythonPackage, pythonPackages, python, imagemagick , enableAcoustid ? true +, enableBadfiles ? true, flac ? null, mp3val ? null , enableDiscogs ? true , enableEchonest ? true , enableFetchart ? true @@ -15,6 +16,7 @@ }: assert enableAcoustid -> pythonPackages.pyacoustid != null; +assert enableBadfiles -> flac != null && mp3val != null; assert enableDiscogs -> pythonPackages.discogs_client != null; assert enableEchonest -> pythonPackages.pyechonest != null; assert enableFetchart -> pythonPackages.responses != null; @@ -28,6 +30,7 @@ with stdenv.lib; let optionalPlugins = { + badfiles = enableBadfiles; chroma = enableAcoustid; discogs = enableDiscogs; echonest = enableEchonest; @@ -42,10 +45,10 @@ let }; pluginsWithoutDeps = [ - "badfiles" "bench" "bpd" "bpm" "bucket" "convert" "cue" "duplicates" - "embedart" "filefilter" "freedesktop" "fromfilename" "ftintitle" "fuzzy" - "ihate" "importadded" "importfeeds" "info" "inline" "ipfs" "keyfinder" - "lyrics" "mbcollection" "mbsync" "metasync" "missing" "permissions" "play" + "bench" "bpd" "bpm" "bucket" "convert" "cue" "duplicates" "embedart" + "filefilter" "freedesktop" "fromfilename" "ftintitle" "fuzzy" "ihate" + "importadded" "importfeeds" "info" "inline" "ipfs" "keyfinder" "lyrics" + "mbcollection" "mbsync" "metasync" "missing" "permissions" "play" "plexupdate" "random" "rewrite" "scrub" "smartplaylist" "spotify" "the" "types" "zero" ]; @@ -111,6 +114,11 @@ in buildPythonPackage rec { sed -i -e '/^BASH_COMPLETION_PATHS *=/,/^])$/ { /^])$/i u"${completion}" }' beets/ui/commands.py + '' + optionalString enableBadfiles '' + sed -i -e '/self\.run_command(\[/ { + s,"flac","${flac}/bin/flac", + s,"mp3val","${mp3val}/bin/mp3val", + }' beetsplug/badfiles.py ''; doCheck = true;