archrelease: copy trunk to community-any
[ArchLinux/community.git] / waf / trunk / PKGBUILD
blobd158cad1f81605217ac7dbc4800af396dcb85305
1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Contributor: XZS <d dot f dot fischer at web dot de>
3 # Contributor: Alexander Rødseth <rodseth@gmail.com>
4 # Contributor: Sebastien Binet <binet@cern.ch>
6 pkgname=waf
7 pkgver=2.0.25
8 pkgrel=2
9 pkgdesc='General-purpose build system modelled after Scons'
10 arch=(any)
11 url="http://waf.io/"
12 license=(BSD)
13 depends=(python)
14 makedepends=(unzip)
15 provides=(python-waf)
16 source=(
17   https://waf.io/${pkgname}-${pkgver}.tar.bz2{,.asc}
18   building-waf.md
20 sha512sums=('c146f94ca4c342f6f45fbfc1c2a98474f116cb05f5abae03ee53d616ce8558093fcc013c1ff1e27396fd7583a21cdf9209b3ce333b13cad77778a69ad57e9973'
21             'SKIP'
22             'fce4e44c3eff4b87165ad4c6856c028f90437af26ed0d2e7cdef825987a60ebe16afda3238813bc2aa4f4f39df2a705a9df870f93c85e9d755d5d1636f07af70')
23 b2sums=('e72429a4acbf28b51b5e8f820e5a9904edd0b3e2aa5e59ecb7c37e8415b2f9805645d0dd93b507b596b001ae77213d0e936f16b246c990aee27dd0859879dbc0'
24         'SKIP'
25         'a42039f8419417a312ccdb65a01b22c5e1133ebaa3e3a905387565bf2e3991ce3efb74f3b2fb0ec5e8408b665044946337c6ecfd4af1083ae2811aad9dc7d76e')
26 validpgpkeys=('0B3972B2D9E32EAB423D2E0F22BE0C62FFBFA548') # Thomas Nagy <tnagy@waf.io>
28 prepare() {
29   local py_ver=$(python3 -c "import sys; print(str(sys.version_info.major)+'.'+str(sys.version_info.minor))")
31   cd $pkgname-$pkgver
32   # make waf find its waflib
33   sed -e "/test(i/ s|dirname|'python${py_ver}/site-packages/waf'|" -i waf-light
34   # license needs to be extracted:
35   # https://gitlab.com/ita1024/waf/issues/2251
36   head -n 30 waf | tail -n 28 | sed -e 's/# //g; s/"""//g' > LICENSE
39 build() {
40   cd $pkgname-$pkgver
41   ./waf-light \
42     configure --prefix=/usr \
43     build --make-waf
45   # removing compiled in vendored library from executable
46   sed -i '/^#==>$/,/^#<==$/d' waf
49 package() {
50   local py_ver=$(python3 -c "import sys; print(str(sys.version_info.major)+'.'+str(sys.version_info.minor))")
52   cd $pkgname-$pkgver
53   install -vDm 755 waf -t "$pkgdir/usr/bin"
54   install -vDm 644 wscript -t "$pkgdir/usr/share/$pkgname/"
56   # installing, byte-compiling waflib and stripping pkgdir from it
57   install -vDm 644 waflib/*.py -t "$pkgdir/usr/lib/python$py_ver/site-packages/waf/waflib/"
58   install -vDm 644 waflib/Tools/*.py -t "$pkgdir/usr/lib/python$py_ver/site-packages/waf/waflib/Tools/"
59   install -vDm 644 waflib/extras/*.py -t "$pkgdir/usr/lib/python$py_ver/site-packages/waf/waflib/extras/"
60   python -m compileall -d "/usr/lib/python$py_ver" "$pkgdir/usr/lib/python$py_ver/"
61   python -O -m compileall -d "/usr/lib/python$py_ver" "$pkgdir/usr/lib/python$py_ver/"
62   install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
63   install -vDm 644 {README,../building-waf}.md -t "$pkgdir/usr/share/doc/$pkgname/"
65 # vim:set ts=2 sw=2 et: