summaryrefslogtreecommitdiff
path: root/libre/glib2-static/PKGBUILD
blob: 9283512aa5651aa41efd26fc81ebcc26f92c672a (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
61
62
63
64
65
66
67
68
# Maintainer (Arch:glib2) Jan de Groot <jgc@archlinux.org>
# Maintainer: Luke Shumaker <lukeshu@parabola.nu>
# Contributor: Márcio Silva <coadde@hyperbola.info>

pkgname=glib2-static
pkgver=2.58.3
pkgrel=1
pkgrel+=.static2
pkgdesc="Low level core library"
pkgdesc+=" (static libraries)"
url="https://wiki.gnome.org/Projects/GLib"
license=(LGPL2.1)
arch=(x86_64)
arch+=(i686 armv7h)
depends=(pcre libffi)
makedepends=(libffi zlib shared-mime-info python libelf git util-linux meson dbus libxslt docbook-xsl)
checkdepends=(desktop-file-utils dbus)
optdepends=('python: gdbus-codegen, glib-genmarshal, glib-mkenums, gtester-report'
            'libelf: gresource inspection tool')
options=('!docs' '!libtool' '!emptydirs' '!strip' 'staticlibs')
_commit=f2d1128ffae0de87680e411fb62ccfccafed6b1c  # tags/2.58.3^0
source=("git+https://gitlab.gnome.org/GNOME/glib.git#commit=$_commit"
        noisy-glib-compile-schemas.diff
        fix-static-build-589.diff)
sha256sums=('SKIP'
            '81a4df0b638730cffb7fa263c04841f7ca6b9c9578ee5045db6f30ff0c3fc531'
            'f4790fc845f2b4811ce5df5ef3a7dfcc23a1593ec4e19ae9173bb799a045d00f')

pkgver() {
  cd glib
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd glib

  # Suppress noise from glib-compile-schemas.hook
  patch -Np1 -i ../noisy-glib-compile-schemas.diff
  patch -Np1 -i ../fix-static-build-589.diff
}

build() {
  if [[ $CARCH = i686 ]]; then
    # GTimer has trouble with x87 math, force SSE2 (which is implied
    # on x86_64).
    CFLAGS+=' -msse2 -mfpmath=sse'
  fi

  arch-meson glib build \
    --default-library static \
    -D selinux=false \
    -D man=true \
    -D gtk_doc=false \
    -D internal_pcre=false \
    -D fam=false
  ninja -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build

  # remove conflicting files
  rm -rf "$pkgdir/usr/"{bin,include,share,lib/glib-2.0,lib/pkgconfig} $pkgdir/usr/lib/*.so*
}