Merge pull request #124747 from dotlambda/whipper-fix

whipper: fix

authored by Robert Schütz and committed by GitHub 2d7fa67f 0e47517d

+31 -54
+31 -22
pkgs/applications/audio/whipper/default.nix
··· 1 - { lib, fetchFromGitHub, python3, cdparanoia, cdrdao, flac 2 - , sox, accuraterip-checksum, libsndfile, util-linux, substituteAll }: 1 + { lib 2 + , python3 3 + , fetchFromGitHub 4 + , libcdio-paranoia 5 + , cdrdao 6 + , libsndfile 7 + , flac 8 + , sox 9 + , util-linux 10 + }: 3 11 4 - python3.pkgs.buildPythonApplication rec { 12 + let 13 + bins = [ libcdio-paranoia cdrdao flac sox util-linux ]; 14 + in python3.pkgs.buildPythonApplication rec { 5 15 pname = "whipper"; 6 16 version = "0.10.0"; 7 17 ··· 12 22 sha256 = "00cq03cy5dyghmibsdsq5sdqv3bzkzhshsng74bpnb5lasxp3ia5"; 13 23 }; 14 24 15 - pythonPath = with python3.pkgs; [ 25 + nativeBuildInputs = with python3.pkgs; [ 26 + setuptools_scm 27 + docutils 28 + ]; 29 + 30 + propagatedBuildInputs = with python3.pkgs; [ 16 31 musicbrainzngs 17 32 mutagen 18 33 pycdio 19 34 pygobject3 20 - requests 21 35 ruamel_yaml 22 - setuptools 23 - setuptools_scm 36 + discid 37 + pillow 24 38 ]; 25 39 26 40 buildInputs = [ libsndfile ]; 27 41 28 42 checkInputs = with python3.pkgs; [ 29 43 twisted 30 - ]; 31 - 32 - patches = [ 33 - (substituteAll { 34 - src = ./paths.patch; 35 - inherit cdparanoia; 36 - }) 37 - ]; 44 + ] ++ bins; 38 45 39 46 makeWrapperArgs = [ 40 - "--prefix" "PATH" ":" (lib.makeBinPath [ accuraterip-checksum cdrdao util-linux flac sox ]) 47 + "--prefix" "PATH" ":" (lib.makeBinPath bins) 41 48 ]; 42 49 43 50 preBuild = '' 44 51 export SETUPTOOLS_SCM_PRETEND_VERSION="${version}" 45 52 ''; 46 53 47 - # some tests require internet access 48 - # https://github.com/JoeLametta/whipper/issues/291 49 - doCheck = false; 50 - 51 - preCheck = '' 52 - HOME=$TMPDIR 54 + checkPhase = '' 55 + runHook preCheck 56 + # disable tests that require internet access 57 + # https://github.com/JoeLametta/whipper/issues/291 58 + substituteInPlace whipper/test/test_common_accurip.py \ 59 + --replace "test_AccurateRipResponse" "dont_test_AccurateRipResponse" 60 + HOME=$TMPDIR ${python3.interpreter} -m unittest discover 61 + runHook postCheck 53 62 ''; 54 63 55 64 meta = with lib; {
-32
pkgs/applications/audio/whipper/paths.patch
··· 1 - --- a/whipper/program/cdparanoia.py 2 - +++ b/whipper/program/cdparanoia.py 3 - @@ -280,10 +280,10 @@ 4 - 5 - bufsize = 1024 6 - if self._overread: 7 - - argv = ["cd-paranoia", "--stderr-progress", 8 - + argv = ["@cdparanoia@/bin/cdparanoia", "--stderr-progress", 9 - "--sample-offset=%d" % self._offset, "--force-overread", ] 10 - else: 11 - - argv = ["cd-paranoia", "--stderr-progress", 12 - + argv = ["@cdparanoia@/bin/cdparanoia", "--stderr-progress", 13 - "--sample-offset=%d" % self._offset, ] 14 - if self._device: 15 - argv.extend(["--force-cdrom-device", self._device, ]) 16 - @@ -560,7 +560,7 @@ 17 - 18 - def getCdParanoiaVersion(): 19 - getter = common.VersionGetter('cd-paranoia', 20 - - ["cd-paranoia", "-V"], 21 - + ["@cdparanoia@/bin/cdparanoia", "-V"], 22 - _VERSION_RE, 23 - "%(version)s %(release)s") 24 - 25 - @@ -585,7 +585,7 @@ 26 - def __init__(self, device=None): 27 - # cdparanoia -A *always* writes cdparanoia.log 28 - self.cwd = tempfile.mkdtemp(suffix='.whipper.cache') 29 - - self.command = ['cd-paranoia', '-A'] 30 - + self.command = ['@cdparanoia@/bin/cdparanoia', '-A'] 31 - if device: 32 - self.command += ['-d', device]