Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 20:53:56 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
{"files":{"CHANGELOG.md":"7910d431a63bb1437708f9a75435419941b2b27ba15e50ecafb159c2564e5d84","Cargo.toml":"228e4432b6367f8c8348757f9798732b331b1748c116a0af9d2a1ef02b92eaa8","README.md":"27fdcf69714fcf6f81b1d2fe4e185cd698056681dfa539c716d33bb9bcc9ff6f","generate_bindings.sh":"ac09eddd85323507a4b4a77634163b0da94c3e3f9f04ad061300c024b974ab1c","src/ffi_aarch64.rs":"d93eb87810876180e906cf02b599dbb299c581384b38e5c3e9617000e1fd332e","src/ffi_arm.rs":"62b88068ea170726581c6b7077e2ae07dca3dc1f636af1cac20bf3cf4ccaefb3","src/ffi_i686.rs":"ede1fa2a87d3c15697e0fd452d4cdf6c35ee889046064e3b2c7bfcbc629914c5","src/ffi_x86_64.rs":"0a4fc4dc60378ca3433927d1ad500fa9e33e7069e974fa3f89a3c97e7fcabf6b","src/lib.rs":"22999084db740073e1db22d0d47ed56035cc665c1ce353c1753a8e9cb917efdd","wrapper.h":"43f5ed0d881f221df76be881760da0ec9f355c2fc1dc11461975cc21cd297092"},"package":"ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873"}
+45
View File
@@ -0,0 +1,45 @@
# Unreleased
# 0.6.0 (2024-04-26)
- Generate against upstream NDK build `11769913`. (#471)
- Add `nativewindow` feature to link against `libnativewindow`. (#465)
# 0.5.0 (2023-10-15)
- **Breaking:** Regenerate against NDK `25.2.9519653` with `rust-bindgen 0.66.0`. (#324, #370)
- Add `font`, `font_matcher`, `system_fonts` bindings. (#397)
- Add `sync` feature for linking against `libsync.so`. (#423)
# 0.4.1 (2022-11-23)
- Re-release of `0.4.0` to combat a faulty `0.4.0+25.0.8775105` publish. Now also includes `+23.1.7779620` version metadata.
# 0.4.0 (2022-07-24)
- **Breaking:** Turn `enum` type aliases into newtype wrappers (and regenerate with `rust-bindgen 0.59.2`). (#245, #315)
# 0.3.0 (2022-01-05)
- **Breaking:** Use `jni-sys` for low-level JNI types instead of those autogenerated by `bindgen` based on the header.
These JNI types are _not_ publicly (re)exported anymore. (#209)
- Regenerate against NDK 23.1.7779620 with `rust-bindgen 0.59.1`, now including all Android-related headers. (#201)
# 0.2.2 (2021-11-22)
- Regenerate against NDK 23.0.7599858. (#178)
# 0.2.1 (2020-10-15)
- Fix documentation build on docs.rs
# 0.2.0 (2020-09-15)
- **Breaking:** `onSaveInstanceState` signature corrected to take `outSize` as a `*mut size_t` instead of `*mut usize`.
- Add `media` bindings
- Add `bitmap` and `hardware_buffer` bindings
- Add `aaudio` bindings
# 0.1.0 (2020-04-22)
- Initial release! 🎉
+50
View File
@@ -0,0 +1,50 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
rust-version = "1.60"
name = "ndk-sys"
version = "0.6.0+11769913"
authors = ["The Rust Windowing contributors"]
description = "FFI bindings for the Android NDK"
homepage = "https://github.com/rust-mobile/ndk"
documentation = "https://docs.rs/ndk-sys"
readme = "README.md"
keywords = [
"android",
"ndk",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-mobile/ndk"
[package.metadata.docs.rs]
rustdoc-args = [
"--cfg",
"docsrs",
]
targets = [
"aarch64-linux-android",
"armv7-linux-androideabi",
"i686-linux-android",
"x86_64-linux-android",
]
[dependencies.jni-sys]
version = "0.3.0"
[features]
audio = []
bitmap = []
media = []
nativewindow = []
sync = []
test = []
+21
View File
@@ -0,0 +1,21 @@
[![ci](https://github.com/rust-mobile/ndk/actions/workflows/rust.yml/badge.svg)](https://github.com/rust-mobile/ndk/actions/workflows/rust.yml) ![MIT license](https://img.shields.io/badge/License-MIT-green.svg) ![APACHE2 license](https://img.shields.io/badge/License-APACHE2-green.svg)
Rust bindings to the [Android NDK](https://developer.android.com/ndk)
Name | Description | Badges
--- | --- | ---
[`ndk-sys`](./ndk-sys) | Raw FFI bindings to the NDK | [![crates.io](https://img.shields.io/crates/v/ndk-sys.svg)](https://crates.io/crates/ndk-sys) [![Docs](https://docs.rs/ndk-sys/badge.svg)](https://docs.rs/ndk-sys) [![MSRV](https://img.shields.io/badge/rustc-1.60.0+-ab6000.svg)](https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html)
[`ndk`](./ndk) | Safe abstraction of the bindings | [![crates.io](https://img.shields.io/crates/v/ndk.svg)](https://crates.io/crates/ndk) [![Docs](https://docs.rs/ndk/badge.svg)](https://docs.rs/ndk) [![MSRV](https://img.shields.io/badge/rustc-1.64.0+-ab6000.svg)](https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html)
See these [`ndk-examples`](https://github.com/rust-mobile/cargo-apk/tree/main/examples/examples) and these [`rust-android-examples`](https://github.com/rust-mobile/rust-android-examples) for examples using the NDK.
> [!IMPORTANT]
> This repository was recently [modularized](https://github.com/rust-mobile/ndk/issues/372) and the following crates were split into separate repositories:
>
> Crate | New Location | Notes
> ------|--------------|------
> ndk-context | https://github.com/rust-mobile/ndk-context |
> ndk-glue | https://github.com/rust-mobile/ndk-glue | ⛔ _deprecated_ - see [android-activity](https://github.com/rust-mobile/android-activity)
> ndk-macro | https://github.com/rust-mobile/ndk-glue | ⛔ _deprecated_ - see [android-activity](https://github.com/rust-mobile/android-activity)
> ndk-build | https://github.com/rust-mobile/cargo-apk | ⛔ _deprecated_ - see [xbuild](https://github.com/rust-mobile/xbuild)
> cargo-apk | https://github.com/rust-mobile/cargo-apk | ⛔ _deprecated_ - see [xbuild](https://github.com/rust-mobile/xbuild)
+84
View File
@@ -0,0 +1,84 @@
#!/bin/sh
set -ex
os=$(uname -s)
if [[ "$os" == "Darwin" ]]; then
host_tag="darwin-x86_64"
elif [[ "$os" == "CYGWIN"* ]]; then
host_tag="windows-x86_64"
else
host_tag="linux-x86_64"
fi
# Builds can be found at https://ci.android.com for the `ndk` component
build_id=$(grep -oP 'version = "\d\.\d.\d\+\K\d+' ./Cargo.toml)
# From https://cs.android.com/android/platform/superproject/main/+/main:development/python-packages/fetchartifact/fetchartifact/__init__.py
target="ndk"
artifact_name="ndk_platform.tar.bz2"
url="https://androidbuildinternal.googleapis.com/android/internal/build/v3/builds/$build_id/$target/attempts/latest/artifacts/$artifact_name/url"
echo "Downloading sysroot $build_id from $url"
curl -L $url -o "$artifact_name"
tar xvf "$artifact_name" "ndk/sysroot/usr/include"
sysroot="$PWD/ndk/sysroot/"
[ ! -d "$sysroot" ] && echo "Android sysroot $sysroot does not exist!" && exit 1
while read ARCH && read TARGET ; do
bindgen wrapper.h -o src/ffi_$ARCH.rs \
--blocklist-item 'JNI\w+' \
--blocklist-item 'C?_?JNIEnv' \
--blocklist-item '_?JavaVM' \
--blocklist-item '_?j\w+' \
--newtype-enum '\w+_(result|status)_t' \
--newtype-enum 'ACameraDevice_request_template' \
--newtype-enum 'ADataSpace' \
--newtype-enum 'AHardwareBuffer_Format' \
--newtype-enum 'AHardwareBuffer_UsageFlags' \
--newtype-enum 'AHdrMetadataType' \
--newtype-enum 'AIMAGE_FORMATS' \
--newtype-enum 'AMediaDrmEventType' \
--newtype-enum 'AMediaDrmKeyRequestType' \
--newtype-enum 'AMediaDrmKeyType' \
--newtype-enum 'AMediaKeyStatusType' \
--newtype-enum 'AMidiDevice_Protocol' \
--newtype-enum 'AMotionClassification' \
--newtype-enum 'ANativeWindowTransform' \
--newtype-enum 'ANativeWindow_ChangeFrameRateStrategy' \
--newtype-enum 'ANativeWindow_FrameRateCompatibility' \
--newtype-enum 'ANativeWindow_LegacyFormat' \
--newtype-enum 'AndroidBitmapCompressFormat' \
--newtype-enum 'AndroidBitmapFormat' \
--newtype-enum 'AppendMode' \
--newtype-enum 'DeviceTypeCode' \
--newtype-enum 'DurationCode' \
--newtype-enum 'FeatureLevelCode' \
--newtype-enum 'FuseCode' \
--newtype-enum 'HeapTaggingLevel' \
--newtype-enum 'OperandCode' \
--newtype-enum 'OperationCode' \
--newtype-enum 'OutputFormat' \
--newtype-enum 'PaddingCode' \
--newtype-enum 'PreferenceCode' \
--newtype-enum 'PriorityCode' \
--newtype-enum 'ResNsendFlags' \
--newtype-enum 'ResultCode' \
--newtype-enum 'SeekMode' \
--newtype-enum 'acamera_\w+' \
--newtype-enum 'android_LogPriority' \
--newtype-enum 'android_fdsan_error_level' \
--newtype-enum 'android_fdsan_owner_type' \
--newtype-enum 'cryptoinfo_mode_t' \
--newtype-enum 'log_id' \
-- \
--sysroot="$sysroot" --target=$TARGET
done << EOF
arm
arm-linux-androideabi
aarch64
aarch64-linux-android
i686
i686-linux-android
x86_64
x86_64-linux-android
EOF
+24982
View File
File diff suppressed because it is too large Load Diff
+25258
View File
File diff suppressed because it is too large Load Diff
+27027
View File
File diff suppressed because it is too large Load Diff
+27144
View File
File diff suppressed because it is too large Load Diff
+61
View File
@@ -0,0 +1,61 @@
//! Raw FFI bindings to the Android NDK.
//!
//! The bindings are pre-generated and the right one for the platform is selected at compile time.
// Bindgen lints
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(improper_ctypes)]
#![allow(clippy::all)]
// Temporarily allow UB nullptr dereference in bindgen layout tests until fixed upstream:
// https://github.com/rust-lang/rust-bindgen/pull/2055
// https://github.com/rust-lang/rust-bindgen/pull/2064
#![allow(deref_nullptr)]
// Test setup lints
#![cfg_attr(test, allow(dead_code))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
use jni_sys::*;
#[cfg(not(any(target_os = "android", feature = "test")))]
compile_error!("ndk-sys only supports compiling for Android");
#[cfg(all(
any(target_os = "android", feature = "test"),
any(target_arch = "arm", target_arch = "armv7")
))]
include!("ffi_arm.rs");
#[cfg(all(any(target_os = "android", feature = "test"), target_arch = "aarch64"))]
include!("ffi_aarch64.rs");
#[cfg(all(any(target_os = "android", feature = "test"), target_arch = "x86"))]
include!("ffi_i686.rs");
#[cfg(all(any(target_os = "android", feature = "test"), target_arch = "x86_64"))]
include!("ffi_x86_64.rs");
#[cfg(target_os = "android")]
#[link(name = "android")]
extern "C" {}
#[cfg(all(feature = "nativewindow", target_os = "android"))]
#[link(name = "nativewindow")]
extern "C" {}
#[cfg(all(feature = "media", target_os = "android"))]
#[link(name = "mediandk")]
extern "C" {}
#[cfg(all(feature = "bitmap", target_os = "android"))]
#[link(name = "jnigraphics")]
extern "C" {}
#[cfg(all(feature = "audio", target_os = "android"))]
#[link(name = "aaudio")]
extern "C" {}
#[cfg(all(feature = "sync", target_os = "android"))]
#[link(name = "sync")]
extern "C" {}
+91
View File
@@ -0,0 +1,91 @@
#include <android/api-level.h>
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>
// #include <android/binder_auto_utils.h>
// #include <android/binder_enums.h>
// #include <android/binder_ibinder.h>
// #include <android/binder_ibinder_jni.h>
// #include <android/binder_interface_utils.h>
// #include <android/binder_internal_logging.h>
// #include <android/binder_parcelable_utils.h>
// #include <android/binder_parcel.h>
// #include <android/binder_parcel_jni.h>
// #include <android/binder_parcel_utils.h>
// #include <android/binder_status.h>
// #include <android/binder_to_string.h>
#include <android/bitmap.h>
#include <android/choreographer.h>
#include <android/configuration.h>
#include <android/data_space.h>
#include <android/dlext.h>
#include <android/fdsan.h>
#include <android/file_descriptor_jni.h>
#include <android/font.h>
#include <android/font_matcher.h>
// #include <android/hardware_buffer_aidl.h>
#include <android/hardware_buffer.h>
#include <android/hardware_buffer_jni.h>
#include <android/hdr_metadata.h>
#include <android/imagedecoder.h>
#include <android/input.h>
#include <android/keycodes.h>
// #include <android/legacy_stdlib_inlines.h>
// #include <android/legacy_termios_inlines.h>
// #include <android/legacy_threads_inlines.h>
// #include <android/legacy_unistd_inlines.h>
#include <android/log.h>
#include <android/looper.h>
#include <android/multinetwork.h>
#include <android/native_activity.h>
// #include <android/native_window_aidl.h>
#include <android/native_window.h>
#include <android/native_window_jni.h>
// Not available in nightly NDK CI builds
// #include <android/ndk-version.h>
#include <android/NeuralNetworks.h>
#include <android/NeuralNetworksTypes.h>
#include <android/obb.h>
#include <android/performance_hint.h>
#include <android/permission_manager.h>
// #include <android/persistable_bundle_aidl.h>
// #include <android/persistable_bundle.h>
#include <android/rect.h>
#include <android/sensor.h>
#include <android/set_abort_message.h>
#include <android/sharedmem.h>
#include <android/sharedmem_jni.h>
#include <android/storage_manager.h>
// #include <android/surface_control.h>
// #include <android/surface_control_jni.h>
#include <android/surface_texture.h>
#include <android/surface_texture_jni.h>
#include <android/sync.h>
#include <android/system_fonts.h>
// #include <android/thermal.h>
#include <android/trace.h>
#include <android/versioning.h>
#include <android/window.h>
#include <aaudio/AAudio.h>
#include <amidi/AMidi.h>
#include <camera/NdkCameraCaptureSession.h>
#include <camera/NdkCameraDevice.h>
#include <camera/NdkCameraError.h>
#include <camera/NdkCameraManager.h>
#include <camera/NdkCameraMetadata.h>
#include <camera/NdkCameraMetadataTags.h>
#include <camera/NdkCameraWindowType.h>
#include <camera/NdkCaptureRequest.h>
#include <media/NdkImage.h>
#include <media/NdkImageReader.h>
#include <media/NdkMediaCodec.h>
#include <media/NdkMediaCrypto.h>
#include <media/NdkMediaDataSource.h>
#include <media/NdkMediaDrm.h>
#include <media/NdkMediaError.h>
#include <media/NdkMediaExtractor.h>
#include <media/NdkMediaFormat.h>
#include <media/NdkMediaMuxer.h>