python313Packages.pymupdf: 1.26.4 -> 1.26.6 (#461885)

This commit is contained in:
dotlambda
2025-11-15 18:15:41 +00:00
committed by GitHub
2 changed files with 35 additions and 13 deletions

View File

@@ -0,0 +1,12 @@
diff --git a/tests/conftest.py b/tests/conftest.py
index 8b9bd31b..472f57b8 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -29,7 +29,6 @@ def install_required_packages():
print(f'{__file__}:install_required_packages)(): Running: {command}', flush=1)
subprocess.run(command, shell=1, check=1)
-install_required_packages()
# Need to import pymupdf only after we've installed pymupdf-fonts above,
# because pymupdf imports pymupdf_fonts, and copes with import failure.

View File

@@ -2,7 +2,6 @@
lib, lib,
stdenv, stdenv,
buildPythonPackage, buildPythonPackage,
pythonOlder,
fetchFromGitHub, fetchFromGitHub,
python, python,
toPythonModule, toPythonModule,
@@ -45,31 +44,45 @@ let
in in
buildPythonPackage rec { buildPythonPackage rec {
pname = "pymupdf"; pname = "pymupdf";
version = "1.26.4"; version = "1.26.6";
pyproject = true; pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "pymupdf"; owner = "pymupdf";
repo = "PyMuPDF"; repo = "PyMuPDF";
tag = version; tag = version;
hash = "sha256-bzyScV7vznuBQNP8nTjHL2exIs/rVmJBH+soyuAwIGI="; hash = "sha256-CYDgMhsOqqm9AscJxVcjU72P63gpJafj+2cj03RFGaw=";
}; };
patches = [
# `conftest.py` tries to run `pip install` to install test dependencies.
./conftest-dont-pip-install.patch
];
# swig is not wrapped as Python package # swig is not wrapped as Python package
postPatch = '' postPatch = ''
substituteInPlace setup.py \ substituteInPlace setup.py \
--replace-fail "ret.append( 'swig')" "pass" \ --replace-fail "ret.append('swig')" "pass" \
--replace-fail "ret.append('swig==4.3.1')" "pass"
''; '';
nativeBuildInputs = [ # `build_extension` passes arguments to `$LD` that are meant for `c++`.
# When `LD` is not set, `build_extension` falls back to using `c++` in `PATH`.
# See https://github.com/pymupdf/PyMuPDF/blob/1.26.6/pipcl.py#L1998 for details.
preConfigure = ''
unset LD
'';
build-system = [
libclang libclang
swig swig
psutil
setuptools setuptools
]; ];
dependencies = [
mupdf-cxx-lib
];
buildInputs = [ buildInputs = [
freetype freetype
harfbuzz harfbuzz
@@ -79,8 +92,6 @@ buildPythonPackage rec {
gumbo gumbo
]; ];
propagatedBuildInputs = [ mupdf-cxx-lib ];
env = { env = {
# force using system MuPDF (must be defined in environment and empty) # force using system MuPDF (must be defined in environment and empty)
PYMUPDF_SETUP_MUPDF_BUILD = ""; PYMUPDF_SETUP_MUPDF_BUILD = "";
@@ -100,11 +111,9 @@ buildPythonPackage rec {
nativeCheckInputs = [ nativeCheckInputs = [
pytestCheckHook pytestCheckHook
];
checkInputs = [
fonttools fonttools
pillow pillow
psutil
pymupdf-fonts pymupdf-fonts
]; ];
@@ -123,6 +132,7 @@ buildPythonPackage rec {
"test_4457" "test_4457"
"test_4445" "test_4445"
"test_4533" "test_4533"
"test_4702"
# Not a git repository, so git ls-files fails # Not a git repository, so git ls-files fails
"test_open2" "test_open2"
]; ];