build(nc-mobile): prepare for fdroid inclusion (#3102)

* ci(nc-android): remove uneeded deps

* chore(nc-mobile): improve android build

* ci(nc-mobile): remove useless system deps

* ci(nc-mobile): remove useless system deps

* Revert "ci(nc-mobile): remove useless system deps"

This reverts commit 011db2c58e.

* ci(nc-mobile): restore uneeded sys deps (<3 debian based distro)
This commit is contained in:
Pierre Dommerc
2023-02-24 14:06:41 +01:00
committed by GitHub
parent 2178f2b509
commit 7e1e86bc77
10 changed files with 64 additions and 97 deletions
+7 -3
View File
@@ -23,15 +23,12 @@ jobs:
run: |
sudo apt-get update
sudo apt-get -y install \
libwebkit2gtk-4.0-dev \
build-essential \
unzip \
curl \
wget \
libssl-dev \
libgtk-3-dev \
squashfs-tools \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Checkout
@@ -64,6 +61,11 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
# TODO this step takes a considerable amount of time
# We could avoid to compile from source tauri-cli and use instead
# pre-compiled binary provided by the node package `@tauri-apps/cli`
# But when using the later the build fails for some reason
# so keep installing and using tauri-cli
- name: Install tauri cli
run: cargo install tauri-cli --version "^2.0.0-alpha.2"
@@ -93,11 +95,13 @@ jobs:
- name: Build APK
working-directory: nym-connect/mobile
env:
# NODE_TAURI_CLI=${{ github.workspace }}/nym-connect/mobile/node_modules/.bin/tauri
ANDROID_SDK_ROOT: ${{ env.ANDROID_HOME }}
WRY_ANDROID_PACKAGE: net.nymtech.nym_connect
WRY_ANDROID_LIBRARY: nym_connect
# TODO build with release profile (--release), it will requires
# to sign the APK. For now build with debug profile to avoid that
# TODO build using `yarn tauri`, provide NODE_TAURI_CLI, see TODO notes above
run: cargo tauri android build --debug --apk --split-per-abi -t aarch64
# TODO add the version number to APK name
-1
View File
@@ -49,7 +49,6 @@ jobs:
librsvg2-dev \
libsoup-3.0-dev \
libjavascriptcoregtk-4.1-dev
#continue-on-error: true
- name: Checkout
uses: actions/checkout@v3
+2 -1
View File
@@ -26,7 +26,8 @@
"clean:dist": "rm -rf dist",
"clean:node": "rm -rf node_modules",
"clean:rust": "cargo clean --manifest-path src-tauri/Cargo.toml",
"clean:": "run-p clean:node clean:rust"
"clean:android": "cd src-tauri/gen/android/nym_connect/ && gradlew clean",
"clean:": "run-p clean:node clean:rust clean:android"
},
"dependencies": {
"@emotion/react": "^11.7.0",
@@ -1,41 +0,0 @@
[build]
target = 'x86_64-unknown-linux-gnu'
[target.aarch64-linux-android]
linker = '/home/pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang'
rustflags = [
'-L',
'/home/pierre/Documents/nym/nym/nym-connect-new/mobile/src-tauri/.cargo',
'-Clink-arg=-landroid',
'-Clink-arg=-llog',
'-Clink-arg=-lOpenSLES',
]
[target.armv7-linux-androideabi]
linker = '/home/pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang'
rustflags = [
'-L',
'/home/pierre/Documents/nym/nym/nym-connect-new/mobile/src-tauri/.cargo',
'-Clink-arg=-landroid',
'-Clink-arg=-llog',
'-Clink-arg=-lOpenSLES',
]
[target.i686-linux-android]
linker = '/home/pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android24-clang'
rustflags = [
'-L',
'/home/pierre/Documents/nym/nym/nym-connect-new/mobile/src-tauri/.cargo',
'-Clink-arg=-landroid',
'-Clink-arg=-llog',
'-Clink-arg=-lOpenSLES',
]
[target.x86_64-linux-android]
linker = '/home/pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang'
rustflags = [
'-L',
'/home/pierre/Documents/nym/nym/nym-connect-new/mobile/src-tauri/.cargo',
'-Clink-arg=-landroid',
'-Clink-arg=-llog',
'-Clink-arg=-lOpenSLES',
]
@@ -1 +0,0 @@
INPUT(-lunwind)
+1
View File
@@ -2,3 +2,4 @@
# will have compiled files and executables
/target/
WixTools
/.cargo/
+46 -45
View File
@@ -245,9 +245,9 @@ dependencies = [
[[package]]
name = "bip39"
version = "1.0.1"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e89470017230c38e52b82b3ee3f530db1856ba1d434e3a67a3456a8a8dec5f"
checksum = "f5b9d9748b5770d1539657653dc5ac3cd9353549e74238dc0d96c22919128b94"
dependencies = [
"bitcoin_hashes",
"rand 0.6.5",
@@ -258,9 +258,9 @@ dependencies = [
[[package]]
name = "bitcoin_hashes"
version = "0.9.7"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ce18265ec2324ad075345d5814fbeed4f41f0a660055dc78840b74d19b874b1"
checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4"
[[package]]
name = "bitflags"
@@ -397,9 +397,9 @@ dependencies = [
[[package]]
name = "bstr"
version = "1.2.0"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7f0778972c64420fdedc63f09919c8a88bda7b25135357fd25a5d9f3257e832"
checksum = "5ffdb39cb703212f3c11973452c2861b972f757b021158f3516ba10f2fa8b2c1"
dependencies = [
"memchr",
"serde",
@@ -571,9 +571,9 @@ dependencies = [
[[package]]
name = "clap_complete"
version = "4.1.2"
version = "4.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd125be87bf4c255ebc50de0b7f4d2a6201e8ac3dc86e39c0ad081dc5e7236fe"
checksum = "0012995dc3a54314f4710f5631d74767e73c534b8757221708303e48eef7a19b"
dependencies = [
"clap",
]
@@ -603,9 +603,9 @@ dependencies = [
[[package]]
name = "clap_lex"
version = "0.3.1"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade"
checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09"
dependencies = [
"os_str_bytes",
]
@@ -636,7 +636,7 @@ dependencies = [
"sqlx 0.6.2",
"tap",
"thiserror",
"time 0.3.18",
"time 0.3.19",
"tokio",
"tokio-stream",
"url",
@@ -2040,15 +2040,15 @@ dependencies = [
[[package]]
name = "generator"
version = "0.7.2"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d266041a359dfa931b370ef684cceb84b166beb14f7f0421f4a6a3d0c446d12e"
checksum = "33a20a288a94683f5f4da0adecdbe095c94a77c295e514cc6484e9394dd8376e"
dependencies = [
"cc",
"libc",
"log",
"rustversion",
"windows 0.39.0",
"windows 0.44.0",
]
[[package]]
@@ -2533,9 +2533,9 @@ dependencies = [
[[package]]
name = "http"
version = "0.2.8"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
dependencies = [
"bytes",
"fnv",
@@ -2826,9 +2826,9 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146"
[[package]]
name = "is-terminal"
version = "0.4.3"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef"
checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857"
dependencies = [
"hermit-abi 0.3.1",
"io-lifetimes",
@@ -3159,7 +3159,7 @@ dependencies = [
"dirs-next",
"objc-foundation",
"objc_id",
"time 0.3.18",
"time 0.3.19",
]
[[package]]
@@ -3355,11 +3355,12 @@ dependencies = [
[[package]]
name = "notify-rust"
version = "4.7.1"
version = "4.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "260208751689b605138bb55ab6af43ad75f628619a7e0b818d63bf6629e59467"
checksum = "2bfa211d18e360f08e36c364308f394b5eb23a6629150690e109a916dc6f610e"
dependencies = [
"dbus",
"log",
"mac-notification-sys",
"tauri-winrt-notification",
]
@@ -3428,18 +3429,18 @@ dependencies = [
[[package]]
name = "num_enum"
version = "0.5.9"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d829733185c1ca374f17e52b762f24f535ec625d2cc1f070e34c8a9068f341b"
checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9"
dependencies = [
"num_enum_derive",
]
[[package]]
name = "num_enum_derive"
version = "0.5.9"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2be1598bf1c313dcdd12092e3f1920f463462525a21b7b4e11b4168353d0123e"
checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -3584,7 +3585,7 @@ dependencies = [
"serde_json",
"serde_repr",
"thiserror",
"time 0.3.18",
"time 0.3.19",
]
[[package]]
@@ -4348,16 +4349,16 @@ checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
[[package]]
name = "plist"
version = "1.4.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5329b8f106a176ab0dce4aae5da86bfcb139bb74fb00882859e03745011f3635"
checksum = "9469799ca90293a376f68f6fcb8f11990d9cff55602cfba0ba83893c973a7f46"
dependencies = [
"base64 0.13.1",
"base64 0.21.0",
"indexmap",
"line-wrap",
"quick-xml 0.26.0",
"serde",
"time 0.3.18",
"time 0.3.19",
]
[[package]]
@@ -5444,9 +5445,9 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
[[package]]
name = "slab"
version = "0.4.7"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef"
checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
dependencies = [
"autocfg 1.1.0",
]
@@ -5873,9 +5874,9 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.107"
version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
@@ -6073,7 +6074,7 @@ dependencies = [
"sha2 0.10.6",
"tauri-utils",
"thiserror",
"time 0.3.18",
"time 0.3.19",
"url",
"uuid 1.3.0",
"walkdir",
@@ -6213,7 +6214,7 @@ dependencies = [
"subtle 2.4.1",
"subtle-encoding",
"tendermint-proto",
"time 0.3.18",
"time 0.3.19",
"zeroize",
]
@@ -6246,7 +6247,7 @@ dependencies = [
"serde",
"serde_bytes",
"subtle-encoding",
"time 0.3.18",
"time 0.3.19",
]
[[package]]
@@ -6274,7 +6275,7 @@ dependencies = [
"tendermint-config",
"tendermint-proto",
"thiserror",
"time 0.3.18",
"time 0.3.19",
"tokio",
"tracing",
"url",
@@ -6351,9 +6352,9 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.18"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af0097eaf301d576d0b2aead7a59facab6d53cc636340f0291fab8446a2e8613"
checksum = "53250a3b3fed8ff8fd988587d8925d26a83ac3845d9e03b220b37f34c2b8d6c2"
dependencies = [
"itoa 1.0.5",
"js-sys",
@@ -6370,9 +6371,9 @@ checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd"
[[package]]
name = "time-macros"
version = "0.2.6"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2"
checksum = "a460aeb8de6dcb0f381e1ee05f1cd56fcf5a5f6eb8187ff3d8f0b11078d38b7c"
dependencies = [
"time-core",
]
@@ -6453,9 +6454,9 @@ dependencies = [
[[package]]
name = "tokio-stream"
version = "0.1.11"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce"
checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313"
dependencies = [
"futures-core",
"pin-project-lite",
@@ -6839,7 +6840,7 @@ dependencies = [
"rustc_version 0.4.0",
"rustversion",
"thiserror",
"time 0.3.18",
"time 0.3.19",
]
[[package]]
@@ -13,3 +13,4 @@ build
.externalNativeBuild
.cxx
local.properties
app/src/main/jniLibs/**
@@ -1 +0,0 @@
/home/pierre/Documents/nym/nym/nym-connect-new/mobile/src-tauri/target/x86_64-linux-android/debug/libnym_connect.so
@@ -26,17 +26,20 @@ open class BuildTask : DefaultTask() {
val rootDirRel = rootDirRel ?: throw GradleException("rootDirRel cannot be null")
val target = target ?: throw GradleException("target cannot be null")
val release = release ?: throw GradleException("release cannot be null")
val nodeExecutable = System.getenv("NODE_TAURI_CLI")
val home = (System.getenv("HOME") ?: "")
val cargoHome = (System.getenv("CARGO_HOME") ?: "$home/.cargo")
val tauriCli = "$cargoHome/bin/cargo-tauri"
if (!File(tauriCli).isFile()) {
throw GradleException("$tauriCli no shuch file")
val rustExecutable = "$cargoHome/bin/cargo-tauri"
val tauriCli = when {
!nodeExecutable.isNullOrEmpty() && File(nodeExecutable).isFile() -> nodeExecutable
File(rustExecutable).isFile() -> rustExecutable
else -> throw GradleException("couldn't find tauri-cli executable")
}
println("gradle Rust plugin, using tauri cli executable: $tauriCli")
project.exec {
workingDir(File(project.projectDir, rootDirRel.path))
executable(tauriCli)
args(listOf("tauri", "android", "android-studio-script"))
args(listOf("android", "android-studio-script"))
if (project.logger.isEnabled(LogLevel.DEBUG)) {
args("-vv")
} else if (project.logger.isEnabled(LogLevel.INFO)) {