mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-18 01:30:07 +02:00
* pymupdf: add recipe for 1.19.6 * Exclude x86_gcc2 and add python3.10 as target * Add AGPL-3.0 locally to pymupdf * Add x86 support to setup.py * Move closing quote mark * Change include/library folder order to better support secondary-arch * look for corresponding version of mupdf * hardcode mupdf version number
78 lines
2.4 KiB
Bash
78 lines
2.4 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="1"
|
|
pypi="032d24e0c774e67742395fda163a172c60e4d0f9875785d5199eb2956d5e"
|
|
SOURCE_URI="https://files.pythonhosted.org/packages/9f/1d/$pypi/PyMuPDF-$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="ef3d13e27f1585d776f6a2597f113aabd28d36b648b983a72850b21c5399ab08"
|
|
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.19
|
|
devel:libfreetype$secondaryArchSuffix
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:git
|
|
"
|
|
|
|
PYTHON_PACKAGES=(python3 python38 python39 python310)
|
|
PYTHON_VERSIONS=(3.7 3.8 3.9 3.10)
|
|
for i in "${!PYTHON_PACKAGES[@]}"; do
|
|
pythonPackage=${PYTHON_PACKAGES[i]}
|
|
pythonVersion=${PYTHON_VERSIONS[$i]}
|
|
eval "PROVIDES_${pythonPackage}=\"\
|
|
${portName}_$pythonPackage = $portVersion\
|
|
\"; \
|
|
REQUIRES_$pythonPackage=\"\
|
|
haiku\n\
|
|
cmd:python$pythonVersion\n\
|
|
lib:libmupdf$secondaryArchSuffix\n\
|
|
lib:libfreetype$secondaryArchSuffix\n\
|
|
\""
|
|
BUILD_REQUIRES="$BUILD_REQUIRES
|
|
setuptools_$pythonPackage"
|
|
BUILD_PREREQUIRES="$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
|
|
}
|