desktop/waf/PKGBUILD
2016-10-10 20:07:58 +02:00

45 lines
1.3 KiB
Bash

# contribution from Arch https://aur4.archlinux.org/packages/waf/
pkgname=waf
pkgver=1.9.5
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=('24234eec8c2c861bdcbe2a57c092787511db40cf25ce2bdb09bb7bd33eb4a172')
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"
}