Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
static-openssl = (final.openssl.override { static = true; });
static-zlib = final.zlib.override { shared = false; };
static-pcre = final.pcre.override { shared = false; };
static-libblst = final.libblst.overrideDerivation (old: {
configureFlags = old.configureFlags ++ [ "--enable-static" "--disable-shared" ];
Copy link
Contributor

@yvan-sraka yvan-sraka Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hamishmack IIRC, you encountered a similar issue: even when we explicitly tell Cabal to statically link libblst, it links it dynamically if pkgconfig also declares a dynamic library... So, we override the buildPhase and postFixup to prevent the generation of the .dylib file, and then Cabal behaves as expected... This seems to occur only on macOS? Is there a related Cabal issue already opened?

buildPhase = ''
runHook preBuild
./build.sh
runHook postBuild
'';
postFixup = "";
});
});
# the haskell inline-r package depends on internals of the R
# project that have been hidden in R 4.2+. See
Expand Down
14 changes: 7 additions & 7 deletions static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ let tool-version-map = import ./tool-map.nix;
--ghc-option=-L${lib.getLib static-gmp}/lib \
--ghc-option=-L${lib.getLib static-libsodium-vrf}/lib \
--ghc-option=-L${lib.getLib static-secp256k1}/lib \
--ghc-option=-L${lib.getLib static-libblst}/lib \
--ghc-option=-L${lib.getLib static-openssl}/lib
;;
clean|unpack)
Expand Down Expand Up @@ -105,15 +106,14 @@ pkgs.mkShell (rec {
# it _should_ probably call out to a g++ or clang++ but doesn't.
stdenv.cc.cc.lib
]) ++ map lib.getDev ([
static-gmp

zlib
pcre
openssl
static-gmp
static-openssl
static-zlib
] ++ lib.optionals withIOG [
libblst
libsodium-vrf
secp256k1
static-libblst
static-libsodium-vrf
static-secp256k1
#R_4_1_3 # for plutus
postgresql # for db-sync
icu # for cardano-cli
Expand Down