diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-01-28 12:57:22 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-01-28 12:57:22 -0500 |
commit | 92f2ea6ed46ffae5302a47452d816b5dc5784eb7 (patch) | |
tree | 9afe6716cf918bf38bcdd00434bdbe7fd16a78d2 /etc/tasks/002-python-packages.sh | |
parent | 90136ee5fcaed3bd2f243bff94215f9a508aabe9 (diff) | |
download | docker-python-92f2ea6ed46ffae5302a47452d816b5dc5784eb7.tar.gz |
Reorder tools
Diffstat (limited to 'etc/tasks/002-python-packages.sh')
-rwxr-xr-x | etc/tasks/002-python-packages.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/etc/tasks/002-python-packages.sh b/etc/tasks/002-python-packages.sh new file mode 100755 index 0000000..cb248ff --- /dev/null +++ b/etc/tasks/002-python-packages.sh @@ -0,0 +1,39 @@ +#!/bin/bash +set -x + +# Uses GLOBAL environment variable: PYTHON_VERSION defined by `docker build` argument +prefix="${TOOLCHAIN}" +sysconfdir="${TOOLCHAIN_BUILD}/etc" +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 -v -r "${req}" + done + post +} + +function post() +{ + rm -rf ~/.cache/pip + [[ -d src ]] && rm -rf src + [[ -f gmon.out ]] && rm -rf gmon.out +} + +build |