Merge tag 'v0.0.5' into aosp/main
Last manual update before external_updater.
Bug: 384926433
Bug: 384872664
Change-Id: I55eee605fa0bf464d01392547c213bae583053fd
diff --git a/Android.bp b/Android.bp
index 4c71167..242ef63 100644
--- a/Android.bp
+++ b/Android.bp
@@ -4,5 +4,3 @@
license_kinds: ["SPDX-license-identifier-MIT"],
license_text: ["LICENSE"],
}
-
-
diff --git a/METADATA b/METADATA
new file mode 100644
index 0000000..81cf911
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,13 @@
+name: "v4l2r"
+description: "Rust bindings for V4L2"
+third_party: {
+ identifier {
+ type: "Git"
+ value: "https://github.com/Gnurou/v4l2r"
+ primary_source: true
+ version: "v0.0.4"
+ }
+ version: "v0.0.4"
+ last_upgrade_date { year: 2024 month: 9 day: 20 }
+ license_type: NOTICE
+}
diff --git a/MODULE_LICENSE_MIT b/MODULE_LICENSE_MIT
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_MIT
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..5a2b844
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1 @@
+include platform/prebuilts/rust:main:/OWNERS
diff --git a/android/Android.bp b/android/Android.bp
index 7eea220..b3f560b 100644
--- a/android/Android.bp
+++ b/android/Android.bp
@@ -5,14 +5,16 @@
rust_binary_host {
name: "v4l2r_bindgen_build",
srcs: ["build.rs"],
- rustlibs: [
- "libbindgen",
- "libbindgen_cmd",
- ],
+ rustlibs: [
+ "libbindgen",
+ "libbindgen_cmd",
+ ],
lints: "android",
clippy_lints: "android",
product_available: true,
vendor_available: true,
+ host_cross_supported: false,
+ compile_multilib: "first",
}
rust_bindgen {
@@ -22,7 +24,17 @@
wrapper_src: "android_wrapper.h",
source_stem: "bindings",
cflags: ["-I external/rust/crates/v4l2r/lib"],
+ host_supported: true,
+ apex_available: [
+ "//apex_available:anyapex",
+ "//apex_available:platform",
+ ],
product_available: true,
vendor_available: true,
visibility: ["//external/rust/crates/v4l2r/lib"],
+ target: {
+ linux_glibc: {
+ header_libs: ["libc_uapi_headers"],
+ },
+ },
}
diff --git a/cargo_embargo.json b/cargo_embargo.json
index b31cd27..56d517a 100644
--- a/cargo_embargo.json
+++ b/cargo_embargo.json
@@ -3,14 +3,7 @@
"package": {
"v4l2r": {
"dep_blocklist": ["libctrlc", "libclap"],
- "host_supported": false,
"add_module_block": "android/srcs.bp"
- },
- "v4l2r-ffi": {
- "host_supported": false
- },
- "v4l2r-utils": {
- "host_supported": false
}
},
"run_cargo": false,
diff --git a/ffi/Android.bp b/ffi/Android.bp
index 6a11544..9c9e068 100644
--- a/ffi/Android.bp
+++ b/ffi/Android.bp
@@ -7,6 +7,7 @@
rust_library {
name: "libv4l2r_ffi",
+ host_supported: true,
crate_name: "v4l2r_ffi",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
@@ -34,6 +35,7 @@
rust_ffi_static {
name: "libv4l2r_ffi_static",
+ host_supported: true,
crate_name: "v4l2r_ffi",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
@@ -61,12 +63,16 @@
rust_test {
name: "v4l2r-ffi_test_src_lib",
+ host_supported: true,
crate_name: "v4l2r_ffi",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
crate_root: "src/lib.rs",
test_suites: ["general-tests"],
auto_gen_config: true,
+ test_options: {
+ unit_test: true,
+ },
edition: "2021",
features: [
"default",
diff --git a/lib/Android.bp b/lib/Android.bp
index 94d35a4..2173cca 100644
--- a/lib/Android.bp
+++ b/lib/Android.bp
@@ -7,6 +7,7 @@
rust_library {
name: "libv4l2r",
+ host_supported: true,
crate_name: "v4l2r",
cargo_env_compat: true,
cargo_pkg_version: "0.0.5",
@@ -33,12 +34,16 @@
rust_test {
name: "v4l2r_test_src_lib",
+ host_supported: true,
crate_name: "v4l2r",
cargo_env_compat: true,
cargo_pkg_version: "0.0.5",
crate_root: "src/lib.rs",
test_suites: ["general-tests"],
auto_gen_config: true,
+ test_options: {
+ unit_test: true,
+ },
edition: "2021",
rustlibs: [
"libanyhow",
diff --git a/utils/Android.bp b/utils/Android.bp
index b20eb2d..8b47153 100644
--- a/utils/Android.bp
+++ b/utils/Android.bp
@@ -7,6 +7,7 @@
rust_library {
name: "libv4l2r_utils",
+ host_supported: true,
crate_name: "v4l2r_utils",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
@@ -29,12 +30,16 @@
rust_test {
name: "v4l2r-utils_test_src_lib",
+ host_supported: true,
crate_name: "v4l2r_utils",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
crate_root: "src/lib.rs",
test_suites: ["general-tests"],
auto_gen_config: true,
+ test_options: {
+ unit_test: true,
+ },
edition: "2021",
rustlibs: [
"libanyhow",