about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAustin Butler <austinabutler@gmail.com>2020-08-07 14:05:13 -0700
committerDoron Behar <doron.behar@gmail.com>2020-09-21 10:33:10 +0300
commit5d365404ac202557db1800d58c7ded91c8797522 (patch)
tree7ab9e43e105b0c58462f469a5def65258a6a87aa
parentf3893d8b534dfb61472c09bd9c8a836599320e65 (diff)
beets: add extrafiles plugin
-rw-r--r--pkgs/tools/audio/beets/default.nix7
-rw-r--r--pkgs/tools/audio/beets/extrafiles-plugin.nix30
2 files changed, 36 insertions, 1 deletions
diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix
index 776eca9999891..56551891a4a5f 100644
--- a/pkgs/tools/audio/beets/default.nix
+++ b/pkgs/tools/audio/beets/default.nix
@@ -31,6 +31,7 @@
 , enableAlternatives   ? false
 , enableCheck          ? false, liboggz ? null
 , enableCopyArtifacts  ? false
+, enableExtraFiles     ? false
 
 , bashInteractive, bash-completion
 }:
@@ -100,6 +101,7 @@ let
   externalTestArgs.beets = (beets.override {
     enableAlternatives = false;
     enableCopyArtifacts = false;
+    enableExtraFiles = false;
   }).overrideAttrs (stdenv.lib.const {
     doInstallCheck = false;
   });
@@ -110,6 +112,7 @@ let
     alternatives = callPackage ./alternatives-plugin.nix pluginArgs;
     check = callPackage ./check-plugin.nix pluginArgs;
     copyartifacts = callPackage ./copyartifacts-plugin.nix pluginArgs;
+    extrafiles = callPackage ./extrafiles-plugin.nix pluginArgs;
   };
 
 in pythonPackages.buildPythonApplication rec {
@@ -156,7 +159,9 @@ in pythonPackages.buildPythonApplication rec {
     ++ optional enableThumbnails    pythonPackages.pyxdg
     ++ optional enableWeb           pythonPackages.flask
     ++ optional enableAlternatives  plugins.alternatives
-    ++ optional enableCopyArtifacts plugins.copyartifacts;
+    ++ optional enableCopyArtifacts plugins.copyartifacts
+    ++ optional enableExtraFiles    plugins.extrafiles
+  ;
 
   buildInputs = [
     imagemagick
diff --git a/pkgs/tools/audio/beets/extrafiles-plugin.nix b/pkgs/tools/audio/beets/extrafiles-plugin.nix
new file mode 100644
index 0000000000000..7d0e446ce6051
--- /dev/null
+++ b/pkgs/tools/audio/beets/extrafiles-plugin.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchFromGitHub, beets, pythonPackages }:
+
+pythonPackages.buildPythonApplication rec {
+  pname = "beets-extrafiles";
+  version = "0.0.7";
+
+  src = fetchFromGitHub {
+    repo = "beets-extrafiles";
+    owner = "Holzhaus";
+    rev = "v${version}";
+    sha256 = "0ah7mgax9zrhvvd5scf2z0v0bhd6xmmv5sdb6av840ixpl6vlvm6";
+  };
+
+  postPatch = ''
+    sed -i -e '/install_requires/,/\]/{/beets/d}' setup.py
+    sed -i -e '/namespace_packages/d' setup.py
+  '';
+
+  nativeBuildInputs = [ beets ];
+
+  preCheck = ''
+    HOME=$TEMPDIR
+  '';
+
+  meta = {
+    homepage = "https://github.com/Holzhaus/beets-extrafiles";
+    description = "A plugin for beets that copies additional files and directories during the import process";
+    license = stdenv.lib.licenses.mit;
+  };
+}