summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f74e351bc2c756a9e10c26516314adfc1d786f50 (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
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
# shellcheck disable=SC2034
# Contributor: Filipe Laíns (FFY00) <filipe.lains@gmail.com>
# Contributor: Alexander Hunziker <alex.hunziker@gmail.com>
# Contributor: Alessio Biancalana <dottorblaster@gmail.com>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Salamandar <felix@piedallu.me>

_pkgname=babl
pkgname="${_pkgname}-git"
pkgver=0.1.89.r1694.6737d58
pkgrel=1
pkgdesc="Dynamic, any to any, pixel format translation library."
arch=('x86_64')
url="https://www.gegl.org/babl"
license=('LGPL3')
depends=('glibc' 'lcms2')
makedepends=('git' 'gobject-introspection' 'meson' 'vala')
provides=("babl=${pkgver%%.r*}")
conflicts=('babl')
options=(!libtool)
source=(git+https://gitlab.gnome.org/GNOME/babl)
md5sums=('SKIP')

prepare() {
    mkdir "${srcdir}/build" -p

    export CFLAGS CXXFLAGS LDFLAGS
    meson "${srcdir}/${_pkgname}"\
          "${srcdir}/build" \
        --prefix=/usr \
        -Dbuildtype=release \
        -Db_lto=true \
        -Dwith-docs=false
}

pkgver() {
  cd ${srcdir}/${_pkgname}
  printf "%s.r%s.%s" \
    $(grep -ozP "(?s)^project\('babl'.*?version: *'\K[\d.]*" meson.build|tr '\0' '\n') \
    $(git rev-list --count HEAD) \
    $(git rev-parse --short HEAD)
}

build() {
    export NINJA_STATUS="[%p | %f<%r<%u | %cbps ] "
    ninja -C "${srcdir}/build"
}

package() {
    DESTDIR="${pkgdir}" ninja -C "${srcdir}/build" install
}

check() {
    meson test -C "${srcdir}/build"
}