summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4bb8602ac5002fd681f26f687582b3a5147114a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Maintainer: CloverGit <clovergit@hotmail.com>
# Contributor: drakkan <nicola.murino at gmail dot com>
# Contributor: Chris Kitching <chriskitching@linux.com>
# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
pkgname=mingw-w64-cairo-bootstrap
pkgver=1.18.2
pkgrel=1
pkgdesc="2D graphics library with support for multiple output devices (mingw-w64 bootstrap)"
_commit=200441e6855854eb4dbf338e44d67b00ababe07f # tags/1.18.2^0
arch=(any)
url="http://cairographics.org/"
license=("LGPL" "MPL")
makedepends=(mingw-w64-meson git)
depends=(mingw-w64-pixman mingw-w64-glib2 mingw-w64-fontconfig mingw-w64-libpng mingw-w64-lzo)
options=(!strip !buildflags staticlibs)
provides=(${pkgname%-bootstrap}=$pkgver)
conflicts=(${pkgname%-bootstrap})
source=("git+https://gitlab.freedesktop.org/cairo/cairo.git#commit=$_commit"
        "0026-create-argb-fonts.all.patch")
sha256sums=('adb04ff99fbd481ffc1653cdc1c135e4185fc5c5bfb2d5a44ba924af00605b83'
            '6db6c44fbdb4926d09afa978fe80430186c4b7b7d255059602b1f94c6a079975')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

pkgver() {
  cd "${srcdir}/cairo"
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd "${srcdir}/cairo"
  patch -p1 -i ${srcdir}/0026-create-argb-fonts.all.patch
}

build() {
  for _arch in ${_architectures}; do
    mkdir -p "${srcdir}/cairo/build-${_arch}"
    cd "${srcdir}/cairo/build-${_arch}"
    ${_arch}-meson \
      -D spectre=disabled \
      -D dwrite=disabled \
      -D freetype=enabled \
      -D fontconfig=enabled \
      -D tests=disabled \
      -D symbol-lookup=disabled \
      -D gtk_doc=false \
      --buildtype=release \
      --default-library=both ..
    ninja
  done
}

package() {
  for _arch in ${_architectures}; do
    DESTDIR="${pkgdir}" ninja -C "${srcdir}/cairo/build-${_arch}" install
    find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
    find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
  done
}
# vim: set sw=2 ts=2 et: