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
@@ -0,0 +1 @@
{"files":{"CHANGELOG.md":"8d7bbf0c00b8c9c1a76a66179b93dd8ef2c9ed8906d50bb5612754fa1e02b722","Cargo.toml":"3fd25ebd14f0d636d80d65bded12e4973d412bc1c14b58824c88f21afde33b4d","README.md":"16d18a45d1b4ae9b2830d0f9ac747ddb2d7af54a2821d33e3be558f71056e5fd","generate_bindings.sh":"59009baea2647af491061a98e51a93fe277682b5977d489d9a926f07768ed3d6","src/ffi_aarch64.rs":"7b4d888fe85340bf128645f7ac9ae7028e6226e099a51b76dc770e535c0fca98","src/ffi_arm.rs":"25ced6f79be397466d9a765f7e73e00e265e6c97a271867cdb4f4f7836da4fc1","src/ffi_i686.rs":"7878223458858ed7e5813e1918c68487db5febb0b4af7d3903fb0554e84f9edf","src/ffi_x86_64.rs":"220d3f87db46859f25b48a303449a436f0c048267bd576a28f6c5f1373eed577","src/lib.rs":"e228ceea092ce72cd8c6aee5d6aff0fa037b1c3d9a93f2a75d27d75b9a0e2984","wrapper.h":"357891962699e3387950ff4d4b28fb9c4c177b790e5a4a5e45a466955b9e36c0"},"package":"8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691"}
+40
View File
@@ -0,0 +1,40 @@
# Unreleased
# 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.5.0+25.2.9519653"
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"
resolver = "1"
[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 = []
sync = []
test = []
+21
View File
@@ -0,0 +1,21 @@
> **Note**
> 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 |
> cargo-apk | https://github.com/rust-mobile/cargo-apk |
[![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.
+73
View File
@@ -0,0 +1,73 @@
#!/bin/sh
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
sysroot="${ANDROID_NDK_ROOT}"/toolchains/llvm/prebuilt/${host_tag}/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
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+57
View File
@@ -0,0 +1,57 @@
//! 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 = "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" {}
+86
View File
@@ -0,0 +1,86 @@
#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>
// <android/font.h> is broken without the following typedef in C
typedef struct AFont AFont;
#include <android/font.h>
// <android/font_matcher.h> is broken without the following typedef in C
typedef struct AFontMatcher AFontMatcher;
#include <android/font_matcher.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/log.h>
#include <android/looper.h>
#include <android/multinetwork.h>
#include <android/native_activity.h>
#include <android/native_window.h>
#include <android/native_window_jni.h>
#include <android/ndk-version.h>
#include <android/NeuralNetworks.h>
#include <android/NeuralNetworksTypes.h>
#include <android/obb.h>
#include <android/permission_manager.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_texture.h>
#include <android/surface_texture_jni.h>
#include <android/sync.h>
// <android/system_fonts.h> is broken without the following typedef in C
typedef struct ASystemFontIterator ASystemFontIterator;
#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>