Merge pull request #145130 from marius851000/patoolfix

patool: fix the non-use of hard-coded binary
This commit is contained in:
K900 2022-07-18 17:48:46 +03:00 committed by GitHub
commit e2e13364a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,17 +1,16 @@
{ lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook, p7zip,
unzip, cabextract, zip, zopfli, lzip, zpaq, gnutar, gnugrep, diffutils, file,
cabextract, zip, lzip, zpaq, gnutar, gnugrep, diffutils, file,
gzip, bzip2, xz}:
# unrar is unfree, as well as 7z with unrar support, not including it (patool doesn't support unar)
# it will still use unrar if present in the path
let
compression-utilities = [
p7zip
unzip
gnutar
cabextract
zip
zopfli
lzip
zpaq
gzip
@ -34,9 +33,9 @@ buildPythonPackage rec {
sha256 = "0v4r77sm3yzh7y1whfwxmp01cchd82jbhvbg9zsyd2yb944imzjy";
};
prePatch = ''
postPatch = ''
substituteInPlace patoolib/util.py \
--replace "path = None" 'path = append_to_path(os.environ["PATH"], "${lib.makeBinPath compression-utilities}")'
--replace "path = None" 'path = os.environ["PATH"] + ":${lib.makeBinPath compression-utilities}"'
'';
checkInputs = [ pytestCheckHook ] ++ compression-utilities;