From 6d1ff45d5bbaa4fe1ac45abba48e8d131b8f2f2d Mon Sep 17 00:00:00 2001 From: dvzrv Date: Thu, 10 Nov 2022 15:09:16 +0000 Subject: [PATCH] upgpkg: python-pymupdf 1.21.0-1: Upgrade to 1.21.0. Add patch for setup.py to be able to build against system libmupdf. https://github.com/pymupdf/PyMuPDF/issues/2039 Disable broken test: https://github.com/pymupdf/PyMuPDF/issues/2040 git-svn-id: file:///srv/repos/svn-community/svn@1346428 9fca08f4-af9d-4005-b8df-a31f2cc04f65 --- trunk/PKGBUILD | 31 +++++++++++++++++---- trunk/python-pymupdf-1.21.0-fix_build.patch | 11 ++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 trunk/python-pymupdf-1.21.0-fix_build.patch diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index f8a117123633..17f54749777f 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -2,7 +2,7 @@ _name=PyMuPDF pkgname=python-pymupdf -pkgver=1.20.2 +pkgver=1.21.0 pkgrel=1 pkgdesc="Python bindings for MuPDF's rendering library" arch=(x86_64) @@ -16,12 +16,27 @@ optdepends=( 'python-pillow: for image file saving using pillow' ) options=(debug) -source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz) -sha512sums=('40a11fd0fcce29c553155e278d3489507dd2d7572c79b5819d145696e0a58d6fe935eef45754976af1b81a54958afa59b634af945f8f399faf4c07e8f3f76d99') -b2sums=('3b2715434479ece6a7551d09ddec651211a2a9b98abbd950240483762acf17d35f2e4ce95a12bc3009e4ea06c6e014131688ad81b2914d22902814cd2f38d8cb') +source=( + https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz + $pkgname-1.21.0-fix_build.patch +) +sha512sums=('be540106b448cd49eebc9de9123a2f8c1a26037e5bd426b2c07742e1e91892c6c1c031d4fe1e3fcb166a1aa287098912184892d8bd5481982db6c2fc151f13ec' + '654d320712803bb3a06928e19f4db30acc1e5548284e04dcb9e6634739f512157b83bbc91b7c5ef32d58855ddcb823fac45f8087b7e02238736ec02ce4c4c36c') +b2sums=('51d5419326116d9fa7551474422534dff96c5af0e986f2d2e5c2d7722c51eaf5d693b04f894fa332cd7103ac75cb31d11d68fd063f118aa4b1a13696706a6fb5' + '387c599663e2e51ecef635747daa353f2507c8bd44a18513321400c6393493f8d936e25fd63ceaf976718cb530c99c42b5ec6608fcbbed2c9a1e36162a42d6f4') + +prepare() { + # fix issue with setup.py: https://github.com/pymupdf/PyMuPDF/issues/2039 + patch -Np1 -d $_name-$pkgver -i ../$pkgname-1.21.0-fix_build.patch + + # remove bundled mupdf sources + rm -frv $_name-$pkgver/*.tgz +} build() { cd $_name-$pkgver + # NOTE: build against system libmupdf + export PYMUPDF_SETUP_MUPDF_BUILD="" python -m build --wheel --no-isolation } @@ -35,11 +50,15 @@ check() { python -m installer --destdir="$_test_dir" dist/*.whl export PYTHONPATH="$_test_dir/$_site_packages:$PYTHONPATH" - pytest -vv -c /dev/null tests/ + # disable broken test: https://github.com/pymupdf/PyMuPDF/issues/2040 + pytest -vv -c /dev/null tests/ -k 'not test_textbox3' } package() { - depends+=(libfreetype.so libjpeg.so) + depends+=( + freetype2 libfreetype.so + libjpeg-turbo libjpeg.so + ) cd $_name-$pkgver python -m installer --destdir="$pkgdir" dist/*.whl diff --git a/trunk/python-pymupdf-1.21.0-fix_build.patch b/trunk/python-pymupdf-1.21.0-fix_build.patch new file mode 100644 index 000000000000..e6ced0911e26 --- /dev/null +++ b/trunk/python-pymupdf-1.21.0-fix_build.patch @@ -0,0 +1,11 @@ +diff -ruN a/setup.py b/setup.py +--- a/setup.py 2022-11-08 13:16:44.000000000 +0100 ++++ b/setup.py 2022-11-10 15:22:51.896857765 +0100 +@@ -627,6 +627,7 @@ + else: + # Use installed MuPDF. + log( f'Using system mupdf.') ++ unix_build_type = "" + + # Set include and library paths for building PyMuPDF. + #