flake.nix: add android cross compiled shared library package
Build and test / check (push) Successful in 43s
Build and test / test (push) Successful in 55s
Build and test / build-static-library (push) Successful in 56s
Build and test / build-dynamic-library (push) Successful in 1m22s

This commit is contained in:
2026-05-11 09:18:55 +09:00
parent 2fc07184e9
commit 2cf5124f1d
3 changed files with 43 additions and 6 deletions
Generated
+2 -4
View File
@@ -190,8 +190,7 @@ dependencies = [
[[package]]
name = "sqlite3_ext"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0758470d3ad4cbd0b7e9db9963f4d1e391bbfc3aa20a9b99e9ffd6a48ea5e4a"
source = "git+https://github.com/h7x4/sqlite3_ext?branch=aarch64-cross-compilation-fixes#47bbb3799d34b5fefb635a7e00320398594aa61d"
dependencies = [
"bitflags 1.3.2",
"fallible-iterator",
@@ -209,8 +208,7 @@ dependencies = [
[[package]]
name = "sqlite3_ext_macro"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6ffb10e1a709864af4e8f6f08e23aae0eaebb81be9e3ae77e6052b6781c469d"
source = "git+https://github.com/h7x4/sqlite3_ext?branch=aarch64-cross-compilation-fixes#47bbb3799d34b5fefb635a7e00320398594aa61d"
dependencies = [
"convert_case",
"proc-macro2",
+2 -1
View File
@@ -7,7 +7,8 @@ edition = "2024"
crate-type = [ "cdylib" ]
[dependencies]
sqlite3_ext = { version = "0.2.0" }
# sqlite3_ext = { version = "0.2.0" }
sqlite3_ext = { git = "https://github.com/h7x4/sqlite3_ext", branch = "aarch64-cross-compilation-fixes" }
[features]
default = [ ]
+39 -1
View File
@@ -66,6 +66,29 @@
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in forAllSystems (system: pkgs: _: let
craneLib = (crane.mkLib pkgs).overrideToolchain (p: p.rust-bin.stable.latest.default);
androidPkgs = import nixpkgs {
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"aarch64-unknown-linux-android-ndk-toolchain"
"aarch64-unknown-linux-android-ndk-toolchain-wrapper"
"android-sdk-ndk"
"android-sdk-platform-tools"
"ndk"
"platform-tools"
];
localSystem = system;
crossSystem = lib.systems.examples.aarch64-android-prebuilt;
overlays = [
(import rust-overlay)
];
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"sqlite3_ext-0.2.0" = "sha256-DdLEHzheF/OPp4/qMuRSvtw+K6SeFU2+AHdQRu6z1lY=";
};
};
in {
default = self.packages.${system}.tamerye-shared-lib-crane;
@@ -74,7 +97,7 @@
version = cargoToml.package.version;
inherit src;
cargoLock.lockFile = ./Cargo.lock;
inherit cargoLock;
strictDeps = true;
doCheck = false;
@@ -84,6 +107,21 @@
];
};
tamerye-shared-lib-android = androidPkgs.rustPlatform.buildRustPackage {
pname = "tamerye-shared-lib-android";
version = cargoToml.package.version;
inherit src;
inherit cargoLock;
strictDeps = true;
doCheck = false;
nativeBuildInputs = with androidPkgs; [
rustfmt
];
};
tamerye-shared-lib-crane = craneLib.buildPackage {
pname = "tamerye-shared-lib";
version = cargoToml.package.version;