summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-01-31 04:39:21 +0100
committeraszlig <aszlig@nix.build>2018-01-31 04:39:21 +0100
commit2e4aded366914d625a2f31208e8ac8548cb43a7e (patch)
tree33233a9c8ed84bcd81dcac1e303bb1f1c10dc1c3 /pkgs
parentad78ba1efaecc55d1ca8db6975c9b6d939aa28dc (diff)
downloadnixpkgs-2e4aded366914d625a2f31208e8ac8548cb43a7e.tar
nixpkgs-2e4aded366914d625a2f31208e8ac8548cb43a7e.tar.gz
nixpkgs-2e4aded366914d625a2f31208e8ac8548cb43a7e.tar.bz2
nixpkgs-2e4aded366914d625a2f31208e8ac8548cb43a7e.tar.lz
nixpkgs-2e4aded366914d625a2f31208e8ac8548cb43a7e.tar.xz
nixpkgs-2e4aded366914d625a2f31208e8ac8548cb43a7e.tar.zst
nixpkgs-2e4aded366914d625a2f31208e8ac8548cb43a7e.zip
beets-alternatives: Fix tests against beets 1.4.6
Since the bump of beets to version 1.4.6 in e5fab33efdea1d0e1357bc084605
the tests no longer run successfully because beets 1.4.6 introduces a
breaking API change for the Item.move() method which now instead of just
passing copy=True the operation is now passed using a different
"operation" keyword argument.

Unfortunately the original repository of beets-alternatives is
unmaintained since 3 years and thus there is no upstream fix available
at the moment.

However, there is a fork maintained by @wisp3rwind, which addresses this
problem (wisp3rwind/beets-alternatives@33c6525ed4f799a2a4991c9fc9d55524)
and a bunch of other fixes.

The reason why I'm not using the patch from @wisp3rwind is that it
simply doesn't apply against beets-alternatives 0.8.2, but my patch here
essentially does the same.

Signed-off-by: aszlig <aszlig@nix.build>
Upstream issue: geigerzaehler/beets-alternatives#13
Cc: @Profpatsch
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/audio/beets/alternatives-beets-1.4.6.patch30
-rw-r--r--pkgs/tools/audio/beets/alternatives-plugin.nix2
2 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/tools/audio/beets/alternatives-beets-1.4.6.patch b/pkgs/tools/audio/beets/alternatives-beets-1.4.6.patch
new file mode 100644
index 00000000000..652e0e4a94b
--- /dev/null
+++ b/pkgs/tools/audio/beets/alternatives-beets-1.4.6.patch
@@ -0,0 +1,30 @@
+diff --git a/test/helper.py b/test/helper.py
+index c216226..d409c09 100644
+--- a/test/helper.py
++++ b/test/helper.py
+@@ -11,6 +11,7 @@ import beets
+ from beets import plugins
+ from beets import ui
+ from beets.library import Item
++from beets.util import MoveOperation
+ 
+ from beetsplug import alternatives
+ from beetsplug import convert
+@@ -183,7 +184,7 @@ class TestHelper(Assertions):
+         item = Item.from_path(os.path.join(self.fixture_dir, 'min.' + ext))
+         item.add(self.lib)
+         item.update(values)
+-        item.move(copy=True)
++        item.move(operation=MoveOperation.COPY)
+         item.write()
+         album = self.lib.add_album([item])
+         album.albumartist = item.artist
+@@ -201,7 +202,7 @@ class TestHelper(Assertions):
+         item = Item.from_path(os.path.join(self.fixture_dir, 'min.mp3'))
+         item.add(self.lib)
+         item.update(values)
+-        item.move(copy=True)
++        item.move(operation=MoveOperation.COPY)
+         item.write()
+         return item
+ 
diff --git a/pkgs/tools/audio/beets/alternatives-plugin.nix b/pkgs/tools/audio/beets/alternatives-plugin.nix
index 27be81733d3..f808e90281e 100644
--- a/pkgs/tools/audio/beets/alternatives-plugin.nix
+++ b/pkgs/tools/audio/beets/alternatives-plugin.nix
@@ -11,6 +11,8 @@ pythonPackages.buildPythonApplication rec {
     sha256 = "10za6h59pxa13y8i4amqhc6392csml0dl771lssv6b6a98kamsy7";
   };
 
+  patches = [ ./alternatives-beets-1.4.6.patch ];
+
   postPatch = ''
     sed -i -e '/install_requires/,/\]/{/beets/d}' setup.py
     sed -i -e '/test_suite/d' setup.py