# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: XZS <d dot f dot fischer at web dot de>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Sebastien Binet <binet@cern.ch>
pkgname=waf
pkgver=2.1.1
pkgrel=1
pkgdesc='General-purpose build system modelled after Scons'
arch=(any)
url="http://waf.io/"
license=(BSD-3-Clause)
depends=(python)
makedepends=(
git
unzip
)
provides=(python-waf)
source=(
git+https://gitlab.com/ita1024/waf.git?signed#tag=$pkgname-$pkgver
building-waf.md
)
sha512sums=('1d8216a9b692008d4ea35ca56af8e16a5a869fee3c740d94ab5474d95210510e29026d75868eae412f49398a047313a362a66185f69e36458b1f409cf5affd81'
'fce4e44c3eff4b87165ad4c6856c028f90437af26ed0d2e7cdef825987a60ebe16afda3238813bc2aa4f4f39df2a705a9df870f93c85e9d755d5d1636f07af70')
b2sums=('e76df3856e2b24c0508e19b58b6b2bbf71e108d8833a6aecf2449dbb5d84863c1ff74fb78feeeaf8e3210bf509747a90053cb2597c5756b3a9877354c84e9b33'
'a42039f8419417a312ccdb65a01b22c5e1133ebaa3e3a905387565bf2e3991ce3efb74f3b2fb0ec5e8408b665044946337c6ecfd4af1083ae2811aad9dc7d76e')
validpgpkeys=(8C7EB2F93B0C45F5732FE5D11BAC571DCD772295) # Waf Project <noreply@waf.io>
prepare() {
local py_ver=$(python3 -c "import sys; print(str(sys.version_info.major)+'.'+str(sys.version_info.minor))")
cd $pkgname
# make waf find its waflib
sed -e "/test(i/ s|dirname|'python${py_ver}/site-packages/waf'|" -i waf-light
# license needs to be extracted:
# https://gitlab.com/ita1024/waf/issues/2251
head -n 30 waf | tail -n 28 | sed -e 's/# //g; s/"""//g' > LICENSE
}
build() {
cd $pkgname
./waf-light \
configure --prefix=/usr \
build --make-waf
# removing compiled in vendored library from executable
sed -i '/^#==>$/,/^#<==$/d' waf
}
package() {
local py_ver=$(python3 -c "import sys; print(str(sys.version_info.major)+'.'+str(sys.version_info.minor))")
cd $pkgname
install -vDm 755 waf -t "$pkgdir/usr/bin"
install -vDm 644 wscript -t "$pkgdir/usr/share/$pkgname/"
# installing, byte-compiling waflib and stripping pkgdir from it
install -vDm 644 waflib/*.py -t "$pkgdir/usr/lib/python$py_ver/site-packages/waf/waflib/"
install -vDm 644 waflib/Tools/*.py -t "$pkgdir/usr/lib/python$py_ver/site-packages/waf/waflib/Tools/"
install -vDm 644 waflib/extras/*.py -t "$pkgdir/usr/lib/python$py_ver/site-packages/waf/waflib/extras/"
python -m compileall -d "/usr/lib/python$py_ver" "$pkgdir/usr/lib/python$py_ver/"
python -O -m compileall -d "/usr/lib/python$py_ver" "$pkgdir/usr/lib/python$py_ver/"
install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
install -vDm 644 {README,../building-waf}.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
# vim:set ts=2 sw=2 et: