summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6488e92bdd0ff74c6191f6b3ed42833f940bc776 (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
# Maintainer: James An <james@jamesan.ca>

pkgname="php-cairo-git"
_pkgname=${pkgname%-git}
__pkgname=${_pkgname#php-}
pkgver=1.0.0_dev.r9.g9662114
pkgrel=1
pkgdesc="PHP Object Oriented interface to Cairo Graphics library."
arch=('any')
url="https://github.com/gtkforphp/$__pkgname"
depends=('php' "$__pkgname" 'php-datastructures')
license=('PHP')
makedepends=('git')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=("$_pkgname"::"git+https://github.com/gtkforphp/$__pkgname.git#branch=php7")
md5sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  (
    set -o pipefail
    release="$(grep VERSION src/php_cairo.h | cut -f2 -d\" | tr - _)"
    hash="$(git blame src/php_cairo.h | grep VERSION | cut -f1 -d\ )"
    revision="$(git rev-list --count $hash..HEAD).g$(git rev-parse --short HEAD)"
    printf "%s.r%s" "$release" "$revision"
  )
}

build() {
  cd "$_pkgname"

  phpize
  ./configure --prefix=/usr --with-cairo
  make
}

check() {
  cd "$_pkgname"

  NO_INTERACTION=1 make -k test
}

package() {
  cd "$_pkgname"

  make INSTALL_ROOT="$pkgdir/" install
  install -Dm644 src/php_cairo_api.h "$pkgdir/usr/include/php/ext/cairo/php_cairo_api.h"
}