python310Packages.patool: fix tests to be compatible with file 5.45

This commit is contained in:
Theodore Ni 2023-08-26 23:50:20 -07:00
parent c173b99c6c
commit 3bae1670ee
No known key found for this signature in database
GPG Key ID: 48B67583BDDD4474

View File

@ -1,6 +1,21 @@
{ lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook, p7zip,
cabextract, zip, lzip, zpaq, gnutar, gnugrep, diffutils, file,
gzip, bzip2, xz}:
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, pytestCheckHook
, p7zip
, 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
@ -24,15 +39,31 @@ in
buildPythonPackage rec {
pname = "patool";
version = "1.12";
format = "setuptools";
#pypi doesn't have test data
src = fetchFromGitHub {
owner = "wummel";
repo = pname;
rev = "upstream/${version}";
sha256 = "0v4r77sm3yzh7y1whfwxmp01cchd82jbhvbg9zsyd2yb944imzjy";
hash = "sha256-Xv4aCUnLi+b1T29tuKRADTIWwK2dO8iDP/D7UfU5mWw=";
};
patches = [
# https://github.com/wummel/patool/pull/63
(fetchpatch {
name = "apk-sometimes-has-mime-jar.patch";
url = "https://github.com/wummel/patool/commit/a9f3ee3d639a1065be024001e89c0b153511b16b.patch";
hash = "sha256-a4aWqHHc/cBs5T2QKZ08ky1K1tqKZEgqVmTmV11aTVE=";
})
# https://github.com/wummel/patool/pull/130
(fetchpatch {
name = "apk-sometimes-has-mime-android-package.patch";
url = "https://github.com/wummel/patool/commit/e8a1eea1d273b278a1b6f5029d2e21cb18bc9ffd.patch";
hash = "sha256-AVooVdU4FNIixUfwyrn39N2SDFHNs4CUYzS5Eey+DrU=";
})
];
postPatch = ''
substituteInPlace patoolib/util.py \
--replace "path = None" 'path = os.environ["PATH"] + ":${lib.makeBinPath compression-utilities}"'