desktop/waf/PKGBUILD
2016-03-11 23:44:39 +01:00

45 lines
1.3 KiB
Bash

# contribution from Arch https://aur4.archlinux.org/packages/waf/
pkgname=waf
pkgver=1.8.20
pkgrel=1
pkgdesc='General-purpose build system modelled after Scons'
url='http://waf.io/'
arch=('any')
license=('BSD')
depends=('python3')
makedepends=('unzip')
provides=('python3-waf')
options=('!emptydirs')
source=("https://github.com/waf-project/waf/archive/waf-$pkgver.tar.gz")
sha256sums=('f23c6b59672e18069b41b33cf670f745a859382604347af8b8cfbae319268d0a')
prepare() {
cd "$pkgname-$pkgname-$pkgver"
# Extracting license
head -n 30 waf-light | tail -n 25 > LICENSE
# Python 3 fix
sed -i '0,/env python/s//python3/' waf-light
}
build() {
cd "$pkgname-$pkgname-$pkgver"
./waf-light \
configure --prefix=/usr \
build --make-waf --tools='compat,compat15,ocaml,go,cython,scala,erlang,cuda,gcj,boost,pep8,eclipse'
}
package() {
cd "$pkgname-$pkgname-$pkgver"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm755 waf "$pkgdir/usr/bin/waf"
local waflib="$pkgdir/usr/lib/waf3-$pkgver-$(grep -aPom1 '(?<=^REVISION=")[[:xdigit:]]*(?="$)' "$pkgdir/usr/bin/waf")"
install -dm755 "$waflib"
unzip -d "$waflib" zip/waflib.zip
# compile all python sources for once to be used after installation.
python3 -m compileall "$waflib"
}