This commit is contained in:
osmaczko 2026-02-27 19:42:40 +01:00
parent 92dd2c8093
commit f9331976d4
No known key found for this signature in database
GPG Key ID: 6A385380FD275B44
7 changed files with 6514 additions and 11 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@
*.dSYM *.dSYM
nimble.develop nimble.develop
nimble.paths nimble.paths
/rust-bundle
/nimcache /nimcache

View File

@ -75,7 +75,7 @@ NIM_PARAMS := $(NIM_PARAMS) -d:git_version=\"$(GIT_VERSION)\"
## Dependencies ## ## Dependencies ##
################## ##################
RUST_BUNDLE_LIB := rust-bundle/target/release/lib_rust_bundle.a RUST_BUNDLE_LIB := rust-bundle/target/release/librust_bundle.a
# libchat and rln each embed Rust std when built as staticlibs; linking both # libchat and rln each embed Rust std when built as staticlibs; linking both
# causes duplicate-symbol errors. rust-bundle/ links them as rlibs so std # causes duplicate-symbol errors. rust-bundle/ links them as rlibs so std

View File

@ -14,9 +14,9 @@ in rPlatform.buildRustPackage {
cargoLock = { cargoLock = {
lockFile = src + "/rust-bundle/Cargo.lock"; lockFile = src + "/rust-bundle/Cargo.lock";
# Add outputHashes here for any git/non-registry deps that appear in outputHashes = {
# rust-bundle/Cargo.lock (run `nix build` once; it will report missing hashes). "chat-proto-0.1.0" = "sha256-aCl80VOIkd/GK3gnmRuFoSAvPBfeE/FKCaNlLt5AbUU=";
outputHashes = {}; };
}; };
nativeBuildInputs = [ perl pkg-config cmake ]; nativeBuildInputs = [ perl pkg-config cmake ];
@ -27,8 +27,8 @@ in rPlatform.buildRustPackage {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
mkdir -p $out/lib mkdir -p $out/lib
cp rust-bundle/target/*/release/lib_rust_bundle.a $out/lib/ 2>/dev/null || true find . -name "librust_bundle.a" -path "*/release/*" -exec cp {} $out/lib/ \;
cp rust-bundle/target/release/lib_rust_bundle.a $out/lib/ 2>/dev/null || true test -f $out/lib/librust_bundle.a
runHook postInstall runHook postInstall
''; '';
} }

View File

@ -19,7 +19,7 @@ in stdenv.mkDerivation {
inherit src; inherit src;
NIMFLAGS = lib.concatStringsSep " " [ NIMFLAGS = lib.concatStringsSep " " [
"--passL:${rustBundleDrv}/lib/lib_rust_bundle.a" "--passL:${rustBundleDrv}/lib/librust_bundle.a"
"--passL:-lm" "--passL:-lm"
"-d:miniupnpcUseSystemLibs" "-d:miniupnpcUseSystemLibs"
"-d:libnatpmpUseSystemLibs" "-d:libnatpmpUseSystemLibs"

6505
rust-bundle/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,6 @@ edition = "2021"
name = "rust_bundle" name = "rust_bundle"
crate-type = ["staticlib"] crate-type = ["staticlib"]
[profile.release]
panic = "abort"
[dependencies] [dependencies]
libchat = { path = "../vendor/libchat/conversations" } libchat = { path = "../vendor/libchat/conversations" }
rln = { path = "../vendor/nwaku/vendor/zerokit/rln", features = ["arkzkey"] } rln = { path = "../vendor/nwaku/vendor/zerokit/rln", features = ["arkzkey"] }

2
vendor/libchat vendored

@ -1 +1 @@
Subproject commit 681c17ccaecd7a171c46cc96ff61d1d3db7fd7a9 Subproject commit a058472953294ac53323779da3b43d56d7d95888