Skip to content

Commit a50aaab

Browse files
chore: retrieve libsds.so and libsds.h from nim-sds flake
1 parent e9b8005 commit a50aaab

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
nixpkgs.url = "github:NixOS/nixpkgs/0ef228213045d2cdb5a169a95d63ded38670b293";
1919
# We cannot do follows since the nim-unwrapped-2_0 doesn't exist in this nixpkgs version above
2020
nwaku.url = "git+https://github.com/waku-org/nwaku?submodules=1&rev=7e5041d5e17d717f77fb74ffd876b987a0c6bf5d";
21-
nim-sds.url = "git+https://github.com/waku-org/nim-sds?submodules=1&rev=b74622da64826415dd87186f5c3caf1f6cc29646";
21+
nim-sds.url = "git+https://github.com/waku-org/nim-sds?submodules=1&rev=972d7862fca9c3a114e3840cc44b863cb7ca90c2";
2222
};
2323

2424
outputs = { self, nixpkgs, nwaku, nim-sds }:
@@ -43,6 +43,7 @@
4343
# Make nwaku available
4444
nwaku = nwaku.packages.${system};
4545
nim-sds-src = nim-sds.sourceInfo.outPath;
46+
lib-sds-pkg = nim-sds.packages.${system}.libsds;
4647
})
4748
];
4849
}

nix/pkgs/status-go/library/default.nix

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,14 @@ in pkgs.buildGoModule {
3939
# FIXME: Remove this when go 1.23 or later versions fix this madness.
4040
allowGoReference = true;
4141

42-
# TODO: This is wrong, we shouldn't be building `nim-sds` as part of this derivtion.
43-
# Instead we need to fix flake.nix in nim-sds and pull already built lib from that.
4442
NIX_DEBUG = 1;
4543
patchPhase = ''
46-
pushd vendor/github.com/waku-org/sds-go-bindings
47-
mkdir -p third_party
48-
cp -r ${pkgs.nim-sds-src} third_party/nim-sds
49-
chmod 775 -R third_party/nim-sds
50-
popd
44+
mkdir -p vendor/github.com/waku-org/sds-go-bindings/third_party/nim-sds/build
45+
mkdir -p vendor/github.com/waku-org/sds-go-bindings/third_party/nim-sds/library
46+
chmod 775 -R vendor/github.com/waku-org/sds-go-bindings/third_party/
47+
48+
cp ${pkgs.lib-sds-pkg}/include/*h vendor/github.com/waku-org/sds-go-bindings/third_party/nim-sds/library
49+
cp ${pkgs.lib-sds-pkg}/lib/* vendor/github.com/waku-org/sds-go-bindings/third_party/nim-sds/build/
5150
'';
5251

5352
preBuild = ''
@@ -75,6 +74,10 @@ in pkgs.buildGoModule {
7574
--replace-warn "/vendor/Nim/bin/nim" "${pkgs.nim}/bin/nim"
7675
fi
7776
77+
# Avoid building nim-sds because the lib and header comes from nim-sds flake in patchPhase
78+
substituteInPlace Makefile \
79+
--replace-warn "cd vendor/github.com/waku-org/sds-go-bindings/sds/ && make build" "echo 'Skipping nim-sds build...'"
80+
7881
runHook preBuild
7982
go build \
8083
-buildmode='c-archive' \

0 commit comments

Comments
 (0)