diff --git a/conda/conda-build.sh b/conda/conda-build.sh index c44ff3bf27c572acf46e4fcc13a293c19f8c9fd3..2e528695f94da90d8e5c389cb6ed1f00f6aa796b 100755 --- a/conda/conda-build.sh +++ b/conda/conda-build.sh @@ -2,8 +2,9 @@ if [ $# = 0 ]; then echo "Script wrapping conda-build to build Bob packages with defaults" - echo "usage: $0 <python-version> <recipe-dir>" - echo "example: $0 3.6 conda" + echo "usage: $0 <recipe-dir> [<python-version>]" + echo "example: $0 conda 3.6" + echo "example: $0 dependencies/libblitz" exit 1 fi @@ -11,9 +12,16 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export CONDARC=${DIR}/build-condarc echo "Using CONDARC from \`${CONDARC}'..." -if [ -e ${2}/../version.txt ]; then - export BOB_PACKAGE_VERSION=$(cat ${2}/../version.txt) +BUILD_OPTIONS="--no-anaconda-upload --skip-existing --variant-config-files ${DIR}/../gitlab/conda_build_config.yaml" + +if [ $# = 2 ]; then + BUILD_OPTIONS="${BUILD_OPTIONS} --python=${2}"; +fi + +# Exclusively for Bob packages, we also set the package version +if [ -e ${1}/../version.txt ]; then + export BOB_PACKAGE_VERSION=$(cat ${1}/../version.txt) echo "Setting package version to \`${BOB_PACKAGE_VERSION}'..." fi -conda build --no-anaconda-upload --skip-existing --variant-config-files ${DIR}/../gitlab/conda_build_config.yaml --python=${1} ${2} +conda build ${BUILD_OPTIONS} ${1}