Files
haikuports/dev-python/fonttools/fonttools-4.40.0.recipe
OscarL a6bff52757 _python* packages: do not use Python 3.9 as "defaultVersion" anymore. (#12589)
While switching to 3.10 as default, lets just drop the 3.9 versions of these packages.

----

Checked runtime and build dependencies, but only tried a build of `hatchling` locally. I'll merge as is, and if something breaks, will fix later on.
2025-07-14 15:09:48 -03:00

106 lines
2.3 KiB
Bash

SUMMARY="A library for manipulating fonts"
DESCRIPTION="FontTools is a library for manipulating fonts, written in Python.\
It supports TrueType, OpenType, AFM and to an extent Type 1 and some \
Mac-specific formats."
HOMEPAGE="https://github.com/behdad/fonttools"
COPYRIGHT="2017 Just van Rossum
2010 Pablo Impallari
2001-2010 by the STI Pub Companies
1998-2003 by MicroPress
1990 by Elsevier, Inc.
2015-2020 Belleve Invis
2016 Google Inc."
LICENSE="MIT
SIL Open Font License v1.1
Apache v2"
REVISION="4"
SOURCE_URI="https://github.com/fonttools/fonttools/archive/$portVersion.tar.gz"
SOURCE_FILENAME="fonttools-$portVersion.tar.gz"
CHECKSUM_SHA256="f03f5a5414587fed31d11e007e680ea522a918ea27a793a5931641ef5915bcd2"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_VERSIONS=(3.10)
defaultVersion=3.10
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
cmd:fonttools_$pythonVersion = $portVersion
cmd:pyftmerge_$pythonVersion = $portVersion
cmd:pyftsubset_$pythonVersion = $portVersion
cmd:ttx_$pythonVersion = $portVersion
\""
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_${pythonPackage}+=\"
cmd:fonttools = $portVersion
cmd:pyftmerge = $portVersion
cmd:pyftsubset = $portVersion
cmd:ttx = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage+=\"
haiku
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
build_$pythonPackage
installer_$pythonPackage
setuptools_$pythonPackage
wheel_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
rm -rf build
$python -m build -wn
$python -m installer -p $prefix dist/*.whl
# Version suffix all the scripts
for f in $binDir/*; do
mv $f $f-$pythonVersion
done
# And provide suffix-less symlinks for the default version
if [ $pythonVersion = $defaultVersion ]; then
for f in $binDir/*; do
ln -sr $f ${f%-$pythonVersion}
done
fi
mkdir -p $manDir
mv $prefix/share/man/* $manDir
rm -rf $prefix/share
packageEntries $pythonPackage \
$prefix/lib/python* \
$binDir \
$manDir
done
}