archrelease: copy trunk to testing-x86_64
[arch-packages.git] / freetype2 / trunk / PKGBUILD
blobf85da4c7d3c0816bbae5dd9bcb267a39a3474bd3
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Jan de Groot <jgc@archlinux.org>
4 pkgbase=freetype2
5 pkgname=(freetype2 freetype2-demos freetype2-docs)
6 pkgver=2.12.1
7 pkgrel=1
8 pkgdesc="Font rasterization library"
9 url="https://www.freetype.org/"
10 arch=(x86_64)
11 license=(GPL)
12 # adding harfbuzz for improved OpenType features auto-hinting
13 # introduces a cycle dep to harfbuzz depending on freetype wanted by upstream
14 depends=(zlib bzip2 sh libpng harfbuzz brotli)
15 makedepends=(libx11 qt5-base meson librsvg)
16 options=(debug)
17 source=(https://download-mirror.savannah.gnu.org/releases/freetype/freetype-$pkgver.tar.xz{,.sig}
18         https://download-mirror.savannah.gnu.org/releases/freetype/freetype-doc-$pkgver.tar.xz{,.sig}
19         https://download-mirror.savannah.gnu.org/releases/freetype/ft2demos-$pkgver.tar.xz{,.sig}
20         0001-Enable-table-validation-modules.patch
21         0002-Enable-subpixel-rendering.patch
22         0003-Enable-infinality-subpixel-hinting.patch
23         0004-Enable-long-PCF-family-names.patch
24         freetype2.sh)
25 sha256sums=('4766f20157cc4cf0cd292f80bf917f92d1c439b243ac3018debf6b9140c41a7f'
26             'SKIP'
27             '6664a32e4eedaa89f45422c1150e32da46fd301c972cbfd19d2dcc6dd96f07d1'
28             'SKIP'
29             'ce729d97f166a919a6a3037c949af01d5d6e1783614024d72683153f0bc5ef05'
30             'SKIP'
31             '12c869eeba212c74d07d3d7815848b047ecb5282d5463dffb3bb6d219315d4da'
32             '2497dcb3650271db9bb7ad4f3379b5b3c6a19f5ca5388dd9ba7d42b5c15c8c4f'
33             'caa0bc7d3dfa3b4c6b9beecda6141405dafe540f99a655dc83d1704fa232ac20'
34             '8bf978cd1abd73f54c53f7d214c368b1fd8921cd9800d2cc84427c662ffbbdcb'
35             'f7f8e09c44f7552c883846e9a6a1efc50377c4932234e74adc4a8ff750606467')
36 validpgpkeys=(E30674707856409FF1948010BE6C3AAC63AD8E3F) # Werner Lemberg <wl@gnu.org>
38 prepare() {
39   ln -sr freetype-$pkgver ft2demos-$pkgver/subprojects/freetype2
41   cd freetype-$pkgver
42   patch -Np1 -i ../0001-Enable-table-validation-modules.patch
43   patch -Np1 -i ../0002-Enable-subpixel-rendering.patch
44   patch -Np1 -i ../0003-Enable-infinality-subpixel-hinting.patch
45   patch -Np1 -i ../0004-Enable-long-PCF-family-names.patch
48 build() {
49   arch-meson ft2demos-$pkgver build \
50     -D freetype2:default_library=shared
51   meson compile -C build
54 check() {
55   meson test -C build --print-errorlogs
58 _pick() {
59   local p="$1" f d; shift
60   for f; do
61     d="$srcdir/$p/${f#$pkgdir/}"
62     mkdir -p "$(dirname "$d")"
63     mv "$f" "$d"
64     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
65   done
68 package_freetype2() {
69   provides=(libfreetype.so)
70   install=freetype2.install
71   backup=(etc/profile.d/freetype2.sh)
73   meson install -C build --destdir="$pkgdir"
74   install -Dt "$pkgdir/etc/profile.d" -m644 freetype2.sh
75   install -Dt "$pkgdir/usr/share/aclocal" -m644 \
76     freetype-$pkgver/builds/unix/freetype2.m4
78   _pick demos "$pkgdir"/usr/bin
79   _pick demos "$pkgdir"/usr/share/man/man1
82 package_freetype2-demos() {
83   pkgdesc="Freetype tools and demos"
84   depends=(freetype2 libx11 librsvg)
85   optdepends=('qt5-base: ftinspect')
86   mv demos/* "$pkgdir"
89 package_freetype2-docs() {
90   pkgdesc="Freetype documentation"
91   depends=(freetype2)
93   mkdir -p "${pkgdir}/usr/share/doc"
94   cp -r freetype-$pkgver/docs "$pkgdir/usr/share/doc/$pkgbase"
97 # vim:set sw=2 et: