Browse Source
- integrate use of toolchains from Android Native Development Kit (NDK) - add new cross toolchain template for Android 7.0 Nougat STBs - rewrite/optimze config file generation code and introduce a config template file to avoid unmaintainable code - add new libraries for toolchain integration (CCID IFD Handler 1.4.33, libusb 0.1.12) - update language filespull/45/head
WXbet
5 years ago
13 changed files with 749 additions and 440 deletions
@ -0,0 +1,271 @@ |
|||
# List of setup, build and config commands below. All commands are executed in the context of the current user. |
|||
# Pay attention to the SEMICOLON at the end of EACH command and the correct quoting (' or ") for or to avoid expansion of variables. |
|||
|
|||
# Tokens that are replaced automatically: |
|||
# @CTNGSOURCE@ crosstool-NG source folder; support/crosstool/crosstool-ng |
|||
# @FNGSOURCE@ freetz-NG source folder; support/crosstool/freetz-ng |
|||
# @ANDKSOURCE@ android-NDK source folder; support/crosstool/android-ndk |
|||
# @LOGFILE@ current log file |
|||
# @TOOLCHAIN current toolchain folder |
|||
# @TEMPLATE@ current template file |
|||
# @CC@ C compiler binary of the toolchain |
|||
# @RANLIB@ library archive indexer binary of the toolchain |
|||
# @PREFIX@ prefix folder for cross builds |
|||
# @HOST@ hostname of the toolchain |
|||
# @TYPE@ toolchain type (ct-ng, freetz-ng, android-ndk) |
|||
# @ARCH@ architecture of the toolchain |
|||
# @BITNESS@ bitness of the toolchain (32, 64) |
|||
# @API@ Android API level of the toolchain (see https://source.android.com/setup/start/build-numbers) |
|||
# @SSL_TARGET@ Android specific build target for OpenSSL (android-arm, android-arm64, android-x86, android-x86) |
|||
# @CFLAGS@ individuell flags for the C compiler |
|||
# @CPUS@ CPU number of the build system |
|||
# @VALIDATE@ Special validation function for some libraries (@VALIDATE@ "PCSC") |
|||
|
|||
# You normally do *not* need to be root to build a toolchain using crosstool-NG. In fact, it is *VERY* dangerous to run as root, |
|||
# as crosstool-NG will, as part of the build process, remove a few directories. If anything goes wrong, running as root can ruin your host distribution. |
|||
CTNG_BUILD_AS_ROOT="0"; # Enable/Disable build as root (1|0) |
|||
|
|||
# crosstool-NG toolchain build settings |
|||
CTNG_REPO_URL="https://github.com/crosstool-ng/crosstool-ng"; # Repository to load ct-ng from |
|||
CTNG_CONFIG_tasks=('./ct-ng menuconfig;'); # config command1 |
|||
CTNG_CONFIG_tasks+=('TPL_SAVE=$($gui --defaultno --output-fd 1 --ok-label "${txt_s3tup_menu_command_label_yes}" --cancel-label "${txt_s3tup_menu_command_label_no}" --colors $bt_ "$title_ - \Z0$pdesc\Zn" --title "-[ ${txt_s3tup_menu_edit_title} ]-" --inputbox "\n${txt_s3tup_menu_edit_text}" 10 55 "@TEMPLATE@") && cp ".config" "$TPL_SAVE";'); # config command2 |
|||
CTNG_BUILD_tasks=('./ct-ng show-config | tee -a "@LOGFILE@";'); # build command1 |
|||
CTNG_BUILD_tasks+=('./ct-ng build;'); # build command2 |
|||
CTNG_SETUP_tasks=('git clone --progress "$CTNG_REPO_URL" "@CTNGSOURCE@";'); # setup command1 |
|||
#CTNG_SETUP_tasks+=('echo "Patch 1: Add option to build binary toolchain tarball..." && curl --silent https://github.com/crosstool-ng/crosstool-ng/commit/77c44ad9a01293983e95949a1ece4b1f2270ad9c.diff | git apply -v;'); # setup command2 |
|||
#CTNG_SETUP_tasks+=('echo "Patch 2: gcc: Remove nested 8.3.0 directory..." && curl --silent https://github.com/crosstool-ng/crosstool-ng/commit/1b29292f897f28b3ffc55cb7e254fba040b078cf.diff | git apply -v;'); # setup command3 |
|||
#CTNG_SETUP_tasks+=('echo "Patch 3: Update to GCC 9.x to latest release 9.3.0..." && curl https://github.com/crosstool-ng/crosstool-ng/commit/44ca1ca171f63300869ec1f3f8a18707843ad747.diff | git apply -v;'); # setup command3 |
|||
#CTNG_SETUP_tasks+=('echo "Patch 4: Add support for GCC 10.1.0..." && curl https://github.com/crosstool-ng/crosstool-ng/commit/ac16f40b09f20bfef870cead2c8188bcd4b5aacc.diff | git apply -v;'); # setup command5 |
|||
#CTNG_SETUP_tasks+=('echo "Patch 5: Allow glibc 2.12 - 2.20 to work with GCC 10+..." && curl https://github.com/crosstool-ng/crosstool-ng/commit/3a39186a4ba7f549e4297f77ca28d89ae6b615b7.diff | git apply -v;'); # setup command6 |
|||
CTNG_SETUP_tasks+=('./bootstrap;'); # setup command7 |
|||
CTNG_SETUP_tasks+=('./configure --enable-local;'); # setup command8 |
|||
CTNG_SETUP_tasks+=('make;'); # setup command9 |
|||
|
|||
# freetz-NG toolchain build settings |
|||
FNG_REPO_URL="https://github.com/Freetz-NG/freetz-ng.git"; # Repository to load freetz-ng from |
|||
FNG_CONFIG_tasks=('make menuconfig;'); # config command1 |
|||
FNG_CONFIG_tasks+=('TPL_SAVE=$($gui --defaultno --output-fd 1 --ok-label "${txt_s3tup_menu_command_label_yes}" --cancel-label "${txt_s3tup_menu_command_label_no}" --colors $bt_ "$title_ - \Z0$pdesc\Zn" --title "-[ ${txt_s3tup_menu_edit_title} ]-" --inputbox "\n${txt_s3tup_menu_edit_text}" 10 55 "@TEMPLATE@") && cp ".config" "$TPL_SAVE";'); # config command2 |
|||
FNG_BUILD_tasks=('make olddefconfig | tee -a "@LOGFILE@";'); # build command1 |
|||
FNG_BUILD_tasks+=('make toolchain-dirclean | tee -a "@LOGFILE@";'); # build command2 |
|||
FNG_BUILD_tasks+=('make toolchain | tee -a "@LOGFILE@";'); # build command3 |
|||
FNG_SETUP_tasks=('git clone --progress "$FNG_REPO_URL" "@FNGSOURCE@";'); # setup command1 |
|||
FNG_SETUP_tasks+=('ln -s "../../downloads" "@FNGSOURCE@/dl";'); # setup command2 |
|||
|
|||
# android-NDK toolchain build settings |
|||
ANDK_REPO_URL="https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip"; # Location to load Android Native Development Kit (NDK) from freetz-ng from |
|||
ANDK_CONFIG_tasks=('editor ".config";'); # config command1 |
|||
ANDK_CONFIG_tasks+=('TPL_SAVE=$($gui --defaultno --output-fd 1 --ok-label "${txt_s3tup_menu_command_label_yes}" --cancel-label "${txt_s3tup_menu_command_label_no}" --colors $bt_ "$title_ - \Z0$pdesc\Zn" --title "-[ ${txt_s3tup_menu_edit_title} ]-" --inputbox "\n${txt_s3tup_menu_edit_text}" 10 55 "@TEMPLATE@") && cp ".config" "$TPL_SAVE";'); # config command2 |
|||
ANDK_BUILD_tasks=('TOOLCHAIN="@TOOLCHAIN@";'); # build command1 |
|||
ANDK_BUILD_tasks+=('printf "Extracting prebuild toolchain "@ANDKSOURCE@/toolchains/llvm/prebuilt/linux-x86_64" from NDK to "@TOOLCHAIN@"..." | tee -a "@LOGFILE@" && rm -rf "@TOOLCHAIN@" | tee -a "@LOGFILE@" && cp -rf "@ANDKSOURCE@/toolchains/llvm/prebuilt/linux-x86_64/" "@TOOLCHAIN@" | tee -a "@LOGFILE@";'); # build command2 |
|||
ANDK_BUILD_tasks+=('cleanups="aarch64 arm i686 i386 x86_64 python .py pkgconfig ++ cmake test prebuilt_include bfd-plugins 2to3 share 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30";'); # build command3 |
|||
ANDK_BUILD_tasks+=('cleanups=${cleanups//$ANDK_ARCH/} && cleanups=${cleanups//$ANDK_API/};'); # build command4 |
|||
ANDK_BUILD_tasks+=('printf "Cleaning up extracted toolchain to save disk space..." | tee -a "@LOGFILE@" && for c in ; do find -name "*$c*" ! -name "*libc++*" -exec rm -rf {} \; 2>/dev/null >>"@LOGFILE@" 2>&1; done;'); # build command5 |
|||
ANDK_BUILD_tasks+=('rm -rf "$TOOLCHAIN/include" "$TOOLCHAIN/libexec" | tee -a "@LOGFILE@";'); # build command6 |
|||
ANDK_BUILD_tasks+=('printf "Creating symlinks "$TOOLCHAIN/bin/${ANDK_HOST}-gcc", "$TOOLCHAIN/bin/${ANDK_HOST}-clang" to wrap "$TOOLCHAIN/bin/${ANDK_CLANG}"..." | tee -a "@LOGFILE@" && ln -rsf "$TOOLCHAIN/bin/${ANDK_CLANG}" "$TOOLCHAIN/bin/${ANDK_HOST}-gcc" && ln -rsf "$TOOLCHAIN/bin/${ANDK_CLANG}" "$TOOLCHAIN/bin/${ANDK_HOST}-clang" && chmod 775 "$TOOLCHAIN/bin/${ANDK_HOST}*" | tee -a "@LOGFILE@";'); # build command7 |
|||
ANDK_SETUP_tasks=('curl --silent "$ANDK_REPO_URL" | busybox unzip -;'); # setup command1 |
|||
ANDK_SETUP_tasks+=('mv --force "$(basename "$ANDK_REPO_URL" | cut -d "-" -f 1-3)" "@ANDKSOURCE@";'); # setup command2 |
|||
ANDK_SETUP_tasks+=('chmod -R 755 "@ANDKSOURCE@";'); # setup command3 |
|||
|
|||
# Library build settings |
|||
LIBS=(SSL_300 SSL_111 SSL_110 SSL_102 SSL_100 SSL_098 LIB_USB LIB_USB0 LIB_PCSC LIB_CCID LIB_ZLIB); # List of ordered libraries. Only libraries in this list are available |
|||
LIBS_LIST_BETA="1"; # In(Ex)clude libraries defined as beta |
|||
LIBS_AUTO_INTEGRATE="1"; # Automatically reintegrate libraries when rebuilding toolchains |
|||
|
|||
# OpenSSL 3.0.0-alpha5 |
|||
SSL_300="1"; |
|||
SSL_300_beta="1"; |
|||
SSL_300_name="OpenSSL"; |
|||
SSL_300_version="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=1&per_page=100" | jq '[.[] | select(.name|test("openssl-3.0.0\\S.*"))][0] | .name' | sed -e 's#openssl-##g; s#_#.#g; s#\"##g')"; |
|||
SSL_300_check="openssl.pc $(printf "$SSL_300_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
SSL_300_url="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=1&per_page=100" | jq '[.[] | select(.name|test("openssl-3.0.0\\S.*"))][0] | .tarball_url' | sed -e 's#\"##g')"; |
|||
SSL_300_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
SSL_300_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
SSL_300_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
SSL_300_tasks+=('[ "@TYPE@" == "android-ndk" ] && export CC="gcc" || export CC=@CC@;'); |
|||
SSL_300_tasks+=('[ "@TYPE@" == "android-ndk" ] && export RANLIB=ranlib || export RANLIB=@RANLIB@;'); |
|||
SSL_300_tasks+=('[ "@TYPE@" == "android-ndk" ] && export ANDROID_NDK="@TOOLCHAIN@";'); |
|||
SSL_300_tasks+=('[ "@TYPE@" == "android-ndk" ] && FLAGS="@SSL_TARGET@ --api=0.9.8 -D__ANDROID_API__=@API@ no-shared no-afalgeng no-aria no-asan no-asm no-async no-autoalginit no-autoerrinit no-autoload-config no-bf no-blake2 no-camellia no-capieng no-cast no-chacha no-cmac no-cms no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-ct no-devcryptoeng no-dgram no-dh no-dsa no-dso no-dynamic-engine no-ec no-ec2m no-ecdh no-ecdsa no-ec_nistp_64_gcc_128 no-egd no-engine no-err no-external-tests no-filenames no-fuzz-libfuzzer no-fuzz-afl no-gost no-idea no-makedepend no-md2 no-mdc2 no-md4 no-multiblock no-nextprotoneg no-ocb no-ocsp no-pic no-poly1305 no-posix-io no-psk no-rc2 no-rc4 no-rc5 no-rdrand no-rfc3779 no-rmd160 no-scrypt no-sctp no-seed no-siphash no-sm2 no-sm3 no-sm4 no-srp no-srtp no-sse2 no-ssl-trace no-tests no-threads no-ts no-ubsan no-ui-console no-unit-test no-whirlpool no-weak-ssl-ciphers no-zlib no-zlib-dynamic no-heartbeats no-msan no-dtls no-dtls1 no-dtls1-method no-dtls1_2 no-dtls1_2-method" || FLAGS="linux-generic32 shared";'); |
|||
SSL_300_tasks+=('./Configure --prefix=@PREFIX@ $FLAGS;'); |
|||
SSL_300_tasks+=('make -j@CPUS@;'); |
|||
SSL_300_tasks+=('make install;'); |
|||
SSL_300_tasks+=('[ "@TYPE@" == "android-ndk" ] && find "@PREFIX@/lib/" -maxdepth 1 \( -name "libcrypto.*" -o -name "libssl.*" \) -execdir ln -frs "@PREFIX@/lib/{}" "@PREFIX@/lib/@HOST@/@API@/{}" \;;'); |
|||
|
|||
# OpenSSL 1.1.1g |
|||
SSL_111="1"; |
|||
SSL_111_beta="0"; |
|||
SSL_111_name="OpenSSL"; |
|||
SSL_111_version="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=1&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_1_1_1[a-z].*"))][0] | .name' | sed -e 's#OpenSSL_##g; s#_#.#g; s#\"##g')"; |
|||
SSL_111_check="openssl.pc $(printf "$SSL_111_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
SSL_111_url="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=1&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_1_1_1[a-z].*"))][0] | .tarball_url' | sed -e 's#\"##g')"; |
|||
SSL_111_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
SSL_111_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
SSL_111_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
SSL_111_tasks+=('[ "@TYPE@" == "android-ndk" ] && export CC="gcc" || export CC=@CC@;'); |
|||
SSL_111_tasks+=('[ "@TYPE@" == "android-ndk" ] && export RANLIB="ranlib" || export RANLIB=@RANLIB@;'); |
|||
SSL_111_tasks+=('[ "@TYPE@" == "android-ndk" ] && export ANDROID_NDK="@TOOLCHAIN@";'); |
|||
SSL_111_tasks+=('[ "@TYPE@" == "android-ndk" ] && FLAGS="@SSL_TARGET@ --api=0.9.8 -D__ANDROID_API__=@API@ no-shared no-afalgeng no-aria no-asan no-asm no-async no-autoalginit no-autoerrinit no-autoload-config no-bf no-blake2 no-camellia no-capieng no-cast no-chacha no-cmac no-cms no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-ct no-devcryptoeng no-dgram no-dh no-dsa no-dso no-dynamic-engine no-ec no-ec2m no-ecdh no-ecdsa no-ec_nistp_64_gcc_128 no-egd no-engine no-err no-external-tests no-filenames no-fuzz-libfuzzer no-fuzz-afl no-gost no-idea no-makedepend no-md2 no-mdc2 no-md4 no-multiblock no-nextprotoneg no-ocb no-ocsp no-pic no-poly1305 no-posix-io no-psk no-rc2 no-rc4 no-rc5 no-rdrand no-rfc3779 no-rmd160 no-scrypt no-sctp no-seed no-siphash no-sm2 no-sm3 no-sm4 no-srp no-srtp no-sse2 no-ssl-trace no-tests no-threads no-ts no-ubsan no-ui-console no-unit-test no-whirlpool no-weak-ssl-ciphers no-zlib no-zlib-dynamic no-heartbeats no-msan no-dtls no-dtls1 no-dtls1-method no-dtls1_2 no-dtls1_2-method" || FLAGS="linux-generic32 shared";'); |
|||
SSL_111_tasks+=('./Configure --prefix=@PREFIX@ $FLAGS;'); |
|||
SSL_111_tasks+=('make -j@CPUS@;'); |
|||
SSL_111_tasks+=('make install_sw;'); |
|||
SSL_111_tasks+=('[ "@TYPE@" == "android-ndk" ] && find "@PREFIX@/lib/" -maxdepth 1 \( -name "libcrypto.*" -o -name "libssl.*" \) -execdir ln -frs "@PREFIX@/lib/{}" "@PREFIX@/lib/@HOST@/@API@/{}" \;;'); |
|||
|
|||
# OpenSSL 1.1.0l |
|||
SSL_110="1"; |
|||
SSL_110_name="OpenSSL"; |
|||
SSL_110_version="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=1&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_1_1_0[a-z].*"))][0] | .name' | sed -e 's#OpenSSL_##g; s#_#.#g; s#\"##g')"; |
|||
SSL_110_check="openssl.pc $(printf "$SSL_110_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
SSL_110_url="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=1&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_1_1_0[a-z].*"))][0] | .tarball_url' | sed -e 's#\"##g')"; |
|||
SSL_110_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
SSL_110_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
SSL_110_tasks+=('export CC=@CC@;'); |
|||
SSL_110_tasks+=('export RANLIB=@RANLIB@;'); |
|||
SSL_110_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
SSL_110_tasks+=('./Configure --prefix=@PREFIX@ linux-generic32 shared;'); |
|||
SSL_110_tasks+=('make -j@CPUS@;'); |
|||
SSL_110_tasks+=('make install_sw;'); |
|||
|
|||
# OpenSSL 1.0.2u |
|||
SSL_102="1"; |
|||
SSL_102_beta="0"; |
|||
SSL_102_name="OpenSSL"; |
|||
SSL_102_version="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=1&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_1_0_2[a-z].*"))][0] | .name' | sed -e 's#OpenSSL_##g; s#_#.#g; s#\"##g')"; |
|||
SSL_102_check="openssl.pc $(printf "$SSL_102_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
SSL_102_url="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=1&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_1_0_2[a-z].*"))][0] | .tarball_url' | sed -e 's#\"##g')"; |
|||
SSL_102_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
SSL_102_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
SSL_102_tasks+=('export CC=@CC@;'); |
|||
SSL_102_tasks+=('export RANLIB=@RANLIB@;'); |
|||
SSL_102_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
SSL_102_tasks+=('./Configure --prefix=@PREFIX@ linux-generic32 shared;'); |
|||
SSL_102_tasks+=('make -j@CPUS@;'); |
|||
SSL_102_tasks+=('make install_sw SHLIB_VERSION_NUMBER=1.0.2 SHLIB_MINOR=0.2;'); |
|||
|
|||
# OpenSSL 1.0.0t |
|||
SSL_100="1"; |
|||
SSL_100_beta="0"; |
|||
SSL_100_name="OpenSSL"; |
|||
SSL_100_version="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=2&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_1_0_0[a-z].*"))][0] | .name' | sed -e 's#OpenSSL_##g; s#_#.#g; s#\"##g')"; |
|||
SSL_100_check="openssl.pc $(printf "$SSL_100_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
SSL_100_url="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=2&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_1_0_0[a-z].*"))][0] | .tarball_url' | sed -e 's#\"##g')"; |
|||
SSL_100_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
SSL_100_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
SSL_100_tasks+=('export CC=@CC@;'); |
|||
SSL_100_tasks+=('export RANLIB=@RANLIB@;'); |
|||
SSL_100_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
SSL_100_tasks+=('[ $(echo -e "$_tc_info" | grep -ic "musl") -gt 0 ] && echo "Apply the musl libc patch to avoid OpenSSL build errors due to missing termio.h..." && curl --silent "https://raw.githubusercontent.com/beagleboard/buildroot/master/package/openssl/openssl-004-musl-termios.patch" | patch -p1;'); |
|||
SSL_100_tasks+=('./Configure --prefix=@PREFIX@ linux-generic32 shared;'); |
|||
SSL_100_tasks+=('make -j@CPUS@;'); |
|||
SSL_100_tasks+=('make install_sw;'); |
|||
|
|||
# OpenSSL 0.9.8zh |
|||
SSL_098="1"; |
|||
SSL_098_beta="0"; |
|||
SSL_098_name="OpenSSL"; |
|||
SSL_098_version="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=2&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_0_9_8[a-z].*"))][0] | .name' | sed -e 's#OpenSSL_##g; s#_#.#g; s#\"##g')"; |
|||
SSL_098_check="openssl.pc $(printf "$SSL_098_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
SSL_098_url="$(curl --silent "https://api.github.com/repos/openssl/openssl/tags?page=2&per_page=100" | jq '[.[] | select(.name|test("OpenSSL_0_9_8[a-z].*"))][0] | .tarball_url' | sed -e 's#\"##g')"; |
|||
SSL_098_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
SSL_098_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
SSL_098_tasks+=('export CC=@CC@;'); |
|||
SSL_098_tasks+=('export RANLIB=@RANLIB@;'); |
|||
SSL_098_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
SSL_098_tasks+=('[ $(echo -e "$_tc_info" | grep -ic "musl") -gt 0 ] && echo "Apply the musl libc patch to avoid OpenSSL build errors due to missing termio.h..." && curl --silent "https://raw.githubusercontent.com/beagleboard/buildroot/master/package/openssl/openssl-004-musl-termios.patch" | patch -p1;'); |
|||
SSL_098_tasks+=('./Configure --prefix=@PREFIX@ linux-generic32 shared;'); |
|||
SSL_098_tasks+=('make -j@CPUS@;'); |
|||
SSL_098_tasks+=('make install_sw;'); |
|||
|
|||
# libusb 1.0.23 |
|||
LIB_USB="1"; |
|||
LIB_USB_beta="0"; |
|||
LIB_USB_name="libusb"; |
|||
LIB_USB_version="$(curl --silent "https://api.github.com/repos/libusb/libusb/releases/latest" | jq -r '.tag_name' | cut -c 2-)"; |
|||
LIB_USB_check="libusb-1.0.pc $(printf "$LIB_USB_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
LIB_USB_url="$(curl --silent "https://api.github.com/repos/libusb/libusb/releases/latest" | jq -r '.assets[1].browser_download_url')"; |
|||
LIB_USB_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
LIB_USB_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
LIB_USB_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
LIB_USB_tasks+=('export CC=@CC@;'); |
|||
LIB_USB_tasks+=('[ "@TYPE@" == "android-ndk" ] && export ANDROID_NDK="@TOOLCHAIN@";'); |
|||
LIB_USB_tasks+=('[ "@TYPE@" == "android-ndk" ] && cp -f "android/config.h" "./config.h";'); |
|||
LIB_USB_tasks+=('[ "@TYPE@" == "android-ndk" ] && FLAGS="--enable-static --disable-shared --disable-udev" || FLAGS="--disable-udev";'); |
|||
LIB_USB_tasks+=('./configure --prefix=@PREFIX@ --host=@HOST@ $FLAGS;'); |
|||
LIB_USB_tasks+=('make -j@CPUS@;'); |
|||
LIB_USB_tasks+=('make install;'); |
|||
LIB_USB_tasks+=('[ "@TYPE@" == "android-ndk" ] && find "@PREFIX@/lib/" -maxdepth 1 -name "libusb-1.0.*" -execdir ln -frs "@PREFIX@/lib/{}" "@PREFIX@/lib/@HOST@/@API@/{}" \;;'); |
|||
|
|||
# libusb 0.1.12 |
|||
LIB_USB0="1"; |
|||
LIB_USB0_beta="0"; |
|||
LIB_USB0_name="libusb"; |
|||
LIB_USB0_version="0.1.12"; |
|||
LIB_USB0_check="libusb.pc $(printf "$LIB_USB0_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
LIB_USB0_url="http://downloads.sourceforge.net/libusb/libusb-0.1.12.tar.gz"; |
|||
LIB_USB0_tasks=('echo "Patch 1: Handle compile failures with GCC 7+..." && curl --silent https://sources.debian.org/data/main/libu/libusb/2:0.1.12-32/debian/patches/12_ENAMETOOLONG.diff | git apply -v;'); |
|||
LIB_USB0_tasks+=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
LIB_USB0_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
LIB_USB0_tasks+=('export CC=@CC@;'); |
|||
LIB_USB0_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
LIB_USB0_tasks+=('./configure --prefix=@PREFIX@ --host=@HOST@ --disable-udev;'); |
|||
LIB_USB0_tasks+=('make -j@CPUS@;'); |
|||
LIB_USB0_tasks+=('make install;'); |
|||
|
|||
# PCSC-Lite 1.9.0 |
|||
LIB_PCSC="1"; |
|||
LIB_PCSC_beta="0"; |
|||
LIB_PCSC_name="PCSC-Lite"; |
|||
LIB_PCSC_version="$(curl --silent "https://pcsclite.apdu.fr/files/" | grep -m1 'href="pcsc-lite' | awk -F '"' '{printf $4}' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
LIB_PCSC_check="libpcsclite.pc $(printf "$LIB_PCSC_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
LIB_PCSC_url="$(printf 'https://pcsclite.apdu.fr/files/'$(curl --silent "https://pcsclite.apdu.fr/files/" | grep -m1 'href="pcsc-lite' | awk -F '"' '{printf $4}'))"; |
|||
LIB_PCSC_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
LIB_PCSC_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
LIB_PCSC_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
LIB_PCSC_tasks+=('export CC=@CC@;'); |
|||
LIB_PCSC_tasks+=('[ "@TYPE@" == "android-ndk" ] && export ANDROID_NDK="@TOOLCHAIN@";'); |
|||
LIB_PCSC_tasks+=('[ "@TYPE@" == "android-ndk" ] && LIBUSB_LIBS="@PREFIX@/lib/@HOST@/@API@ -lusb-1.0" || LIBUSB_LIBS="@PREFIX@/lib -lusb-1.0 -lrt";'); |
|||
LIB_PCSC_tasks+=('[ "@TYPE@" == "android-ndk" ] && FLAGS="--enable-static --disable-shared --disable-libudev LIBS=-llog" || FLAGS="--disable-libudev";'); |
|||
LIB_PCSC_tasks+=('./configure --prefix=@PREFIX@ --host=@HOST@ $FLAGS --disable-libsystemd --with-systemdsystemunitdir=@PREFIX@/lib/systemd/system LIBUSB_LIBS="-L${LIBUSB_LIBS}" LIBUSB_CFLAGS="-I@PREFIX@/include/libusb-1.0";'); |
|||
LIB_PCSC_tasks+=('make -j@CPUS@;'); |
|||
LIB_PCSC_tasks+=('make install;'); |
|||
LIB_PCSC_tasks+=('[ "@TYPE@" == "android-ndk" ] && find "@PREFIX@/lib/" -maxdepth 1 -name "libpcsc*" -execdir ln -frs "@PREFIX@/lib/{}" "@PREFIX@/lib/@HOST@/@API@/{}" \;;'); |
|||
LIB_PCSC_tasks+=('@VALIDATE@ "PCSC";'); |
|||
LIB_PCSC_tasks+=('[ "@TYPE@" == "android-ndk" ] && zip -j "$bdir/@HOST@@API@-pcscd.zip" -xi "@PREFIX@/sbin/pcscd";'); |
|||
|
|||
# CCID IFD Handler 1.4.33 |
|||
LIB_CCID="1"; |
|||
LIB_CCID_beta="0"; |
|||
LIB_CCID_name="CCID"; |
|||
LIB_CCID_version="$(curl --silent "https://ccid.apdu.fr/files/" | grep -m1 'href="ccid' | awk -F '"' '{printf $4}' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
LIB_CCID_check="libccid.pc $(printf "$LIB_CCID_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
LIB_CCID_url="$(printf 'https://ccid.apdu.fr/files/'$(curl --silent "https://ccid.apdu.fr/files/" | grep -m1 'href="ccid' | awk -F '"' '{printf $4}'))"; |
|||
LIB_CCID_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
LIB_CCID_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
LIB_CCID_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
LIB_CCID_tasks+=('export CC=@CC@;'); |
|||
LIB_CCID_tasks+=('[ "@TYPE@" == "android-ndk" ] && export ANDROID_NDK="@TOOLCHAIN@";'); |
|||
LIB_CCID_tasks+=('[ "@TYPE@" == "android-ndk" ] && LIBUSB_LIBS="@PREFIX@/lib/@HOST@/@API@ -lusb-1.0" || LIBUSB_LIBS="@PREFIX@/lib -lusb-1.0 -lrt";'); |
|||
LIB_CCID_tasks+=('[ "@TYPE@" == "android-ndk" ] && FLAGS="--enable-static" || FLAGS="";'); |
|||
LIB_CCID_tasks+=('./bootstrap;'); |
|||
LIB_CCID_tasks+=('./configure --prefix=@PREFIX@ --host=@HOST@ $FLAGS --enable-twinserial --enable-usbdropdir="@PREFIX@/..$(pkg-config libpcsclite --variable=usbdropdir)" --enable-serialconfdir="@PREFIX@$(pkg-config libpcsclite --variable=serialconfdir)" LIBUSB_LIBS="-L${LIBUSB_LIBS}" LIBUSB_CFLAGS="-I@PREFIX@/include/libusb-1.0";'); |
|||
LIB_CCID_tasks+=('make -j@CPUS@;'); |
|||
LIB_CCID_tasks+=('make install;'); |
|||
LIB_CCID_tasks+=('echo -e "prefix=@PREFIX@\nexec_prefix=\${prefix}\nlibdir=\${exec_prefix}/lib\nincludedir=\${prefix}/include/PCSC\nusbdropdir=@PREFIX@/lib/pcsc/drivers\nserialconfdir=@PREFIX@/etc/reader.conf.d\n\nName: CCID IFD Handler\nDescription: Generic USB CCID (Chip/Smart Card Interface Devices) and ICCD (Integrated Circuit(s) Card Devices) driver\nVersion: $LIB_CCID_version\nRequires: libusb libpcsclite" > "@PREFIX@/lib/pkgconfig/libccid.pc";'); |
|||
LIB_CCID_tasks+=('[ "@TYPE@" == "android-ndk" ] && zip -j "$bdir/@HOST@@API@-libccid.zip" -xi "@PREFIX@/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so";'); |
|||
LIB_CCID_tasks+=('[ "@TYPE@" == "android-ndk" ] && zip -j "$bdir/@HOST@@API@-libccidtwin.zip" -xi "@PREFIX@/lib/pcsc/drivers/serial/libccidtwin.so";'); |
|||
LIB_CCID_tasks+=('[ "@TYPE@" == "android-ndk" ] && zip -j "$bdir/@HOST@@API@-libccidplist.zip" -xi "@PREFIX@/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist";'); |
|||
|
|||
# zlib 1.2.11 |
|||
LIB_ZLIB="1"; |
|||
LIB_ZLIB_beta="0"; |
|||
LIB_ZLIB_name="zlib"; |
|||
LIB_ZLIB_version="$(curl --silent https://api.github.com/repos/madler/zlib/tags | jq -r '.[0].name' | cut -c 2-)"; |
|||
LIB_ZLIB_check="zlib.pc $(printf "$LIB_ZLIB_version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')"; |
|||
LIB_ZLIB_url="$(curl --silent "https://api.github.com/repos/madler/zlib/tags" | jq -r '.[0].tarball_url')"; |
|||
LIB_ZLIB_tasks=('export TOOLCHAIN=@TOOLCHAIN@;'); |
|||
LIB_ZLIB_tasks+=('[ -n "@CFLAGS@" ] && export CFLAGS="@CFLAGS@";'); |
|||
LIB_ZLIB_tasks+=('export CC=@CC@;'); |
|||
LIB_ZLIB_tasks+=('[ "@TYPE@" == "android-ndk" ] && export ANDROID_NDK="@TOOLCHAIN@";'); |
|||
LIB_ZLIB_tasks+=('export PATH="$TOOLCHAIN/bin:$PATH";'); |
|||
LIB_ZLIB_tasks+=('./configure --prefix=@PREFIX@;'); |
|||
LIB_ZLIB_tasks+=('make -j@CPUS@;'); |
|||
LIB_ZLIB_tasks+=('make install;'); |
|||
LIB_ZLIB_tasks+=('[ "@TYPE@" == "android-ndk" ] && find "@PREFIX@/lib/" -maxdepth 1 -name "libz.*" -execdir ln -frs "@PREFIX@/lib/{}" "@PREFIX@/lib/@HOST@/@API@/{}" \;;'); |
@ -0,0 +1,11 @@ |
|||
#toolchain template: Android 7.0 Nougat STBs |
|||
#toolchain template version: 1 |
|||
#toolchain template cflags: -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=vfpv3-d16 -DANDROID -D__ANDROID_API__=24 -fpic -fno-addrsig -ffunction-sections -fdata-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wno-invalid-command-line-argument -Wno-unused-command-line-argument |
|||
#toolchain template updated: 2020-07-20 15:28:28 |
|||
ANDK_API="24" #https://source.android.com/setup/start/build-numbers |
|||
ANDK_ABI="armeabi-v7a" |
|||
ANDK_ARCH="arm" |
|||
ANDK_ARCH_BITNESS="32" |
|||
ANDK_HOST="arm-linux-androideabi" |
|||
ANDK_CLANG="armv7a-linux-androideabi24-clang" |
|||
ANDK_SSL_TARGET="android-arm" #android-arm, android-arm64, android-x86, android-x86 |
Loading…
Reference in new issue