Skip to content

Commit

Permalink
libff: default to shared for both platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
d-xo committed Jul 2, 2021
1 parent c729a52 commit ece7d9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ in self-hs: super-hs:
"--enable-executable-static"
"--extra-lib-dirs=${pkgs.gmp.override { withStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.glibc.static}/lib"
"--extra-lib-dirs=${pkgs.libff}/lib"
"--extra-lib-dirs=${pkgs.libff.override { enableStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.ncurses.override {enableStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.zlib.static}/lib"
"--extra-lib-dirs=${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib"
Expand Down
6 changes: 3 additions & 3 deletions nix/libff.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config }:
{ lib, stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config, enableStatic ? false }:

stdenv.mkDerivation rec {
pname = "libff";
Expand All @@ -16,9 +16,9 @@ stdenv.mkDerivation rec {

# CMake is hardcoded to always build static library which causes linker
# failure for Haskell applications depending on haskellPackages.hevm on macOS.
postPatch = lib.optionalString stdenv.isDarwin ''
postPatch = if (!enableStatic) then ''
substituteInPlace libff/CMakeLists.txt --replace "STATIC" "SHARED"
'';
'' else "";

nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ boost gmp openssl ];
Expand Down

0 comments on commit ece7d9a

Please sign in to comment.