summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorXZS2016-06-15 16:53:15 +0200
committerXZS2016-06-15 18:36:02 +0200
commit1293aeb8ba43a4288fcb19ffbb8fbf9ec33f3f69 (patch)
tree37ee3efe5e8bb394c8e29821cfde0bf0fb631eea
parent5ac0417c2e9b3622a89ce35fdddf0bd291b38864 (diff)
downloadaur-1293aeb8ba43a4288fcb19ffbb8fbf9ec33f3f69.tar.gz
patch waf code aware of directory
Although waf tools can be installed to the linked wafdir, these files are then useless for packaging, because at least pacman does not support files residing below linked directories. Patching the source code to access the version-independent library directory without symbolic link detour directs the files to end up in an actual directory again and thus solves the problem. With this, the symbolic link is now entirely gone as waf in practice does not use it any longer. To divert as little as possible from the upstream source, the new directory is added as an additional search path. This is especially important as the existing waf binary may be used as a blueprint composing a custom waf to include with a project and should thous retain all original features and avoid unexpected behaviour.
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD25
-rw-r--r--wafdir.patch16
3 files changed, 33 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2b48ae047b7f..a0805c047672 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = waf
pkgdesc = General-purpose build system modelled after Scons
pkgver = 1.8.21
- pkgrel = 1
+ pkgrel = 2
url = http://waf.io/
arch = any
license = BSD
@@ -9,8 +9,11 @@ pkgbase = waf
depends = python
provides = python-waf
source = https://waf.io/waf-1.8.21.tar.bz2
+ source = wafdir.patch
md5sums = 14245fc1c3efc262cdec5f5b5a5010e7
+ md5sums = ff472805caa81e02cb15bcf87031f722
sha256sums = b14db0532c1ba9e89ae3aea53cb4b5c769b751952f1fc194dc1e306ac03794e2
+ sha256sums = 432fb8e21fe31047e16ac068b761961f1a3965785e570bf54aca1c4c07d253f4
pkgname = waf
diff --git a/PKGBUILD b/PKGBUILD
index 5c3846d536e4..6c4d89c05126 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=waf
pkgver=1.8.21
-pkgrel=1
+pkgrel=2
pkgdesc='General-purpose build system modelled after Scons'
url='http://waf.io/'
arch=('any')
@@ -12,13 +12,18 @@ license=('BSD')
depends=('python')
makedepends=('unzip')
provides=('python-waf')
-source=("https://waf.io/${pkgname}-${pkgver}.tar.bz2")
-md5sums=('14245fc1c3efc262cdec5f5b5a5010e7')
-sha256sums=('b14db0532c1ba9e89ae3aea53cb4b5c769b751952f1fc194dc1e306ac03794e2')
+source=("https://waf.io/${pkgname}-${pkgver}.tar.bz2"
+ 'wafdir.patch')
+md5sums=('14245fc1c3efc262cdec5f5b5a5010e7'
+ 'ff472805caa81e02cb15bcf87031f722')
+sha256sums=('b14db0532c1ba9e89ae3aea53cb4b5c769b751952f1fc194dc1e306ac03794e2'
+ '432fb8e21fe31047e16ac068b761961f1a3965785e570bf54aca1c4c07d253f4')
prepare() {
cd "$pkgname-$pkgver"
+ patch -p1 -i ../wafdir.patch
+
# Extract license
head -n 30 waf | tail -n 25 > LICENSE
@@ -31,8 +36,6 @@ build() {
./waf-light \
configure --prefix=/usr \
build --make-waf --tools='compat,compat15,ocaml,go,cython,scala,erlang,cuda,gcj,boost,pep8,eclipse'
-
- sed -i "s/'%s-%s-%s' % (WAF, VERSION, REVISION)/WAF/" waf
}
package() {
@@ -40,12 +43,10 @@ package() {
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm755 waf "$pkgdir/usr/bin/waf"
- local revision="waf3-$pkgver-$(grep -aPom1 '(?<=^REVISION=")[[:xdigit:]]*(?="$)' "$pkgdir/usr/bin/waf")"
- local libdir="$pkgdir/usr/lib"
- local wafdir="$libdir/waf"
- install -dm755 "$libdir"/{waf,"$revision"}
- ln -s ../waf "$libdir/$revision/waflib"
- bsdtar -xf zip/waflib.zip -s '/^waflib.//' -C "$wafdir"
+ # Place waf library and tools.
+ local wafdir="$pkgdir/usr/lib/waf"
+ install -dm755 "$wafdir"
+ bsdtar -xf zip/waflib.zip -C "$wafdir"
# compile all python sources for once to be used after installation.
python -OOm compileall "$wafdir"
diff --git a/wafdir.patch b/wafdir.patch
new file mode 100644
index 000000000000..344738adfdaf
--- /dev/null
+++ b/wafdir.patch
@@ -0,0 +1,16 @@
+diff --git a/waf-light b/waf-light
+index 308eaae..2c75d2e 100755
+--- a/waf-light
++++ b/waf-light
+@@ -146,8 +146,9 @@ def find_lib():
+
+ dirname = '%s-%s-%s' % (WAF, VERSION, REVISION)
+ for i in (INSTALL,'/usr','/usr/local','/opt'):
+- w = test(i + '/lib/' + dirname)
+- if w: return w
++ for wafdir in ('waf', dirname):
++ w = test(i + '/lib/' + wafdir)
++ if w: return w
+
+ #waf-local
+ dir = join(base, (sys.platform != 'win32' and '.' or '') + dirname)