summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8b477d3adbc9a6b5880e2e37c698cafe64c83f3d (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
# Maintainer: Victor A. Santos  <victoraur.santos@gmail.com>
pkgname=waf-git
pkgver=r2840.57377901
pkgrel=1
pkgdesc="General-purpose build system modelled after Scons"
arch=('any')
url="http://waf.io"
license=('GPL3')
depends=('python')
makedepends=('python' 'perl')
conflicts=('waf')
provides=('waf')
source=("$pkgname::git+https://gitlab.com/ita1024/waf.git")
md5sums=('SKIP')

pkgver() {
	cd "$srcdir/${pkgname}"

	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	cd "$srcdir/${pkgname}"

    python3 ./waf-light \
        configure --prefix=/usr \
        build --make-waf --tools='compat,compat15,ocaml,go,cython,scala,erlang,cuda,gcj,boost,pep8,eclipse'
}

package() {
	cd "$srcdir/${pkgname}"

    install -Dm755 waf "$pkgdir/usr/bin/waf"

    local wafversion=$(./waf-light --version | perl -p -e 's/waf ([0-9.]+) .*/$1/g')
    local wafrevision=$(grep -aPom1 '(?<=^REVISION=")[[:xdigit:]]*(?="$)' "$pkgdir/usr/bin/waf")
    local waflib="$pkgdir/usr/lib/waf3-$wafversion-$wafrevision"

    install -dm755 "$waflib"
    unzip -d "$waflib" zip/waflib.zip

    # compile all python sources for once to be used after installation.
    python -m compileall "$waflib"
}