Skip to content

Commit

Permalink
beets: Check dependencies on activated plugins.
Browse files Browse the repository at this point in the history
Beets tries to load oll activated plugins on "beet config -e" (however
only on the second run, thus the dummy), so we just pass all activated
plugins into a generated config file and bail out on any errors.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
  • Loading branch information
aszlig committed Dec 30, 2014
1 parent 740da53 commit 05f6061
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkgs/tools/audio/beets/default.nix
Expand Up @@ -53,6 +53,10 @@ let
enabledOptionalPlugins = attrNames (filterAttrs (_: id) optionalPlugins);

allPlugins = pluginsWithoutDeps ++ attrNames optionalPlugins;
allEnabledPlugins = pluginsWithoutDeps ++ enabledOptionalPlugins;

# Discogs plugin wants to have an API token, so skip install checks.
allTestablePlugins = remove "discogs" allEnabledPlugins;

testShell = "${bashInteractive}/bin/bash --norc";
completion = "${bashCompletion}/share/bash-completion/bash_completion";
Expand Down Expand Up @@ -143,6 +147,26 @@ in buildPythonPackage rec {
runHook postCheck
'';

doInstallCheck = true;

installCheckPhase = ''
runHook preInstallCheck
tmphome="$(mktemp -d)"
EDITOR="${writeScript "beetconfig.sh" ''
#!${stdenv.shell}
cat > "$1" <<CFG
plugins: ${concatStringsSep " " allTestablePlugins}
musicbrainz:
user: dummy
pass: dummy
CFG
''}" HOME="$tmphome" "$out/bin/beet" config -e
EDITOR=true HOME="$tmphome" "$out/bin/beet" config -e
runHook postInstallCheck
'';

meta = {
homepage = http://beets.radbox.org;
Expand Down

0 comments on commit 05f6061

Please sign in to comment.