From 988cdf98eba03c513b00e864a5d0480614e0a2d5 Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Thu, 9 Jun 2016 12:53:47 -0500 Subject: [PATCH 1/3] Update build.xml for new format from updated toolchains --- support/android/apk/build.xml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/support/android/apk/build.xml b/support/android/apk/build.xml index 3e22c93f50a..3d1611517a8 100644 --- a/support/android/apk/build.xml +++ b/support/android/apk/build.xml @@ -36,9 +36,17 @@ - - - + + + Date: Thu, 9 Jun 2016 12:54:15 -0500 Subject: [PATCH 2/3] Restore Android to using /sdcard/servo for data, cache, and config paths --- components/util/basedir.rs | 23 +++++++++++++++++++---- components/util/lib.rs | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/components/util/basedir.rs b/components/util/basedir.rs index 733bcd69507..5c7896a388b 100644 --- a/components/util/basedir.rs +++ b/components/util/basedir.rs @@ -9,30 +9,45 @@ #[cfg(any(target_os = "macos", target_os = "windows"))] use std::env; use std::path::PathBuf; -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))] use xdg; -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))] pub fn default_config_dir() -> Option { let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); let config_dir = xdg_dirs.get_config_home(); Some(config_dir) } -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] +#[cfg(target_os = "android")] +pub fn default_config_dir() -> Option { + Some(PathBuf::from("/sdcard/servo")) +} + +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))] pub fn default_data_dir() -> Option { let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); let data_dir = xdg_dirs.get_data_home(); Some(data_dir) } -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] +#[cfg(target_os = "android")] +pub fn default_data_dir() -> Option { + Some(PathBuf::from("/sdcard/servo")) +} + +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))] pub fn default_cache_dir() -> Option { let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); let cache_dir = xdg_dirs.get_cache_home(); Some(cache_dir) } +#[cfg(target_os = "android")] +pub fn default_cache_dir() -> Option { + Some(PathBuf::from("/sdcard/servo")) +} + #[cfg(target_os = "macos")] pub fn default_config_dir() -> Option { let mut config_dir = env::home_dir().unwrap(); diff --git a/components/util/lib.rs b/components/util/lib.rs index 251103738ec..6417fe40a45 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -37,7 +37,7 @@ extern crate rustc_serialize; extern crate serde; extern crate smallvec; extern crate url; -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))] extern crate xdg; use std::sync::Arc; From df9539c2b08868712e86631b4521d9b4218ec0ae Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Thu, 9 Jun 2016 13:51:17 -0500 Subject: [PATCH 3/3] Pick up libz update to fix android build --- components/servo/Cargo.lock | 4 ++-- components/util/Cargo.toml | 2 +- ports/cef/Cargo.lock | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index ae10f535115..00399f7b82f 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -1241,7 +1241,7 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1336,7 +1336,7 @@ version = "0.0.0" source = "git+https://github.com/servo/mozjs#2af5849a97a9f18acd482940ba3fa0c6797ed7eb" dependencies = [ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml index 80ea5a45397..40c8f56a64b 100644 --- a/components/util/Cargo.toml +++ b/components/util/Cargo.toml @@ -31,7 +31,7 @@ serde_macros = "0.7" smallvec = "0.1" url = {version = "1.0.0", features = ["heap_size", "serde"]} -[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))'.dependencies] +[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))'.dependencies] xdg = "2.0" [target.'cfg(windows)'.dependencies] diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 4eb9f80b4a6..04dfbcb9acd 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -1147,7 +1147,7 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1242,7 +1242,7 @@ version = "0.0.0" source = "git+https://github.com/servo/mozjs#2af5849a97a9f18acd482940ba3fa0c6797ed7eb" dependencies = [ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]]