python-fonttools: Different versions for python 2 & 3

python2-fontools: Update to 3.44.0
python3-fonttools: Update to 4.0.3
This commit is contained in:
Alexey Pavlov
2019-10-29 10:15:29 +03:00
parent a1708af89f
commit ed2e4cb4fb
7 changed files with 155 additions and 170 deletions

View File

@@ -1,170 +0,0 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=fonttools
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=3.43.1
pkgrel=1
pkgdesc="Converts OpenType and TrueType fonts to and from XML (mingw-w64)"
arch=('any')
url='https://github.com/fonttools/fonttools'
license=('MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-brotli"
"${MINGW_PACKAGE_PREFIX}-python2-enum34"
"${MINGW_PACKAGE_PREFIX}-python3-matplotlib"
"${MINGW_PACKAGE_PREFIX}-python2-numpy"
"${MINGW_PACKAGE_PREFIX}-python2-pyfilesystem2"
"${MINGW_PACKAGE_PREFIX}-python2-pyzopfli"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-sympy"
"${MINGW_PACKAGE_PREFIX}-python2-unicodedata2>=12.0.0"
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-brotli"
"${MINGW_PACKAGE_PREFIX}-python3-matplotlib"
"${MINGW_PACKAGE_PREFIX}-python3-numpy"
"${MINGW_PACKAGE_PREFIX}-python3-pyfilesystem2"
"${MINGW_PACKAGE_PREFIX}-python3-pyzopfli"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-sympy"
"${MINGW_PACKAGE_PREFIX}-python3-unicodedata2>=12.0.0")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python2-pytest-runner"
"${MINGW_PACKAGE_PREFIX}-python3-pytest-runner")
options=('staticlibs' 'strip' '!debug')
source=("https://github.com/fonttools/fonttools/releases/download/${pkgver}/fonttools-${pkgver}.zip")
sha256sums=('217176a154341c05c91a1b2f78f5534fb7ca14b84671ac73893e14578527888e')
prepare() {
cd "${srcdir}"
for builddir in python{2,3}-build-${CARCH}; do
rm -rf ${builddir} | true
cp -r "${_realname}-${pkgver}" "${builddir}"
done
}
build() {
for pver in {2,3}; do
msg "Python ${pver} build for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python${pver} setup.py build
done
}
#Enable tests when the dependencies are solved
check() {
for pver in {2,3}; do
msg "Python ${pver} test for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
${MINGW_PREFIX}/bin/python${pver} setup.py pytest || warning "Tests failed"
done
}
package_python3-fonttools() {
depends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-numpy")
optdepends=("${MINGW_PACKAGE_PREFIX}-python3-brotli: WOFF 1.0 and WOFF 2.0 webfonts"
"${MINGW_PACKAGE_PREFIX}-python3-pyfilesystem2: for fontTools.ufoLib: to read/write UFO fonts"
"${MINGW_PACKAGE_PREFIX}-python3-pyzopfli: WOFF 1.0 and WOFF 2.0 webfonts"
"${MINGW_PACKAGE_PREFIX}-python3-sympy: for fontTools.misc.symfont, module for symbolic font statistics analysis"
"${MINGW_PACKAGE_PREFIX}-python3-unicodedata2: for Unicode 12.0")
install=${_realname}3-${CARCH}.install
cd "${srcdir}/python3-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} \
--root="${pkgdir}" --optimize=1 --skip-build
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _ff in ${pkgdir}${MINGW_PREFIX}/bin/*.py; do
sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_ff}
done
install -D -m755 LICENSE "${pkgdir}${MINGW_PREFIX}"/share/licenses/python3-${_realname}/LICENSE
chmod oga+r "${pkgdir}${MINGW_PREFIX}"/share/man/man1/ttx.1
}
package_python2-fonttools() {
depends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-numpy"
)
optdepends=("${MINGW_PACKAGE_PREFIX}-python3-brotli: WOFF 1.0 and WOFF 2.0 webfonts"
"${MINGW_PACKAGE_PREFIX}-python2-pyfilesystem2: to read/write UFO fonts"
"${MINGW_PACKAGE_PREFIX}-python2-enum34: to read/write UFO fonts"
"${MINGW_PACKAGE_PREFIX}-python2-pyzopfli: WOFF 1.0 and WOFF 2.0 webfonts"
"${MINGW_PACKAGE_PREFIX}-python2-sympy: for fontTools.misc.symfont, module for symbolic font statistics analysis"
"${MINGW_PACKAGE_PREFIX}-python2-unicodedata2: for Unicode 12.0")
install=${_realname}2-${CARCH}.install
cd "${srcdir}/python2-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \
--root="${pkgdir}" --optimize=1 --skip-build
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _ff in ${pkgdir}${MINGW_PREFIX}/bin/*.py; do
sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_ff}
done
# for Python2 packages, you want to rename some stuff from the bin directory
# with the 2 suffix like in the mingw-w64-python-pygments package to avoid
# conflicts when installing both the Python2 and Python3 packages
for f in fonttools; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe
if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest
sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest
fi
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py
done
for f in pyftmerge; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe
if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest
sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest
fi
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py
done
for f in pyftsubset; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe
if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest
sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest
fi
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py
done
for f in ttx; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe
if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest
sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest
fi
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py
mv "${pkgdir}${MINGW_PREFIX}"/share/man/man1/${f}{,2}.1
done
#### end section ####
install -D -m755 LICENSE "${pkgdir}${MINGW_PREFIX}"/share/licenses/python2-${_realname}/LICENSE
chmod oga+r "${pkgdir}${MINGW_PREFIX}"/share/man/man1/ttx2.1
}
package_mingw-w64-i686-python2-fonttools() {
package_python2-fonttools
}
package_mingw-w64-i686-python3-fonttools() {
package_python3-fonttools
}
package_mingw-w64-x86_64-python2-fonttools() {
package_python2-fonttools
}
package_mingw-w64-x86_64-python3-fonttools() {
package_python3-fonttools
}

View File

@@ -0,0 +1,99 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=fonttools
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}")
pkgver=3.44.0
pkgrel=1
pkgdesc="Converts OpenType and TrueType fonts to and from XML (mingw-w64)"
arch=('any')
url='https://github.com/fonttools/fonttools'
license=('MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-numpy")
optdepends=("${MINGW_PACKAGE_PREFIX}-python2-brotli: WOFF 1.0 and WOFF 2.0 webfonts"
"${MINGW_PACKAGE_PREFIX}-python2-pyfilesystem2: to read/write UFO fonts"
"${MINGW_PACKAGE_PREFIX}-python2-enum34: to read/write UFO fonts"
"${MINGW_PACKAGE_PREFIX}-python2-pyzopfli: WOFF 1.0 and WOFF 2.0 webfonts"
"${MINGW_PACKAGE_PREFIX}-python2-sympy: for fontTools.misc.symfont, module for symbolic font statistics analysis"
"${MINGW_PACKAGE_PREFIX}-python2-unicodedata2: for Unicode 12.0")
makedepends=("${MINGW_PACKAGE_PREFIX}-python2-matplotlib"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python2-pytest-runner")
install=${_realname}2-${CARCH}.install
options=('staticlibs' 'strip' '!debug')
source=("https://github.com/fonttools/fonttools/releases/download/${pkgver}/fonttools-${pkgver}.zip")
sha256sums=('b72cc654e07219d8d7d8c624d1af13cec6f6cc2a51189f8385c295725e4ac36c')
build() {
msg "Python 2 build for ${CARCH}"
rm -rf python2-build-${CARCH}
cp -r "${_realname}-${pkgver}" "python2-build-${CARCH}"
cd "${srcdir}/python2-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python${pver} setup.py build
}
#Enable tests when the dependencies are solved
check() {
msg "Python 2 test for ${CARCH}"
cd "${srcdir}/python2-build-${CARCH}"
${MINGW_PREFIX}/bin/python2 setup.py pytest || warning "Tests failed"
}
package() {
cd "${srcdir}/python2-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \
--root="${pkgdir}" --optimize=1 --skip-build
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _ff in ${pkgdir}${MINGW_PREFIX}/bin/*.py; do
sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_ff}
done
# for Python2 packages, you want to rename some stuff from the bin directory
# with the 2 suffix like in the mingw-w64-python-pygments package to avoid
# conflicts when installing both the Python2 and Python3 packages
for f in fonttools; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe
if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest
sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest
fi
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py
done
for f in pyftmerge; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe
if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest
sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest
fi
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py
done
for f in pyftsubset; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe
if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest
sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest
fi
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py
done
for f in ttx; do
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe
if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest
sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest
fi
mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py
mv "${pkgdir}${MINGW_PREFIX}"/share/man/man1/${f}{,2}.1
done
#### end section ####
install -D -m755 LICENSE "${pkgdir}${MINGW_PREFIX}"/share/licenses/python2-${_realname}/LICENSE
chmod oga+r "${pkgdir}${MINGW_PREFIX}"/share/man/man1/ttx2.1
}

View File

@@ -0,0 +1,56 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=fonttools
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=4.0.2
pkgrel=1
pkgdesc="Converts OpenType and TrueType fonts to and from XML (mingw-w64)"
arch=('any')
url='https://github.com/fonttools/fonttools'
license=('MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-numpy")
optdepends=("${MINGW_PACKAGE_PREFIX}-python3-brotli: WOFF 1.0 and WOFF 2.0 webfonts"
"${MINGW_PACKAGE_PREFIX}-python3-pyfilesystem2: for fontTools.ufoLib: to read/write UFO fonts"
"${MINGW_PACKAGE_PREFIX}-python3-pyzopfli: WOFF 1.0 and WOFF 2.0 webfonts"
"${MINGW_PACKAGE_PREFIX}-python3-sympy: for fontTools.misc.symfont, module for symbolic font statistics analysis")
install=${_realname}3-${CARCH}.install
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-matplotlib"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytest-runner")
options=('staticlibs' 'strip' '!debug')
source=("https://github.com/fonttools/fonttools/releases/download/${pkgver}/fonttools-${pkgver}.zip")
sha256sums=('bb9bf6b5b4ded33e0d9f823e5ae2e1fa643af4d614915660abe3853a9a6931cd')
build() {
msg "Python 3 build for ${CARCH}"
rm -rf python3-build-${CARCH}
cp -r "${_realname}-${pkgver}" "python3-build-${CARCH}"
cd "${srcdir}/python3-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python${pver} setup.py build
}
#Enable tests when the dependencies are solved
check() {
msg "Python 3 test for ${CARCH}"
cd "${srcdir}/python3-build-${CARCH}"
${MINGW_PREFIX}/bin/python3 setup.py pytest || warning "Tests failed"
}
package() {
cd "${srcdir}/python3-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} \
--root="${pkgdir}" --optimize=1 --skip-build
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _ff in ${pkgdir}${MINGW_PREFIX}/bin/*.py; do
sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_ff}
done
install -D -m755 LICENSE "${pkgdir}${MINGW_PREFIX}"/share/licenses/python3-${_realname}/LICENSE
chmod oga+r "${pkgdir}${MINGW_PREFIX}"/share/man/man1/ttx.1
}