summary refs log tree commit diff
path: root/pkgs/tools/audio/beets/default.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-12-30 23:13:56 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-12-30 23:13:56 +0100
commit05f6061d1dea845eb069eebf9dc235fc872d5f89 (patch)
tree96c5fcd98762bab9b5d9446fcc5948538412de5e /pkgs/tools/audio/beets/default.nix
parent740da53c72e0b2f8a9e645595b300c9d9ad69780 (diff)
downloadnixpkgs-05f6061d1dea845eb069eebf9dc235fc872d5f89.tar
nixpkgs-05f6061d1dea845eb069eebf9dc235fc872d5f89.tar.gz
nixpkgs-05f6061d1dea845eb069eebf9dc235fc872d5f89.tar.bz2
nixpkgs-05f6061d1dea845eb069eebf9dc235fc872d5f89.tar.lz
nixpkgs-05f6061d1dea845eb069eebf9dc235fc872d5f89.tar.xz
nixpkgs-05f6061d1dea845eb069eebf9dc235fc872d5f89.tar.zst
nixpkgs-05f6061d1dea845eb069eebf9dc235fc872d5f89.zip
beets: Check dependencies on activated plugins.
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>
Diffstat (limited to 'pkgs/tools/audio/beets/default.nix')
-rw-r--r--pkgs/tools/audio/beets/default.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix
index fa08f5980c3..7e14154eb20 100644
--- a/pkgs/tools/audio/beets/default.nix
+++ b/pkgs/tools/audio/beets/default.nix
@@ -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";
@@ -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;