Files
haikuports/dev-python/pymupdf/pymupdf-1.20.2.recipe
OscarL 70ac5cadda python3.8: bulk removal of now obsolete "_python38" packages. (#9328)
* python3.8: bulk removal of now obsolete "_python38" packages.

Done via scripting. No functional change intended or expected.

Some manual tweaks will follow.

* python3.8: further manual tweaks after bulk-3.8-removal.

Unlike the previous commit with automated changes,
I've tested builds for *these* recipes in beta4 64 bits.
2023-09-01 18:19:50 +00:00

87 lines
2.5 KiB
Bash

SUMMARY="Python bindings for MuPDF's rendering library"
DESCRIPTION="PyMuPDF is a Python binding with support for MuPDF, a lightweight PDF, XPS, and \
E-book viewer, renderer, and toolkit, which is maintained and developed by Artifex Software, Inc.
MuPDF can access files in PDF, XPS, OpenXPS, CBZ, EPUB and FB2 (e-books) formats, and it is known \
for its top performance and high rendering quality.
With PyMuPDF you can access files with extensions like \".pdf\", \".xps\", \".oxps\", \".cbz\", \
\".fb2\" or \".epub\". In addition, about 10 popular image formats can also be handled like \
documents: \".png\", \".jpg\", \".bmp\", \".tiff\", etc.."
HOMEPAGE="https://pypi.org/project/PyMuPDF/
https://github.com/pymupdf/PyMuPDF/"
COPYRIGHT="2022 Jorj X. McKie and Ruikai Liu"
LICENSE="AGPL-3.0"
REVISION="4"
SOURCE_URI="https://github.com/pymupdf/PyMuPDF/archive/refs/tags/$portVersion.tar.gz"
CHECKSUM_SHA256="e639e5190067bc3ff599ffb09bfad7da0165c0098fe42ddc1a849715904b0ee0"
SOURCE_FILENAME="PyMuPDF-$portVersion.tar.gz"
SOURCE_DIR="PyMuPDF-$portVersion"
PATCHES="pymupdf-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libmupdf$secondaryArchSuffix >= 1.20
devel:libfreetype$secondaryArchSuffix
swig$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:git
"
PYTHON_PACKAGES=(python39 python310)
PYTHON_VERSIONS=(3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
\""
if [ "$targetArchitecture" = x86_gcc2 ]; then
eval "PROVIDES_$pythonPackage+=\"
pymupdf_$pythonPackage = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
lib:libmupdf$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
\""
BUILD_REQUIRES+="
setuptools_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
rm -rf build
$python setup.py build install \
--root=/ --prefix=$prefix
packageEntries $pythonPackage \
$prefix/lib/python*
done
}