Merge remote-tracking branch 'origin/master' into fix-cross-build-and-update-deps

This commit is contained in:
vinhtc27
2025-09-17 20:02:00 +07:00
4 changed files with 2503 additions and 8 deletions

1
.gitignore vendored
View File

@@ -6,7 +6,6 @@ tmp/
# Generated by Cargo will have compiled files and executables
/target
Cargo.lock
# Generated by rln-cli
rln-cli/database

2493
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,7 @@
buildPackage = pkgs.callPackage ./nix/default.nix;
buildRln = (buildPackage { src = self; project = "rln"; }).override;
in rec {
rln = buildRln
rln = buildRln { };
rln-linux-arm64 = buildRln {
target-platform = "aarch64-multiplatform";

View File

@@ -6,6 +6,7 @@
release ? true,
target-platform ? null,
rust-target ? null,
features ? null,
}:
let
@@ -29,10 +30,12 @@ in rustPlatform.buildRustPackage {
src = builtins.path { path = src; name = "zerokit"; };
cargoLock = {
lockFile = ../Cargo.lock;
lockFile = src + "/Cargo.lock";
allowBuiltinFetchGit = true;
};
nativeBuildInputs = [ pkgs.rust-cbindgen ];
doCheck = false;
CARGO_HOME = "/tmp";
@@ -46,11 +49,11 @@ in rustPlatform.buildRustPackage {
'';
installPhase = ''
mkdir -p $out/
for file in $(find target -name 'librln.*' | grep -v deps/); do
mkdir -p $out/$(dirname $file)
cp -r $file $out/$file
done
set -eu
mkdir -p $out/lib
find target -type f -name 'librln.*' -not -path '*/deps/*' -exec cp -v '{}' "$out/lib/" \;
mkdir -p $out/include
cbindgen ${src}/rln -l c > "$out/include/rln.h"
'';