mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 22:57:59 -05:00
app: tweak android build paths and Dockerfile
This commit is contained in:
@@ -19,8 +19,8 @@ RUN rustup target add i686-linux-android
|
|||||||
RUN rustup target add x86_64-linux-android
|
RUN rustup target add x86_64-linux-android
|
||||||
|
|
||||||
# Install Android SDK
|
# Install Android SDK
|
||||||
ENV ANDROID_HOME /opt/android-sdk-linux
|
ENV ANDROID_HOME /opt/android-sdk-linux/
|
||||||
ENV JAVA_HOME /usr/lib/jvm/default
|
ENV JAVA_HOME /usr/lib/jvm/default/
|
||||||
RUN mkdir ${ANDROID_HOME} && \
|
RUN mkdir ${ANDROID_HOME} && \
|
||||||
cd ${ANDROID_HOME} && \
|
cd ${ANDROID_HOME} && \
|
||||||
wget -q https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip && \
|
wget -q https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip && \
|
||||||
@@ -37,11 +37,11 @@ RUN yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager "build-tools;36.0.
|
|||||||
RUN ${ANDROID_HOME}/tools/bin/sdkmanager --update | grep -v = || true
|
RUN ${ANDROID_HOME}/tools/bin/sdkmanager --update | grep -v = || true
|
||||||
|
|
||||||
# Install Android NDK
|
# Install Android NDK
|
||||||
RUN cd /usr/local && \
|
RUN cd /opt/ && \
|
||||||
wget -q http://dl.google.com/android/repository/android-ndk-r25-linux.zip && \
|
wget -q http://dl.google.com/android/repository/android-ndk-r25-linux.zip && \
|
||||||
unzip -q android-ndk-r25-linux.zip && \
|
unzip -q android-ndk-r25-linux.zip && \
|
||||||
rm android-ndk-r25-linux.zip
|
rm android-ndk-r25-linux.zip
|
||||||
ENV NDK_HOME /usr/local/android-ndk-r25
|
ENV NDK_HOME /opt/android-ndk-r25/
|
||||||
|
|
||||||
# Copy contents to container. Should only use this on a clean directory
|
# Copy contents to container. Should only use this on a clean directory
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
|
|||||||
@@ -86,8 +86,9 @@ dev: $(SRC) fonts assets/forest_1920x1080.ivf
|
|||||||
-mv target/debug/darkfi-app .
|
-mv target/debug/darkfi-app .
|
||||||
./darkfi-app
|
./darkfi-app
|
||||||
|
|
||||||
|
# Users should use the android-release and android-debug targets instead.
|
||||||
apk: $(SRC) fonts assets/forest_720x1280.mp4
|
apk: $(SRC) fonts assets/forest_720x1280.mp4
|
||||||
podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build $(DEV_FEATURES)
|
cargo quad-apk build $(DEV_FEATURES)
|
||||||
$(MAKE) install-apk
|
$(MAKE) install-apk
|
||||||
|
|
||||||
install-apk:
|
install-apk:
|
||||||
@@ -100,7 +101,7 @@ install-apk:
|
|||||||
adb $(ADB_DEVICE) logcat -v color -s darkfi -s SAPP -s libc -s DEBUG -s ActivityManager -s ActivityTaskManager -s WindowManager -s AndroidRuntime -s rkfi.darkfi_app | tee output.log
|
adb $(ADB_DEVICE) logcat -v color -s darkfi -s SAPP -s libc -s DEBUG -s ActivityManager -s ActivityTaskManager -s WindowManager -s AndroidRuntime -s rkfi.darkfi_app | tee output.log
|
||||||
|
|
||||||
# Useful for dev
|
# Useful for dev
|
||||||
cli:
|
podman-cli:
|
||||||
podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -it apk bash
|
podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -it apk bash
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
|
|||||||
@@ -26,10 +26,14 @@ podman build -t apk .
|
|||||||
make android
|
make android
|
||||||
```
|
```
|
||||||
|
|
||||||
To debug any issues, you can enter an interactive terminal using `make cli`.
|
To debug any issues, you can enter an interactive terminal using `make podman-cli`.
|
||||||
|
|
||||||
To delete everything, run `podman system reset`.
|
To delete everything, run `podman system reset`.
|
||||||
|
|
||||||
|
Users who prefer to build locally can follow the commands in the `Dockerfile`.
|
||||||
|
Note that the `build.rs` hardcodes the SDK/NDK paths so either you follow it
|
||||||
|
exactly (recommended) or modify `build.rs`.
|
||||||
|
|
||||||
# Useful Dev Commands
|
# Useful Dev Commands
|
||||||
|
|
||||||
This is just for devs. Users ignore this.
|
This is just for devs. Users ignore this.
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ fn main() {
|
|||||||
|
|
||||||
if target_os == "android" {
|
if target_os == "android" {
|
||||||
// Since we run this inside a container, we can just hardcore the paths directly
|
// Since we run this inside a container, we can just hardcore the paths directly
|
||||||
println!("cargo:rustc-link-search=/usr/local/android-ndk-r25/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/14.0.6/lib/linux/");
|
println!("cargo:rustc-link-search=/opt/android-ndk-r25/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/14.0.6/lib/linux/");
|
||||||
match target_arch.as_str() {
|
match target_arch.as_str() {
|
||||||
"aarch64" => println!("cargo:rustc-link-lib=static=clang_rt.builtins-aarch64-android"),
|
"aarch64" => println!("cargo:rustc-link-lib=static=clang_rt.builtins-aarch64-android"),
|
||||||
"arm" => println!("cargo:rustc-link-lib=static=clang_rt.builtins-arm-android"),
|
"arm" => println!("cargo:rustc-link-lib=static=clang_rt.builtins-arm-android"),
|
||||||
|
|||||||
Reference in New Issue
Block a user