archrelease: copy trunk to extra-x86_64
[arch-packages.git] / freetype2 / trunk / PKGBUILD
blob0fbec9bae90beca0954d2cff402987f67d1a4643
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.13.0
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=(
15   brotli
16   bzip2
17   harfbuzz
18   libpng
19   sh
20   zlib
22 makedepends=(
23   librsvg
24   libx11
25   meson
26   qt5-base
28 source=(
29   https://download-mirror.savannah.gnu.org/releases/freetype/freetype-$pkgver.tar.xz{,.sig}
30   https://download-mirror.savannah.gnu.org/releases/freetype/freetype-doc-$pkgver.tar.xz{,.sig}
31   https://download-mirror.savannah.gnu.org/releases/freetype/ft2demos-$pkgver.tar.xz{,.sig}
32   0001-Enable-table-validation-modules.patch
33   0002-Enable-subpixel-rendering.patch
34   0003-Enable-infinality-subpixel-hinting.patch
35   0004-Enable-long-PCF-family-names.patch
36   0005-builds-meson-parse_modules_cfg.py-Handle-gxvalid-and.patch
37   freetype2.sh
39 sha256sums=('5ee23abd047636c24b2d43c6625dcafc66661d1aca64dec9e0d05df29592624c'
40             'SKIP'
41             'f6421803442beb5fc74435eb570bea427c8ca763dbf14b4f36caf3145534e9eb'
42             'SKIP'
43             '4ce8367f9cb9468413c0ea9b3df00c3bb92801418d92a25d157a1ff56e927fcc'
44             'SKIP'
45             'd279a9d4b2c146722dbc03f9a33009846efe8bbbe3ada52beb4a1aa4d4dfaa38'
46             'f2e8a16126723458b413e58da267fb30332d0b42fef972f951e3e9fc081fa492'
47             '8e61d12ebdbbcb764a38d4798ee728074bac0aa20978d538b6e7045a63949ab8'
48             'cc364cc0ca21b8b30f29d90ab394d82f3303ca7d9813d866e6bf14f9bccd9564'
49             '08cf087d7d612b4228e24d74df95cf1f397f7c41054c42837c63c1f33ffaee09'
50             'f7f8e09c44f7552c883846e9a6a1efc50377c4932234e74adc4a8ff750606467')
51 validpgpkeys=(E30674707856409FF1948010BE6C3AAC63AD8E3F) # Werner Lemberg <wl@gnu.org>
53 prepare() {
54   ln -sr freetype-$pkgver ft2demos-$pkgver/subprojects/freetype2
56   cd freetype-$pkgver
57   patch -Np1 -i ../0001-Enable-table-validation-modules.patch
58   patch -Np1 -i ../0002-Enable-subpixel-rendering.patch
59   patch -Np1 -i ../0003-Enable-infinality-subpixel-hinting.patch
60   patch -Np1 -i ../0004-Enable-long-PCF-family-names.patch
61   patch -Np1 -i ../0005-builds-meson-parse_modules_cfg.py-Handle-gxvalid-and.patch
64 build() {
65   local meson_options=(
66     -D freetype2:default_library=shared
67   )
69   arch-meson ft2demos-$pkgver build "${meson_options[@]}"
70   meson compile -C build
73 check() {
74   meson test -C build --print-errorlogs
77 _pick() {
78   local p="$1" f d; shift
79   for f; do
80     d="$srcdir/$p/${f#$pkgdir/}"
81     mkdir -p "$(dirname "$d")"
82     mv "$f" "$d"
83     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
84   done
87 package_freetype2() {
88   provides=(libfreetype.so)
89   install=freetype2.install
90   backup=(etc/profile.d/freetype2.sh)
92   meson install -C build --destdir="$pkgdir"
93   install -Dt "$pkgdir/etc/profile.d" -m644 freetype2.sh
94   install -Dt "$pkgdir/usr/share/aclocal" -m644 \
95     freetype-$pkgver/builds/unix/freetype2.m4
97   _pick demos "$pkgdir"/usr/bin
98   _pick demos "$pkgdir"/usr/share/man/man1
101 package_freetype2-demos() {
102   pkgdesc="Freetype tools and demos"
103   depends=(freetype2 libx11 librsvg)
104   optdepends=('qt5-base: ftinspect')
105   mv demos/* "$pkgdir"
108 package_freetype2-docs() {
109   pkgdesc="Freetype documentation"
110   depends=(freetype2)
112   mkdir -p "${pkgdir}/usr/share/doc"
113   cp -r freetype-$pkgver/docs "$pkgdir/usr/share/doc/$pkgbase"
116 # vim:set sw=2 sts=-1 et: