mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-11-22 00:47:28 -06:00
revert fix
This commit is contained in:
parent
faf8347aa8
commit
5976d30832
@ -33,16 +33,8 @@ while true; do
|
|||||||
# ensure Android SDK packages are installed
|
# ensure Android SDK packages are installed
|
||||||
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager build-tools\;34.0.0 ndk\;26.3.11579264 cmake\;3.22.1 platform-tools platforms\;android-34
|
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager build-tools\;34.0.0 ndk\;26.3.11579264 cmake\;3.22.1 platform-tools platforms\;android-34
|
||||||
|
|
||||||
# ensure ANDROID_NDK_HOME is defined and exists
|
|
||||||
ANDROID_NDK_HOME="$ANDROID_HOME/ndk/26.3.11579264"
|
|
||||||
if [ -d "$ANDROID_NDK_HOME" ]; then
|
|
||||||
echo '[X] Android NDK is defined and exists'
|
|
||||||
else
|
|
||||||
echo 'Android NDK is not defined or does not exist'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ensure ndk is installed
|
# ensure ndk is installed
|
||||||
|
ANDROID_NDK_HOME="$ANDROID_HOME/ndk/26.3.11579264"
|
||||||
if [ -f "$ANDROID_NDK_HOME/ndk-build" ]; then
|
if [ -f "$ANDROID_NDK_HOME/ndk-build" ]; then
|
||||||
echo '[X] Android NDK is installed at the location $ANDROID_NDK_HOME'
|
echo '[X] Android NDK is installed at the location $ANDROID_NDK_HOME'
|
||||||
else
|
else
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
UNAME_M=`uname -m`
|
UNAME_M=${1-$(uname -m)}
|
||||||
if [[ "$UNAME_M" == "arm64" ]]; then
|
if [[ "$UNAME_M" == "arm64" ]]; then
|
||||||
ANDROID_ABI=arm64-v8a
|
ANDROID_ABI=arm64-v8a
|
||||||
elif [[ "$UNAME_M" == "x86_64" ]]; then
|
elif [[ "$UNAME_M" == "x86_64" ]]; then
|
||||||
@ -14,16 +14,13 @@ AVD_TAG="google_atd"
|
|||||||
AVD_IMAGE="system-images;android-30;$AVD_TAG;$ANDROID_ABI"
|
AVD_IMAGE="system-images;android-30;$AVD_TAG;$ANDROID_ABI"
|
||||||
AVD_DEVICE="Nexus 10"
|
AVD_DEVICE="Nexus 10"
|
||||||
|
|
||||||
SDKMANAGER=$ANDROID_HOME/tools/bin/sdkmanager
|
SDKMANAGER=$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager
|
||||||
AVDMANAGER=$ANDROID_HOME/tools/bin/avdmanager
|
AVDMANAGER=$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager
|
||||||
if ! command -v $SDKMANAGER; then
|
if ! command -v $SDKMANAGER; then
|
||||||
SDKMANAGER=$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager
|
echo "Can't find 'sdkmanager' in the usual places."
|
||||||
AVDMANAGER=$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager
|
exit
|
||||||
if ! command -v $SDKMANAGER; then
|
|
||||||
echo "Can't find 'sdkmanager' in the usual places."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
EMULATOR=$ANDROID_HOME/emulator/emulator
|
EMULATOR=$ANDROID_HOME/emulator/emulator
|
||||||
if ! command -v $EMULATOR; then
|
if ! command -v $EMULATOR; then
|
||||||
echo "Can't find 'emulator' in the usual places."
|
echo "Can't find 'emulator' in the usual places."
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
use glob::glob;
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
use std::fs::OpenOptions;
|
use std::fs::OpenOptions;
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::{
|
use std::{
|
||||||
io,
|
env, io,
|
||||||
path::Path,
|
path::Path,
|
||||||
process::{Command, Stdio},
|
process::{Command, Stdio},
|
||||||
};
|
};
|
||||||
@ -167,6 +168,28 @@ fn do_capnp_build() {
|
|||||||
append_hash_and_desired_capnp_version_hash("proto/veilid.capnp", "proto/veilid_capnp.rs");
|
append_hash_and_desired_capnp_version_hash("proto/veilid.capnp", "proto/veilid_capnp.rs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fix for missing __extenddftf2 on Android x86_64 Emulator
|
||||||
|
fn fix_android_emulator() {
|
||||||
|
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||||
|
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
|
||||||
|
if target_arch == "x86_64" && target_os == "android" {
|
||||||
|
let missing_library = "clang_rt.builtins-x86_64-android";
|
||||||
|
let android_home = env::var("ANDROID_HOME")
|
||||||
|
.or(env::var("ANDROID_SDK_ROOT"))
|
||||||
|
.expect("ANDROID_HOME or ANDROID_SDK_ROOT not set");
|
||||||
|
let lib_path = glob(&format!(
|
||||||
|
"{android_home}/ndk/26.3.11579264/**/lib{missing_library}.a"
|
||||||
|
))
|
||||||
|
.expect("failed to glob")
|
||||||
|
.next()
|
||||||
|
.expect("Need libclang_rt.builtins-x86_64-android.a")
|
||||||
|
.unwrap();
|
||||||
|
let lib_dir = lib_path.parent().unwrap();
|
||||||
|
println!("cargo:rustc-link-search={}", lib_dir.display());
|
||||||
|
println!("cargo:rustc-link-lib=static={missing_library}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
if std::env::var("DOCS_RS").is_ok()
|
if std::env::var("DOCS_RS").is_ok()
|
||||||
|| std::env::var("CARGO_CFG_DOC").is_ok()
|
|| std::env::var("CARGO_CFG_DOC").is_ok()
|
||||||
@ -179,4 +202,6 @@ fn main() {
|
|||||||
println!("cargo:warning=rebuilding proto/veilid_capnp.rs because it has changed from the last generation of proto/veilid.capnp");
|
println!("cargo:warning=rebuilding proto/veilid_capnp.rs because it has changed from the last generation of proto/veilid.capnp");
|
||||||
do_capnp_build();
|
do_capnp_build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fix_android_emulator();
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.3.1'
|
classpath 'com.android.tools.build:gradle:7.4.2'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
Loading…
Reference in New Issue
Block a user