[arch-commits] Commit in waf/repos (3 files)
Felix Yan
felixonmars at archlinux.org
Fri Oct 25 15:39:59 UTC 2019
Date: Friday, October 25, 2019 @ 15:39:59
Author: felixonmars
Revision: 519145
archrelease: copy trunk to community-staging-any
Added:
waf/repos/community-staging-any/
waf/repos/community-staging-any/PKGBUILD
(from rev 519142, waf/trunk/PKGBUILD)
waf/repos/community-staging-any/building-waf.md
(from rev 519143, waf/trunk/building-waf.md)
-----------------+
PKGBUILD | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
building-waf.md | 44 +++++++++++++++++++++++++++++++++++++
2 files changed, 107 insertions(+)
Copied: waf/repos/community-staging-any/PKGBUILD (from rev 519142, waf/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD (rev 0)
+++ community-staging-any/PKGBUILD 2019-10-25 15:39:59 UTC (rev 519145)
@@ -0,0 +1,63 @@
+# Maintainer: David Runge <dave at sleepmap.de>
+# Contributor: XZS <d dot f dot fischer at web dot de>
+# Contributor: Alexander Rødseth <rodseth at gmail.com>
+# Contributor: Sebastien Binet <binet at cern.ch>
+
+pkgname=waf
+pkgver=2.0.18
+pkgrel=2
+pkgdesc='General-purpose build system modelled after Scons'
+url="http://waf.io/"
+arch=('any')
+license=('BSD')
+depends=('python')
+makedepends=('unzip')
+provides=('python-waf')
+source=("https://waf.io/${pkgname}-${pkgver}.tar.bz2"{,.asc}
+ 'building-waf.md')
+sha512sums=('aa102922dd48bd1d2f39208ee84f91330a1a5993a3471667181e3e47817d4cf57b0ff9041c1d75b6648d279de6688c7564670cb76ca19da1bd412d1603389e0a'
+ 'SKIP'
+ 'fce4e44c3eff4b87165ad4c6856c028f90437af26ed0d2e7cdef825987a60ebe16afda3238813bc2aa4f4f39df2a705a9df870f93c85e9d755d5d1636f07af70')
+validpgpkeys=('8AF22DE5A06822E3474F3C7049B4C67C05277AAA') # Thomas Nagy <tnagy at waf.io>
+
+prepare() {
+ local _py_ver=$(python3 -c "import sys; print(str(sys.version_info.major)+'.'+str(sys.version_info.minor))")
+ cd "$pkgname-$pkgver"
+ # 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-$pkgver"
+ ./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-$pkgver"
+ 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:
Copied: waf/repos/community-staging-any/building-waf.md (from rev 519143, waf/trunk/building-waf.md)
===================================================================
--- community-staging-any/building-waf.md (rev 0)
+++ community-staging-any/building-waf.md 2019-10-25 15:39:59 UTC (rev 519145)
@@ -0,0 +1,44 @@
+# Building a custom waf binary
+
+Waf is primarily intended to be distributed with the project using it. The Arch
+Linux package makes waf usable directly, but also brings all files necessary to
+compose a custom binary for your project. To do so, create a temporary
+directory, link all the resources together and build it.
+
+ cd $(mktemp -d)
+ ln -s /usr/share/waf/wscript .
+ ln -s /usr/bin/waf waf-light
+ ln -s /usr/lib/python3.7/waf/waflib .
+ mkdir zip
+ waf configure build --make-waf --tools=''
+
+The last line allows you to choose tools to include.
+
+After this process, there should be a `waf` binary ready in the current working
+directory.
+
+## Building an older version for current Python
+
+Especially after version 2 introduced API-breaking changes, some projects may
+have become incompatible and require older waf versions to build. Fortunately,
+they mostly stay available online and can be retrieved directly in binary form
+with a command like
+
+
+ wget -O waf http://ftp.waf.io/pub/release/waf-1.2.3
+ chmod 755 waf
+
+Unfortunately, a change in language library makes these impossible to run on
+Python version 3.7 or up. However, by applying the necessary change that made
+waf 2.0.7 compatible to newer Python versions, a compatible binary can still be
+built. The patch should apply even on older versions. This can be achieved
+through a build process similar to the one described above, extended with the
+download of an older waf version and patch.
+
+ wget 'https://waf.io/waf-1.8.22.tar.bz2'
+ wget 'https://gitlab.com/ita1024/waf/commit/facdc0b173d933073832c768ec1917c553cb369c.patch'
+ tar xjf waf-*.tar.bz2
+ rm waf-*.tar.bz2
+ cd waf-*
+ patch -p1 -i ../*.patch
+ ./waf-light configure build --make-waf --tools=''
More information about the arch-commits
mailing list