Skip to content

Commit

Permalink
Problem: fail to build in recent nixpkgs (#1031)
Browse files Browse the repository at this point in the history
Solution:
- fix the expression

Update default.nix

Signed-off-by: yihuang <[email protected]>

fix lint
  • Loading branch information
yihuang authored Feb 16, 2024
1 parent de1508e commit 04e8e09
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ buildGoApplication rec {
buildFlags = lib.optionalString coverage "-cover";
buildInputs = lib.lists.optional (rocksdb != null) rocksdb;
CGO_ENABLED = "1";
CGO_LDFLAGS =
CGO_LDFLAGS = lib.optionalString (rocksdb != null) (
if static then "-lrocksdb -pthread -lstdc++ -ldl -lzstd -lsnappy -llz4 -lbz2 -lz"
else if stdenv.hostPlatform.isWindows then "-lrocksdb-shared"
else "-lrocksdb -pthread -lstdc++ -ldl";
else "-lrocksdb -pthread -lstdc++ -ldl"
);
tags = [
"cgo"
"ledger"
Expand All @@ -69,8 +70,8 @@ buildGoApplication rec {
-X github.com/cosmos/cosmos-sdk/version.Commit=${rev}
-X github.com/cosmos/cosmos-sdk/version.BuildTags=${concatStringsSep "," tags}
'';
postFixup = lib.optionalString stdenv.isDarwin ''
${stdenv.cc.targetPrefix}install_name_tool -change "@rpath/librocksdb.8.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/chain-maind
postFixup = lib.optionalString (stdenv.isDarwin && rocksdb != null) ''
${stdenv.cc.bintools.targetPrefix}install_name_tool -change "@rpath/librocksdb.8.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/chain-maind
'';
passthru = {
# update script use the same golang version as the project
Expand Down

0 comments on commit 04e8e09

Please sign in to comment.