Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
upgpkg: python-pymupdf 1.21.0-1: Upgrade to 1.21.0.
Browse files Browse the repository at this point in the history
Add patch for setup.py to be able to build against system libmupdf.
pymupdf/PyMuPDF#2039
Disable broken test: pymupdf/PyMuPDF#2040

git-svn-id: file:///srv/repos/svn-community/svn@1346428 9fca08f4-af9d-4005-b8df-a31f2cc04f65
  • Loading branch information
dvzrv committed Nov 10, 2022
1 parent 9291636 commit 82de0bc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
31 changes: 25 additions & 6 deletions python-pymupdf/trunk/PKGBUILD
Expand Up @@ -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)
Expand All @@ -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
}

Expand All @@ -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
Expand Down
11 changes: 11 additions & 0 deletions python-pymupdf/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.
#

0 comments on commit 82de0bc

Please sign in to comment.