Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Feb 16, 2024
1 parent 2c174cd commit 30a4389
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 @@ -43,13 +43,14 @@ buildGoApplication rec {
subPackages = [ "cmd/cronosd" ];
buildFlags = lib.optionalString coverage "-cover";
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"
);

postFixup = lib.optionalString stdenv.isDarwin ''
${stdenv.cc.targetPrefix}install_name_tool -change "@rpath/librocksdb.8.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/cronosd
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/cronosd
'';

doCheck = false;
Expand Down

0 comments on commit 30a4389

Please sign in to comment.