From 5db08513a25f97e6588e45e65402a48caa011b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 23 Mar 2016 14:07:10 +0100 Subject: [PATCH] Added script to build and/or download dependencies. Requires git and only tested on Ubuntu Linux 14.04. --- README.md | 4 ++++ build-dependency-wheels.sh | 44 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 build-dependency-wheels.sh diff --git a/README.md b/README.md index 9473738..49ac269 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ and [lockfile](https://pypi.python.org/pypi/lockfile) to be placed in `blender_cloud/wheels`, or installed somewhere where Blender can find them. +The above requirements can be downloaded and built automatically +by running the `build-dependency-wheels.sh` script. Only tested on +Ubuntu Linux 14.04. + The addon requires HTTPS connections, and thus is dependent on [D1845](https://developer.blender.org/D1845). You can do either of these: diff --git a/build-dependency-wheels.sh b/build-dependency-wheels.sh new file mode 100755 index 0000000..fa38503 --- /dev/null +++ b/build-dependency-wheels.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +MYDIR=$(dirname $(readlink -f $0)) +WHEELS=$MYDIR/blender_cloud/wheels +cd $MYDIR + +PILLAR_SDK_DIR=$MYDIR/../pillar-python-sdk +CACHECONTROL_DIR=$MYDIR/../cachecontrol + +# Build the Pillar Python SDK wheel from ../pillar-python-sdk +if [ ! -e $WHEELS/lockfile*.whl ]; then + echo "Building pillar_sdk wheel" + if [ ! -e $PILLAR_SDK_DIR ]; then + cd $(dirname $PILLAR_SDK_DIR) + git clone https://github.com/armadillica/pillar-python-sdk.git $PILLAR_SDK_DIR + fi + + cd $PILLAR_SDK_DIR + python setup.py bdist_wheel + cp $(ls dist/*.whl -rt | tail -n 1) $WHEELS +fi + +# Download lockfile wheel +if [ ! -e $WHEELS/lockfile*.whl ]; then + echo "Downloading lockfile" + pip download --dest $WHEELS $(grep -i lockfile $MYDIR/requirements.txt) +fi + +# Build CacheControl wheel +if [ ! -e $WHEELS/CacheControl*.whl ]; then + echo "Building CacheControl wheel" + if [ ! -e $CACHECONTROL_DIR ]; then + cd $(dirname $CACHECONTROL_DIR) + git clone https://github.com/ionrock/cachecontrol.git $CACHECONTROL_DIR + cd $CACHECONTROL_DIR + git checkout v0.11.6 # TODO: get from requirements.txt + fi + + cd $CACHECONTROL_DIR + rm -f dist/*.whl + python setup.py bdist_wheel + cp $(ls dist/*.whl -rt | tail -n 1) $WHEELS +fi +