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 }: 3 4 - python3.pkgs.buildPythonApplication rec { 5 pname = "whipper"; 6 version = "0.10.0"; 7 ··· 12 sha256 = "00cq03cy5dyghmibsdsq5sdqv3bzkzhshsng74bpnb5lasxp3ia5"; 13 }; 14 15 - pythonPath = with python3.pkgs; [ 16 musicbrainzngs 17 mutagen 18 pycdio 19 pygobject3 20 - requests 21 ruamel_yaml 22 - setuptools 23 - setuptools_scm 24 ]; 25 26 buildInputs = [ libsndfile ]; 27 28 checkInputs = with python3.pkgs; [ 29 twisted 30 - ]; 31 - 32 - patches = [ 33 - (substituteAll { 34 - src = ./paths.patch; 35 - inherit cdparanoia; 36 - }) 37 - ]; 38 39 makeWrapperArgs = [ 40 - "--prefix" "PATH" ":" (lib.makeBinPath [ accuraterip-checksum cdrdao util-linux flac sox ]) 41 ]; 42 43 preBuild = '' 44 export SETUPTOOLS_SCM_PRETEND_VERSION="${version}" 45 ''; 46 47 - # some tests require internet access 48 - # https://github.com/JoeLametta/whipper/issues/291 49 - doCheck = false; 50 - 51 - preCheck = '' 52 - HOME=$TMPDIR 53 ''; 54 55 meta = with lib; {
··· 1 + { lib 2 + , python3 3 + , fetchFromGitHub 4 + , libcdio-paranoia 5 + , cdrdao 6 + , libsndfile 7 + , flac 8 + , sox 9 + , util-linux 10 + }: 11 12 + let 13 + bins = [ libcdio-paranoia cdrdao flac sox util-linux ]; 14 + in python3.pkgs.buildPythonApplication rec { 15 pname = "whipper"; 16 version = "0.10.0"; 17 ··· 22 sha256 = "00cq03cy5dyghmibsdsq5sdqv3bzkzhshsng74bpnb5lasxp3ia5"; 23 }; 24 25 + nativeBuildInputs = with python3.pkgs; [ 26 + setuptools_scm 27 + docutils 28 + ]; 29 + 30 + propagatedBuildInputs = with python3.pkgs; [ 31 musicbrainzngs 32 mutagen 33 pycdio 34 pygobject3 35 ruamel_yaml 36 + discid 37 + pillow 38 ]; 39 40 buildInputs = [ libsndfile ]; 41 42 checkInputs = with python3.pkgs; [ 43 twisted 44 + ] ++ bins; 45 46 makeWrapperArgs = [ 47 + "--prefix" "PATH" ":" (lib.makeBinPath bins) 48 ]; 49 50 preBuild = '' 51 export SETUPTOOLS_SCM_PRETEND_VERSION="${version}" 52 ''; 53 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 62 ''; 63 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]
···