mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-14 15:50:07 +02:00
Also: switch SOURCE_URI to github. The tarball there is 7.28 MB, versus the previous 86.25 MB (due to the inclusion of mupdf.tar.gz, which we don't need here, and weights 84.36 MB).
87 lines
2.5 KiB
Bash
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="3"
|
|
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=(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
|
|
\""
|
|
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
|
|
}
|