slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.57k stars 604 forks source link

Gettext feature for Android #5771

Open FloVanGH opened 3 months ago

FloVanGH commented 3 months ago

At the moment it is not possible to build an Android app with Slint using the gettext feature for translation.

This is the error display on trying to build an Android Slint app with the gettext feature:

configure: error: Cannot find a type to use in place of socklen_t
  configure: error: /var/folders/f8/z6gqx68n093cnhkxzr7x7p_h0000gn/T/t1747-0/gettext/libtextstyle/configure failed for libtextstyle
  thread 'main' panicked at /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gettext-sys-0.21.3/build.rs:300:5:

  command did not execute successfully, got: exit status: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: Command `AR_aarch64-linux-android=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar CARGO_ENCODED_RUSTFLAGS=-Clink-arg=--target=aarch64-linux-android23\u{1f}-L\u{1f}/Users/user/Projects/project/target/cargo-apk-temp-extra-link-libraries CARGO_TARGET_AARCH64_LINUX_ANDROID_AR=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang CC_aarch64-linux-android=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang CFLAGS_aarch64-linux-android=--target=aarch64-linux-android23 CXXFLAGS_aarch64-linux-android=--target=aarch64-linux-android23 CXX_aarch64-linux-android=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ cargo build --target aarch64-linux-android --package castle_of_focus --release` had a non-zero exit code.
ogoffart commented 3 months ago

at some point, we'll have to support translation without gettext: https://github.com/slint-ui/slint/issues/3715

on the other hand, this issue there seems like a build error in the gettext-sys crate. probably related to cross compilation