mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 01:39:18 +02:00
Add scripts/install-toolchains.sh
This commit is contained in:
parent
60d915fa13
commit
3b4ed28269
4 changed files with 13 additions and 8 deletions
|
@ -30,8 +30,4 @@ ENV PATH ${PATH}:/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/b
|
|||
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
|
||||
ENV PATH ${PATH}:/root/.cargo/bin
|
||||
COPY jni/deltachat-core-rust/rust-toolchain ${ANDROID_HOME}
|
||||
RUN rustup default `cat ${ANDROID_HOME}/rust-toolchain` \
|
||||
&& rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android
|
||||
|
||||
COPY docker/cargo-config /root/.cargo/config
|
||||
|
|
|
@ -40,8 +40,9 @@ Then, run the image:
|
|||
podman run -it -v $(pwd):/home/app -w /home/app localhost/deltachat-android
|
||||
```
|
||||
|
||||
Within the container, build the native library first:
|
||||
Within the container, install toolchains and build the native library:
|
||||
```
|
||||
root@6012dcb974fe:/home/app# scripts/install-toolchains.sh
|
||||
root@6012dcb974fe:/home/app# ./ndk-make.sh
|
||||
```
|
||||
|
||||
|
|
|
@ -5,8 +5,7 @@ echo "starting time: `date`"
|
|||
cd jni/deltachat-core-rust
|
||||
|
||||
# to setup the toolchains (from https://medium.com/visly/rust-on-android-19f34a2fb43 )
|
||||
# run the following in `jni/deltachat-core-rust`:
|
||||
# $ rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android --toolchain `cat rust-toolchain`
|
||||
# run `scripts/install-toolchains.sh`.
|
||||
#
|
||||
# Currently ndk20b is minimum required version
|
||||
# (newer versions will likely work, however, are not tested and not used in offial releases,
|
||||
|
|
9
scripts/install-toolchains.sh
Executable file
9
scripts/install-toolchains.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Installs Rust cross-compilation toolchains for all supported architectures.
|
||||
#
|
||||
set -e
|
||||
TARGETS="armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android"
|
||||
TOOLCHAIN="$(cat jni/deltachat-core-rust/rust-toolchain)"
|
||||
rustup install "$TOOLCHAIN"
|
||||
rustup target add $TARGETS --toolchain "$TOOLCHAIN"
|
Loading…
Add table
Add a link
Reference in a new issue