about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2020-09-21 11:52:53 +0300
committerGitHub <noreply@github.com>2020-09-21 11:52:53 +0300
commitf6ee70d3ea246270fd568691a99a7648823a789d (patch)
treeb23c6db24b21e531275dfff777bfce78596481be
parentcc2982b79b02d64594280c2856567062f24ad694 (diff)
parent5d365404ac202557db1800d58c7ded91c8797522 (diff)
Merge pull request #91745 from austinbutler/beets-plugin-extrafiles
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;
+  };
+}