build.sh (1186B)
1 #!/bin/env bash 2 set -ex 3 4 # Copy all the required files from volume 5 QJS_PATH=/opt/quickjs-tart 6 cp $QJS_PATH/docker-android/build.sh ./ 7 cp -r $QJS_PATH/quickjs ./ 8 cp -r $QJS_PATH/sqlite3 ./ 9 cp -r $QJS_PATH/subprojects ./ 10 cp -r $QJS_PATH/QuickJS-android ./ 11 rm ./QuickJS-android/local.properties 12 cp $QJS_PATH/meson.build ./ 13 mkdir ./cross 14 cp $QJS_PATH/cross/build-android.sh ./cross/ 15 cp $QJS_PATH/cross/package-android.sh ./cross/ 16 cp $QJS_PATH/*.c ./ 17 cp $QJS_PATH/*.h ./ 18 cp $QJS_PATH/*.js ./ 19 20 # Get wallet-core version from gradle.properties 21 GRADLE_PROPERTIES_FILE=./QuickJS-android/gradle.properties 22 WALLET_CORE_VERSION=$(grep -hoP '^WALLET_CORE_VERSION=\K.*' $GRADLE_PROPERTIES_FILE) 23 24 # Download and build wallet-core (as non-root) 25 git clone git://git.gnunet.org/taler-typescript-core.git 26 cd taler-typescript-core/ 27 git checkout "tags/${WALLET_CORE_VERSION}" 28 29 npm i -g pnpm 30 31 useradd -m walletcore 32 chown -R walletcore:walletcore . 33 su walletcore <<EOF 34 ./bootstrap 35 ./configure 36 make embedded 37 EOF 38 39 cd ../ 40 cp taler-typescript-core/packages/taler-wallet-embedded/dist/taler-wallet-core-qjs.mjs . 41 rm -rf taler-typescript-core/ 42 43 # Build .so library 44 . /etc/environment 45 ./cross/package-android.sh all