summary refs log tree commit diff
path: root/pkgs/applications/audio/whipper/default.nix
diff options
context:
space:
mode:
authorRobert Schütz <dev@schuetz-co.de>2021-05-28 13:39:19 +0200
committerRobert Schütz <dev@schuetz-co.de>2021-05-28 14:18:57 +0200
commitdf7eecceb5d81857284b1b6793ac4cd34c7f503e (patch)
tree9fa9a25bcb0e33468f9b9dcf07644ceaba018e49 /pkgs/applications/audio/whipper/default.nix
parent6a3befb13553ba7eea7336a5ece5a3776d5d1602 (diff)
whipper: fix
Diffstat (limited to 'pkgs/applications/audio/whipper/default.nix')
-rw-r--r--pkgs/applications/audio/whipper/default.nix53
1 files changed, 31 insertions, 22 deletions
diff --git a/pkgs/applications/audio/whipper/default.nix b/pkgs/applications/audio/whipper/default.nix
index b63680a8f488e..a295788c117b3 100644
--- a/pkgs/applications/audio/whipper/default.nix
+++ b/pkgs/applications/audio/whipper/default.nix
@@ -1,7 +1,17 @@
-{ lib, fetchFromGitHub, python3, cdparanoia, cdrdao, flac
-, sox, accuraterip-checksum, libsndfile, util-linux, substituteAll }:
+{ lib
+, python3
+, fetchFromGitHub
+, 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.10.0";
 
@@ -12,44 +22,43 @@ python3.pkgs.buildPythonApplication rec {
     sha256 = "00cq03cy5dyghmibsdsq5sdqv3bzkzhshsng74bpnb5lasxp3ia5";
   };
 
-  pythonPath = with python3.pkgs; [
+  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" ":" (lib.makeBinPath [ accuraterip-checksum cdrdao util-linux 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 lib; {