mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
Allow magiskboot to be built directly on host platforms (macOS and Linux) using Cargo: - Add a binary target to boot module with a no_main entry point that directly reuses the C main CLI implementation. - Compile native C and C++ sources (base, boot, cxx, and lz4) via cc in base and boot build.rs when target_os is not Android. - Platform gate Linux-specific functionality (SELinux xattrs, mount, namespaces) in base on Linux and Android, and provide macOS fallback for xsendfile. - Move MountInfo and mount parsing from files to mount module. - Scope Android-specific LTO rustflags in config.toml to Android targets. - Ensure build.py compiles Rust modules as static libraries (--lib). Assisted-by: Gemini 3.8 Flash
73 lines
1.6 KiB
TOML
73 lines
1.6 KiB
TOML
cargo-features = ["panic-immediate-abort"]
|
|
|
|
[workspace]
|
|
exclude = ["external"]
|
|
members = ["base", "base/derive", "boot", "core", "init", "sepolicy"]
|
|
resolver = "2"
|
|
|
|
[workspace.package]
|
|
version = "0.0.0"
|
|
edition = "2024"
|
|
|
|
[workspace.dependencies]
|
|
cc = "1.0"
|
|
base = { path = "base" }
|
|
derive = { path = "base/derive" }
|
|
magiskpolicy = { path = "sepolicy" }
|
|
cxx = { path = "external/cxx-rs" }
|
|
cxx-gen = { path = "external/cxx-rs/gen/lib" }
|
|
libc = "0.2.189"
|
|
cfg-if = "1.0.5"
|
|
num-traits = "0.2.19"
|
|
num-derive = "0.5.1"
|
|
thiserror = "2.0.20"
|
|
byteorder = "1.5.0"
|
|
size = "0.5.0"
|
|
bytemuck = "1.25.2"
|
|
fdt = "0.2.0-alpha2"
|
|
const_format = "0.2.36"
|
|
bit-set = "0.11.1"
|
|
syn = "3.0.6"
|
|
quote = "1.0.47"
|
|
proc-macro2 = "1.0.107"
|
|
pb-rs = { version = "0.10.0", default-features = false }
|
|
quick-protobuf = "0.8.1"
|
|
flate2 = { version = "1.1.10", default-features = false }
|
|
bzip2 = "0.6.1"
|
|
lz4 = "1.28.1"
|
|
lzma-rust2 = { version = "0.21.0", default-features = false }
|
|
nix = "0.31.3"
|
|
bitflags = "2.13.2"
|
|
|
|
# Rust crypto crates are tied together
|
|
sha1 = "0.11.0"
|
|
sha2 = "0.11.0"
|
|
digest = "0.11.3"
|
|
p256 = "0.14.0"
|
|
p384 = "0.14.0"
|
|
p521 = "0.14.0"
|
|
rsa = "0.10.0-rc.18"
|
|
x509-cert = "0.3.0"
|
|
der = "0.8.2"
|
|
|
|
[patch.crates-io]
|
|
pb-rs = { git = "https://github.com/topjohnwu/quick-protobuf.git" }
|
|
quick-protobuf = { git = "https://github.com/topjohnwu/quick-protobuf.git" }
|
|
lz4-sys = { path = "external/lz4-sys" }
|
|
|
|
[workspace.lints.clippy]
|
|
unwrap_used = "deny"
|
|
|
|
[profile.dev]
|
|
opt-level = "z"
|
|
lto = "thin"
|
|
panic = "immediate-abort"
|
|
debug = "none"
|
|
|
|
[profile.release]
|
|
opt-level = "z"
|
|
lto = "fat"
|
|
codegen-units = 1
|
|
panic = "immediate-abort"
|
|
strip = true
|