[arch-commits] Commit in scons/trunk (PKGBUILD)
David Runge
dvzrv at archlinux.org
Fri Sep 13 12:11:14 UTC 2019
Date: Friday, September 13, 2019 @ 12:11:13
Author: dvzrv
Revision: 362514
upgpkg: scons 3.1.1-3
Applying global replacement on all .py files in src/ (FS#63735). Strippig pkgdir from embedded paths by recompiling in package().
Modified:
scons/trunk/PKGBUILD
----------+
PKGBUILD | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2019-09-13 12:08:26 UTC (rev 362513)
+++ PKGBUILD 2019-09-13 12:11:13 UTC (rev 362514)
@@ -6,7 +6,7 @@
pkgname=scons
pkgver=3.1.1
-pkgrel=2
+pkgrel=3
pkgdesc="Extensible Python-based build utility"
arch=('any')
url="https://scons.org"
@@ -26,9 +26,8 @@
local _copyright='Copyright (c) 2001 - 2019 The SCons Foundation'
local _date_of_release="$(grep "RELEASE ${pkgver}" src/CHANGES.txt | cut -d ',' -f2)"
local _date="$(date -d "${_date_of_release}" +'%Y-%m-%d %H:%M:%S')"
- # copy scripts to correct locations and change their globals
- for _script in scons{,ign,-time,-configure-cache}; do
- cp -v "src/script/${_script}.py" "src/script/${_script}"
+ # change globals in all scripts
+ for _script in $(find src/ -type f -iname "*.py"); do
sed -e "s|__COPYRIGHT__|${_copyright}|g" \
-e "s|__FILE__|/src/script/${_script}|g" \
-e 's/__REVISION__/none/g' \
@@ -36,16 +35,12 @@
-e 's/__BUILDSYS__/none/g' \
-e 's/__DEVELOPER__/none/g' \
-e "s/__VERSION__/${pkgver}/g" \
- -i "src/script/${_script}"
+ -i "${_script}"
done
- sed -e "s|__COPYRIGHT__|${_copyright}|g" \
- -e 's|__FILE__|/src/setup.py|g' \
- -e 's/__REVISION__/none/g' \
- -e "s|__DATE__|${_date}|g" \
- -e 's/__BUILDSYS__/none/g' \
- -e 's/__DEVELOPER__/none/g' \
- -e "s/__VERSION__/${pkgver}/g" \
- -i "src/setup.py"
+ # copy scripts to correct locations
+ for _script in scons{,ign,-time,-configure-cache}; do
+ cp -v "src/script/${_script}.py" "src/script/${_script}"
+ done
# disabling postscript creation, because it's broken
sed -e '614,619d' \
-e '/api_ps =/d' \
@@ -80,6 +75,7 @@
}
package() {
+ local py_ver=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
cd "${pkgname}-${pkgver}/src"
python setup.py install --prefix=/usr \
--skip-build \
@@ -87,6 +83,11 @@
--standard-lib \
--install-data=/usr/share \
--root="$pkgdir"
+ # strip $pkgdir from embedded paths:
+ 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.txt -t "${pkgdir}/usr/share/licenses/${pkgname}/"
install -vDm 644 {CHANGES,README,RELEASE}.txt \
-t "${pkgdir}/usr/share/doc/${pkgname}/"
More information about the arch-commits
mailing list