summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: adb4b765ba28acb6ada280279950b7c4cecd9a39 (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
pkgname=glib2-static
pkgver=2.58.2
pkgrel=3
pkgdesc="Low level core library. Static library."
url="https://wiki.gnome.org/Projects/GLib"
license=(LGPL2.1)
arch=(x86_64)
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=97bcbcb8c2aa0aeee5afd9939efbadbae0c8a8fa  # tags/2.58.2^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() {
  arch-meson glib build \
    --default-library static \
    -D selinux=false \
    -D man=true \
    -D gtk_doc=false \
    -Dinternal_pcre=false \
    -Dfam=false
  ninja -C build
}

check() {
  meson test -C build
}

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

  # Only install static library
  rm -rf "$pkgdir/usr/"{bin,include,share,lib/glib-2.0,lib/pkgconfig} $pkgdir/usr/lib/*.so*
}