core/python-fonttools/PKGBUILD

68 lines
1.9 KiB
Bash
Raw Normal View History

2015-12-18 06:57:57 +08:00
# Contributor: Andrzej Giniewicz <gginiu@gmail.com>
# Contributor: Firmicus <firmicus āt gmx dōt net>
# Contributor: flying sheep <flying-sheep@web.de>
pkgbase=python-fonttools
2015-12-18 07:01:13 +08:00
pkgname=('python2-fonttools' 'python3-fonttools')
2017-10-27 06:00:45 +08:00
pkgver=3.15.1
pkgrel=1
2015-12-18 06:57:57 +08:00
pkgdesc="Converts OpenType and TrueType fonts to and from XML"
url="https://github.com/behdad/fonttools"
license=("BSD")
arch=('any')
2017-10-27 06:00:45 +08:00
makedepends=("python2-setuptools" "python3-setuptools" "python2-numpy" "python3-numpy")
source=("https://github.com/fonttools/fonttools/releases/download/${pkgver}/fonttools-${pkgver}.zip")
md5sums=('99cea1ff85d08a3af66f9fb95bb7a2c1')
2015-12-18 06:57:57 +08:00
prepare() {
cd "$srcdir"
cp -a fonttools-${pkgver} fonttools-py2-${pkgver}
cd fonttools-py2-${pkgver}
sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
-e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
-i $(find . -name '*.py')
}
build() {
msg "Building Python2"
cd "$srcdir"/fonttools-py2-${pkgver}
python2 setup.py build
msg "Building Python3"
cd "$srcdir"/fonttools-${pkgver}
2015-12-18 07:01:13 +08:00
python3 setup.py build
2015-12-18 06:57:57 +08:00
}
package_python2-fonttools() {
depends=("python2-numpy")
cd "$srcdir"/fonttools-py2-${pkgver}
python2 setup.py install --skip-build --root="$pkgdir" --optimize=1
# fix conflicts with python-fonttools
mv "$pkgdir"/usr/bin/pyftinspect{,2}
mv "$pkgdir"/usr/bin/pyftmerge{,2}
mv "$pkgdir"/usr/bin/pyftsubset{,2}
mv "$pkgdir"/usr/bin/ttx{,2}
mv "$pkgdir"/usr/share/man/man1/ttx{,2}.1
2017-10-27 06:00:45 +08:00
mv "$pkgdir"/usr/bin/fonttools{,2}
2015-12-18 06:57:57 +08:00
2017-10-27 06:00:45 +08:00
install -D -m755 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
2015-12-18 06:57:57 +08:00
chmod oga+r "$pkgdir"/usr/share/man/man1/ttx2.1
}
2015-12-18 07:01:13 +08:00
package_python3-fonttools() {
depends=("python3-numpy")
2015-12-18 06:57:57 +08:00
cd "$srcdir"/fonttools-${pkgver}
2015-12-18 07:01:13 +08:00
python3 setup.py install --skip-build --root="$pkgdir" --optimize=1
2015-12-18 06:57:57 +08:00
2017-10-27 06:00:45 +08:00
install -D -m755 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
2015-12-18 06:57:57 +08:00
chmod oga+r "$pkgdir"/usr/share/man/man1/ttx.1
}