• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2
3# Examples:
4# ./dockcross-build.sh build -p aws-crt-java --target=linux-armv6
5# ./dockcross-build.sh build -p aws-crt-java --target=linux-armv7
6# ./dockcross-build.sh build -p aws-crt-java --target=linux-aarch64
7
8set -ex
9
10args=("$@")
11
12version=LATEST
13if [[ "${args[0]}" == "--version="* ]]; then
14    version=${args[0]}
15    version=$(echo $version | cut -f2 -d=)
16    args=${args[@]:1}
17fi
18
19if [ $(echo $version | grep -E '^v[0-9\.]+$') ]; then
20    version=releases/$version
21elif [[ $version != 'channels/'* ]] && [[ $version != 'LATEST' ]]; then
22    version=channels/$version
23fi
24
25# download the version of builder requested
26builder=/tmp/builder.pyz
27curl -sSL -o $builder --retry 3 https://d19elf31gohf1l.cloudfront.net/${version}/builder.pyz?date=`date +%s`
28chmod a+x $builder
29
30# on manylinux, use the latest python3 via symlink
31if [ -x /opt/python/cp39-cp39/bin/python ] && [ ! -e /usr/local/bin/python3 ]; then
32    ln -s /opt/python/cp39-cp39/bin/python /usr/local/bin/python3
33fi
34
35# Launch the builder with whatever args were passed to this script
36$builder ${args[@]}
37