Merge pull request #133399 from luhuaei/master

pymupdf: fix version incorrect cause build error
This commit is contained in:
Sandro 2021-08-11 11:34:00 +02:00 committed by GitHub
commit 32cdb3956c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View file

@ -1,7 +1,6 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, mupdf
, swig
, freetype
@ -26,10 +25,7 @@ buildPythonPackage rec {
patches = [
# Add NIX environment support.
# Should be removed next pyMuPDF release.
(fetchpatch {
url = "https://github.com/pymupdf/PyMuPDF/commit/d9b2d42019e5705a1c6621ea0cdfa26da1ce9ad5.patch";
sha256 = "fc3f6ad88c8f3933ed9ab9d4db9ebec8bc30ed5113f6ca9d72080b56dfa52ad6";
})
./nix-support.patch
];
postPatch = ''

View file

@ -0,0 +1,17 @@
--- a/setup.py
+++ b/setup.py
@@ -36,10 +36,14 @@ LIBRARIES = {
"opensuse": OPENSUSE,
"fedora": FEDORA,
"alpine": ALPINE,
+ "nix": FEDORA,
}
def load_libraries():
+ if os.getenv("NIX_STORE"):
+ return LIBRARIES["nix"]
+
try:
import distro