From 2119eeef5d80ae1c14fdd1c45a9d81908ce14e3d Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 4 Dec 2018 16:22:46 -0500 Subject: Initial commit --- etc/hstdp-2018.3a/tasks/001-python-packages.sh | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 etc/hstdp-2018.3a/tasks/001-python-packages.sh (limited to 'etc/hstdp-2018.3a/tasks/001-python-packages.sh') diff --git a/etc/hstdp-2018.3a/tasks/001-python-packages.sh b/etc/hstdp-2018.3a/tasks/001-python-packages.sh new file mode 100755 index 0000000..3d89b6a --- /dev/null +++ b/etc/hstdp-2018.3a/tasks/001-python-packages.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e +set -x + +# Uses GLOBAL environment variable: PYTHON_VERSION defined by `docker build` argument +prefix="${TOOLCHAIN}" +sysconfdir="${TOOLCHAIN_BUILD}/etc/${PIPELINE}" +reqdir=${sysconfdir}/pip + +export PATH="${prefix}/bin:${PATH}" +export CFLAGS="-I${prefix}/include" +export LDFLAGS="-L${prefix}/lib -Wl,-rpath=${prefix}/lib" + +function pre() +{ + if [[ ! -d ${reqdir} ]]; then + # Nothing there, but maybe that's on purpose. + exit 0 + fi +} + +function build() +{ + pre + # Iterate over pip requirement files + for req in ${reqdir}/* + do + pip install --upgrade --progress-bar=off -r "${req}" + done + post +} + +function post() +{ + rm -rf ~/.cache/pip + [[ -d src ]] && rm -rf src + [[ -f gmon.out ]] && rm -rf gmon.out +} + +build -- cgit