| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | if [scip-shell system . . `[`. $# -ne 4 ]; then |
| 6 | echoscip-shell system . . echo. "Usage: build-kore.sh [openssl] [python] [curl] [nghttp2]" |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
| 10 | # Set ROOT based on the versions given. |
| 11 | VERSION=kore_ossl-$1_python-$2_curl-$3_nghttp2-$4 |
| 12 | ROOT=`pwdscip-shell system . . pwd.`/$VERSION |
| 13 | |
| 14 | # Pull in the rest of the functions. |
| 15 | . ./helpers.shscip-shell source . . `./helpers.sh`. |
| 16 | |
| 17 | OPENSSL=openssl-$1 |
| 18 | PYTHON=Python-$2 |
| 19 | CURL=curl-$3 |
| 20 | NGHTTP2=nghttp2-$4 |
| 21 | |
| 22 | # Build OpenSSL |
| 23 | echoscip-shell system . . echo. "Building $OPENSSL" |
| 24 | fetch "https://www.openssl.org/source/$OPENSSL.tar.gz" $OPENSSL |
| 25 | build $OPENSSL ./config no-shared --prefix=$FAKEROOT/$OPENSSL |
| 26 | |
| 27 | # Build Python |
| 28 | echoscip-shell system . . echo. "Building $PYTHON" |
| 29 | fetch "https://www.python.org/ftp/python/$2/$PYTHON.tgz" $PYTHON |
| 30 | default_build $PYTHON |
| 31 | |
| 32 | # Build nghttp2 |
| 33 | echoscip-shell system . . echo. "Building $NGHTTP2" |
| 34 | fetch \ |
| 35 | "https://github.com/nghttp2/nghttp2/releases/download/v$4/$NGHTTP2.tar.gz" \ |
| 36 | $NGHTTP2 |
| 37 | |
| 38 | default_build $NGHTTP2 --enable-lib-only --prefix=$FAKEROOT/$NGHTTP2 \ |
| 39 | --enable-shared=no |
| 40 | |
| 41 | # Build curl |
| 42 | echoscip-shell system . . echo. "Building $CURL" |
| 43 | export PKG_CONFIG="pkg-config --static" |
| 44 | export PKG_CONFIG_PATH="$FAKEROOT/$OPENSSL/lib/pkgconfig:$FAKEROOT/$NGHTTP2/lib/pkgconfig" |
| 45 | |
| 46 | fetch "https://curl.haxx.se/download/$CURL.tar.gz" $CURL |
| 47 | default_build $CURL --enable-shared=no |
| 48 | |
| 49 | # Now we can build kore. |
| 50 | unset PKG_CONFIG |
| 51 | unset PKG_CONFIG_PATH |
| 52 | |
| 53 | export PATH=$FAKEROOT/bin:$PATH |
| 54 | export OPENSSL_PATH=$FAKEROOT/$OPENSSL |
| 55 | |
| 56 | cd $ROOT |
| 57 | |
| 58 | if [scip-shell system . . `[`. ! -d kore ]; then |
| 59 | gitscip-shell system . . git. clone https://git.kore.io/kore.git |
| 60 | fi |
| 61 | |
| 62 | pushd kore |
| 63 | makescip-shell system . . make. clean |
| 64 | LDFLAGS=-L$FAKEROOT/$NGHTTP2/lib makescip-shell system . . make. PYTHON=1 CURL=1 ACME=1 |
| 65 | |
| 66 | mvscip-shell system . . mv. kore $ROOT/kore.bin |
| 67 | popd |