SimpleX-Chat/scripts/android/download-libs.sh

50 lines
1.6 KiB
Bash
Raw Normal View History

android: support for ARMv7a and Android 8+ (#2038) * add armv7a * disable armv6l, that is lacking SMP atomics * Add Android 8 setting (API Ver 26) * Drop x86_64-linux, this makes no sense with `pkgs' = androidPkgs`. * Drop mis-labled x86_64-linux:lib:support (it was aarch64-android) * Drop x86_64-android, these do not exist in nixpkgs The ones set up were aarch64-android anyway (pkgs' = androidPkgs) * android: support Android 8+, armeabi-v7a (32 bit) (#2012) * test * stubs for allowing to launch the app * more stubs and minSdk lowered to 26 * replaced functions that supported on higher API levels with other functions * animated images on lower API levels and write permission * updated abi filter and scripts for downloading libs * changed compression script for multiple apks * cmake changes --------- Co-authored-by: Avently <7953703+avently@users.noreply.github.com> * update haskell.nix ref * bump hackage * bump haskell.nix (again) * build-android: add armv7 * flake.nix: remove local nixconf This change to flake.nix breaks build-android.sh script by forcing user to input y/n. AFAIK, this cannot be automated and I rather not include workarounds like piping "yes n | nix build ...". * build-android.sh: update nix version * flake.{nix,lock}: testing * flake.{nix,lock}: restore to original * update android/prepare script to use zip archives * update gradle file * android: 4.6-beta.0 (104) * android: abi filter for bundle (#2075) * android: abi filter for bundle * removed log --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --------- Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com> Co-authored-by: Avently <7953703+avently@users.noreply.github.com> Co-authored-by: shum <shum@liber.li>
2023-03-25 21:51:27 +00:00
#!/bin/bash
set -e
function readlink() {
echo "$(cd "$(dirname "$1")"; pwd -P)"
}
if [ -z "${1}" ]; then
echo "Job repo is unset. Provide it via first argument like: $(readlink "$0")/download-libs.sh https://something.com/job/something/{master,stable}"
android: support for ARMv7a and Android 8+ (#2038) * add armv7a * disable armv6l, that is lacking SMP atomics * Add Android 8 setting (API Ver 26) * Drop x86_64-linux, this makes no sense with `pkgs' = androidPkgs`. * Drop mis-labled x86_64-linux:lib:support (it was aarch64-android) * Drop x86_64-android, these do not exist in nixpkgs The ones set up were aarch64-android anyway (pkgs' = androidPkgs) * android: support Android 8+, armeabi-v7a (32 bit) (#2012) * test * stubs for allowing to launch the app * more stubs and minSdk lowered to 26 * replaced functions that supported on higher API levels with other functions * animated images on lower API levels and write permission * updated abi filter and scripts for downloading libs * changed compression script for multiple apks * cmake changes --------- Co-authored-by: Avently <7953703+avently@users.noreply.github.com> * update haskell.nix ref * bump hackage * bump haskell.nix (again) * build-android: add armv7 * flake.nix: remove local nixconf This change to flake.nix breaks build-android.sh script by forcing user to input y/n. AFAIK, this cannot be automated and I rather not include workarounds like piping "yes n | nix build ...". * build-android.sh: update nix version * flake.{nix,lock}: testing * flake.{nix,lock}: restore to original * update android/prepare script to use zip archives * update gradle file * android: 4.6-beta.0 (104) * android: abi filter for bundle (#2075) * android: abi filter for bundle * removed log --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --------- Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com> Co-authored-by: Avently <7953703+avently@users.noreply.github.com> Co-authored-by: shum <shum@liber.li>
2023-03-25 21:51:27 +00:00
exit 1
fi
job_repo=$1
default_arch=$2
arches=("aarch64" "armv7a")
output_arches=("arm64-v8a" "armeabi-v7a")
if [ -z "${default_arch}" ]; then
# No custom architectures were specified, using defaults
echo "Libs for all supported architectures will be downloaded. To use single arch, pass one of the following values to the end of command: ${arches[*]}"
else
for ((i = 0 ; i < ${#output_arches[@]}; i++)); do
if [ "${arches[$i]}" == "$default_arch" ]; then
output_arches=("${output_arches[$i]}")
fi
done
arches=("$default_arch")
fi
root_dir="$(dirname "$(dirname "$(readlink "$0")")")"
for ((i = 0 ; i < ${#arches[@]}; i++)); do
arch="${arches[$i]}"
output_arch="${output_arches[$i]}"
output_dir="$root_dir/apps/multiplatform/common/src/commonMain/cpp/android/libs/$output_arch/"
android: support for ARMv7a and Android 8+ (#2038) * add armv7a * disable armv6l, that is lacking SMP atomics * Add Android 8 setting (API Ver 26) * Drop x86_64-linux, this makes no sense with `pkgs' = androidPkgs`. * Drop mis-labled x86_64-linux:lib:support (it was aarch64-android) * Drop x86_64-android, these do not exist in nixpkgs The ones set up were aarch64-android anyway (pkgs' = androidPkgs) * android: support Android 8+, armeabi-v7a (32 bit) (#2012) * test * stubs for allowing to launch the app * more stubs and minSdk lowered to 26 * replaced functions that supported on higher API levels with other functions * animated images on lower API levels and write permission * updated abi filter and scripts for downloading libs * changed compression script for multiple apks * cmake changes --------- Co-authored-by: Avently <7953703+avently@users.noreply.github.com> * update haskell.nix ref * bump hackage * bump haskell.nix (again) * build-android: add armv7 * flake.nix: remove local nixconf This change to flake.nix breaks build-android.sh script by forcing user to input y/n. AFAIK, this cannot be automated and I rather not include workarounds like piping "yes n | nix build ...". * build-android.sh: update nix version * flake.{nix,lock}: testing * flake.{nix,lock}: restore to original * update android/prepare script to use zip archives * update gradle file * android: 4.6-beta.0 (104) * android: abi filter for bundle (#2075) * android: abi filter for bundle * removed log --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --------- Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com> Co-authored-by: Avently <7953703+avently@users.noreply.github.com> Co-authored-by: shum <shum@liber.li>
2023-03-25 21:51:27 +00:00
mkdir -p "$output_dir" 2> /dev/null
2024-01-17 15:25:29 +00:00
curl --tlsv1.2 --location -o libsupport.zip $job_repo/x86_64-linux."$arch"-android:lib:support/latest/download/1 && \
android: support for ARMv7a and Android 8+ (#2038) * add armv7a * disable armv6l, that is lacking SMP atomics * Add Android 8 setting (API Ver 26) * Drop x86_64-linux, this makes no sense with `pkgs' = androidPkgs`. * Drop mis-labled x86_64-linux:lib:support (it was aarch64-android) * Drop x86_64-android, these do not exist in nixpkgs The ones set up were aarch64-android anyway (pkgs' = androidPkgs) * android: support Android 8+, armeabi-v7a (32 bit) (#2012) * test * stubs for allowing to launch the app * more stubs and minSdk lowered to 26 * replaced functions that supported on higher API levels with other functions * animated images on lower API levels and write permission * updated abi filter and scripts for downloading libs * changed compression script for multiple apks * cmake changes --------- Co-authored-by: Avently <7953703+avently@users.noreply.github.com> * update haskell.nix ref * bump hackage * bump haskell.nix (again) * build-android: add armv7 * flake.nix: remove local nixconf This change to flake.nix breaks build-android.sh script by forcing user to input y/n. AFAIK, this cannot be automated and I rather not include workarounds like piping "yes n | nix build ...". * build-android.sh: update nix version * flake.{nix,lock}: testing * flake.{nix,lock}: restore to original * update android/prepare script to use zip archives * update gradle file * android: 4.6-beta.0 (104) * android: abi filter for bundle (#2075) * android: abi filter for bundle * removed log --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --------- Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com> Co-authored-by: Avently <7953703+avently@users.noreply.github.com> Co-authored-by: shum <shum@liber.li>
2023-03-25 21:51:27 +00:00
unzip -o libsupport.zip && \
mv libsupport.so "$output_dir" && \
rm libsupport.zip
2024-01-17 15:25:29 +00:00
curl --tlsv1.2 --location -o libsimplex.zip "$job_repo"/x86_64-linux."$arch"-android:lib:simplex-chat/latest/download/1 && \
android: support for ARMv7a and Android 8+ (#2038) * add armv7a * disable armv6l, that is lacking SMP atomics * Add Android 8 setting (API Ver 26) * Drop x86_64-linux, this makes no sense with `pkgs' = androidPkgs`. * Drop mis-labled x86_64-linux:lib:support (it was aarch64-android) * Drop x86_64-android, these do not exist in nixpkgs The ones set up were aarch64-android anyway (pkgs' = androidPkgs) * android: support Android 8+, armeabi-v7a (32 bit) (#2012) * test * stubs for allowing to launch the app * more stubs and minSdk lowered to 26 * replaced functions that supported on higher API levels with other functions * animated images on lower API levels and write permission * updated abi filter and scripts for downloading libs * changed compression script for multiple apks * cmake changes --------- Co-authored-by: Avently <7953703+avently@users.noreply.github.com> * update haskell.nix ref * bump hackage * bump haskell.nix (again) * build-android: add armv7 * flake.nix: remove local nixconf This change to flake.nix breaks build-android.sh script by forcing user to input y/n. AFAIK, this cannot be automated and I rather not include workarounds like piping "yes n | nix build ...". * build-android.sh: update nix version * flake.{nix,lock}: testing * flake.{nix,lock}: restore to original * update android/prepare script to use zip archives * update gradle file * android: 4.6-beta.0 (104) * android: abi filter for bundle (#2075) * android: abi filter for bundle * removed log --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --------- Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com> Co-authored-by: Avently <7953703+avently@users.noreply.github.com> Co-authored-by: shum <shum@liber.li>
2023-03-25 21:51:27 +00:00
unzip -o libsimplex.zip && \
mv libsimplex.so "$output_dir" && \
rm libsimplex.zip
done