mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-14 07:40:07 +02:00
79 lines
2.4 KiB
Bash
79 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="2"
|
|
pypi="4a/09/6afe87a8ea7acb6e4709223a704270ffe9929497add4d06b12305e229ba8"
|
|
SOURCE_URI="https://files.pythonhosted.org/packages/$pypi/PyMuPDF-$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="02eedf01f57c6bafb5e8667cea0088a2d2522643c47100f1908bec3a68a84888"
|
|
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=(python38 python39 python310)
|
|
PYTHON_VERSIONS=(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
|
|
}
|