summary refs log tree commit diff
path: root/pkgs/applications/audio/whipper
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/audio/whipper')
-rw-r--r--pkgs/applications/audio/whipper/default.nix73
-rw-r--r--pkgs/applications/audio/whipper/paths.patch32
2 files changed, 46 insertions, 59 deletions
diff --git a/pkgs/applications/audio/whipper/default.nix b/pkgs/applications/audio/whipper/default.nix
index 5cbc9a07b6c..d66c161664f 100644
--- a/pkgs/applications/audio/whipper/default.nix
+++ b/pkgs/applications/audio/whipper/default.nix
@@ -1,61 +1,80 @@
-{ stdenv, fetchFromGitHub, python3, cdparanoia, cdrdao, flac
-, sox, accuraterip-checksum, libsndfile, utillinux, substituteAll }:
+{ lib
+, python3
+, fetchFromGitHub
+, fetchpatch
+, libcdio-paranoia
+, cdrdao
+, libsndfile
+, flac
+, sox
+, util-linux
+}:
 
-python3.pkgs.buildPythonApplication rec {
+let
+  bins = [ libcdio-paranoia cdrdao flac sox util-linux ];
+in python3.pkgs.buildPythonApplication rec {
   pname = "whipper";
-  version = "0.9.1.dev7+g${stdenv.lib.substring 0 7 src.rev}";
+  version = "0.10.0";
 
   src = fetchFromGitHub {
     owner = "whipper-team";
     repo = "whipper";
-    rev = "9e95f0604fa30ab06445fe46e3bc93bba6092a05";
-    sha256 = "1c2qldw9vxpvdfh5wl6mfcd7zzz3v8r86ffqll311lcp2zin33dg";
+    rev = "v${version}";
+    sha256 = "00cq03cy5dyghmibsdsq5sdqv3bzkzhshsng74bpnb5lasxp3ia5";
   };
 
-  pythonPath = with python3.pkgs; [
+  patches = [
+    (fetchpatch {
+      # Use custom YAML subclass to be compatible with ruamel_yaml>=0.17
+      # https://github.com/whipper-team/whipper/pull/543
+      url = "https://github.com/whipper-team/whipper/commit/3ce5964dfe8be1e625c3e3b091360dd0bc34a384.patch";
+      sha256 = "0n9dmib884y8syvypsg88j0h71iy42n1qsrh0am8pwna63sl15ah";
+    })
+  ];
+
+  nativeBuildInputs = with python3.pkgs; [
+    setuptools-scm
+    docutils
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
     musicbrainzngs
     mutagen
     pycdio
     pygobject3
-    requests
     ruamel_yaml
-    setuptools
-    setuptools_scm
+    discid
+    pillow
   ];
 
   buildInputs = [ libsndfile ];
 
   checkInputs = with python3.pkgs; [
     twisted
-  ];
-
-  patches = [
-    (substituteAll {
-      src = ./paths.patch;
-      inherit cdparanoia;
-    })
-  ];
+  ] ++ bins;
 
   makeWrapperArgs = [
-    "--prefix" "PATH" ":" (stdenv.lib.makeBinPath [ accuraterip-checksum cdrdao utillinux flac sox ])
+    "--prefix" "PATH" ":" (lib.makeBinPath bins)
   ];
 
   preBuild = ''
     export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
   '';
 
-  # some tests require internet access
-  # https://github.com/JoeLametta/whipper/issues/291
-  doCheck = false;
-
-  preCheck = ''
-    HOME=$TMPDIR
+  checkPhase = ''
+    runHook preCheck
+    # disable tests that require internet access
+    # https://github.com/JoeLametta/whipper/issues/291
+    substituteInPlace whipper/test/test_common_accurip.py \
+      --replace "test_AccurateRipResponse" "dont_test_AccurateRipResponse"
+    HOME=$TMPDIR ${python3.interpreter} -m unittest discover
+    runHook postCheck
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/whipper-team/whipper";
     description = "A CD ripper aiming for accuracy over speed";
-    maintainers = with maintainers; [ rycee emily ];
+    maintainers = with maintainers; [ emily ];
     license = licenses.gpl3Plus;
     platforms = platforms.linux;
   };
diff --git a/pkgs/applications/audio/whipper/paths.patch b/pkgs/applications/audio/whipper/paths.patch
deleted file mode 100644
index 14b5384330d..00000000000
--- a/pkgs/applications/audio/whipper/paths.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/whipper/program/cdparanoia.py
-+++ b/whipper/program/cdparanoia.py
-@@ -280,10 +280,10 @@
- 
-         bufsize = 1024
-         if self._overread:
--            argv = ["cd-paranoia", "--stderr-progress",
-+            argv = ["@cdparanoia@/bin/cdparanoia", "--stderr-progress",
-                     "--sample-offset=%d" % self._offset, "--force-overread", ]
-         else:
--            argv = ["cd-paranoia", "--stderr-progress",
-+            argv = ["@cdparanoia@/bin/cdparanoia", "--stderr-progress",
-                     "--sample-offset=%d" % self._offset, ]
-         if self._device:
-             argv.extend(["--force-cdrom-device", self._device, ])
-@@ -560,7 +560,7 @@
- 
- def getCdParanoiaVersion():
-     getter = common.VersionGetter('cd-paranoia',
--                                  ["cd-paranoia", "-V"],
-+                                  ["@cdparanoia@/bin/cdparanoia", "-V"],
-                                   _VERSION_RE,
-                                   "%(version)s %(release)s")
- 
-@@ -585,7 +585,7 @@
-     def __init__(self, device=None):
-         # cdparanoia -A *always* writes cdparanoia.log
-         self.cwd = tempfile.mkdtemp(suffix='.whipper.cache')
--        self.command = ['cd-paranoia', '-A']
-+        self.command = ['@cdparanoia@/bin/cdparanoia', '-A']
-         if device:
-             self.command += ['-d', device]