From 59e2d1e549bfdb9770d78b30ffbcd92801a5733d Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Tue, 17 Dec 2024 07:30:26 -0800 Subject: [PATCH] subprojects: add libc Version 0.2.168 supported in: - Android - Fedora (https://bodhi.fedoraproject.org/updates/?packages=rust-libc) - Debian (https://tracker.debian.org/pkg/rust-libc) Acked-by: Aaron Ruby Reviewed-by: @LingMan Part-of: --- subprojects/libc.wrap | 6 ++++ subprojects/packagefiles/libc/meson.build | 44 +++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 subprojects/libc.wrap create mode 100644 subprojects/packagefiles/libc/meson.build diff --git a/subprojects/libc.wrap b/subprojects/libc.wrap new file mode 100644 index 00000000000..8ec44a94f04 --- /dev/null +++ b/subprojects/libc.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = libc-0.2.168 +source_url = https://crates.io/api/v1/crates/libc/0.2.168/download +source_filename = libc-0.2.168.tar.gz +source_hash = 5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d +patch_directory = libc diff --git a/subprojects/packagefiles/libc/meson.build b/subprojects/packagefiles/libc/meson.build new file mode 100644 index 00000000000..932ea81eedf --- /dev/null +++ b/subprojects/packagefiles/libc/meson.build @@ -0,0 +1,44 @@ +# Copyright © 2024 Google +# SPDX-License-Identifier: MIT + +project( + 'libc', + 'rust', + version : '0.2.168', + license : 'MIT OR Apache-2.0', +) + +libc_args = [ + '--cfg', 'feature="default"', + '--cfg', 'feature="extra_traits"', + '--cfg', 'feature="std"', + '--cfg', 'freebsd11', + '--cfg', 'freebsd11', + '--cfg', 'freebsd11', + '--cfg', 'libc_align', + '--cfg', 'libc_cfg_target_vendor', + '--cfg', 'libc_const_extern_fn', + '--cfg', 'libc_const_size_of', + '--cfg', 'libc_core_cvoid', + '--cfg', 'libc_int128', + '--cfg', 'libc_long_array', + '--cfg', 'libc_non_exhaustive', + '--cfg', 'libc_packedN', + '--cfg', 'libc_priv_mod_use', + '--cfg', 'libc_ptr_addr_of', + '--cfg', 'libc_underscore_const_names', + '--cfg', 'libc_union', +] + +lib = static_library( + 'libc', + 'src/lib.rs', + rust_abi : 'rust', + override_options : ['rust_std=2021', 'build.rust_std=2021'], + native : true, + rust_args: libc_args, +) + +dep_libc = declare_dependency( + link_with : [lib] +)