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:11:57 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-12-30 23:11:57 +0100
commit740da53c72e0b2f8a9e645595b300c9d9ad69780 (patch)
tree2773fd00b9ea3fb05aff3a55e2cee339de156441 /pkgs/tools/audio/beets/default.nix
parentf2364772b8c1c77c6f446909d7db5f236efdd978 (diff)
downloadnixpkgs-740da53c72e0b2f8a9e645595b300c9d9ad69780.tar
nixpkgs-740da53c72e0b2f8a9e645595b300c9d9ad69780.tar.gz
nixpkgs-740da53c72e0b2f8a9e645595b300c9d9ad69780.tar.bz2
nixpkgs-740da53c72e0b2f8a9e645595b300c9d9ad69780.tar.lz
nixpkgs-740da53c72e0b2f8a9e645595b300c9d9ad69780.tar.xz
nixpkgs-740da53c72e0b2f8a9e645595b300c9d9ad69780.tar.zst
nixpkgs-740da53c72e0b2f8a9e645595b300c9d9ad69780.zip
beets: Check plugin definitions against package.
The reason for doing this is in order to not forget about possible
dependencies in new upstream releases, so if upstream is introducing a
new plugin where we're lacking dependencies, the build will fail on our
side and we can check whether we'll need those.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/tools/audio/beets/default.nix')
-rw-r--r--pkgs/tools/audio/beets/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix
index a052a994afd..fa08f5980c3 100644
--- a/pkgs/tools/audio/beets/default.nix
+++ b/pkgs/tools/audio/beets/default.nix
@@ -115,6 +115,23 @@ in buildPythonPackage rec {
 
   doCheck = true;
 
+  preCheck = ''
+    (${concatMapStrings (s: "echo \"${s}\";") allPlugins}) \
+      | sort -u > plugins_defined
+    find beetsplug -mindepth 1 \
+      \! -path 'beetsplug/__init__.py' -a \
+      \( -name '*.py' -o -path 'beetsplug/*/__init__.py' \) -print \
+      | sed -n -re 's|^beetsplug/([^/.]+).*|\1|p' \
+      | sort -u > plugins_available
+
+    if ! mismatches="$(diff -y plugins_defined plugins_available)"; then
+      echo "The the list of defined plugins (left side) doesn't match" \
+           "the list of available plugins (right side):" >&2
+      echo "$mismatches" >&2
+      exit 1
+    fi
+  '';
+
   checkPhase = ''
     runHook preCheck