From 531df46bf862735f2f3ab1a6b9ed9e16e44d2add Mon Sep 17 00:00:00 2001 From: Artur Cygan Date: Sun, 11 Sep 2022 16:40:41 +0200 Subject: [PATCH] libff: dynamic by default --- pkgs/development/libraries/libff/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libff/default.nix b/pkgs/development/libraries/libff/default.nix index 35b7a33cc38f..b759f722b6ef 100644 --- a/pkgs/development/libraries/libff/default.nix +++ b/pkgs/development/libraries/libff/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config }: +{ lib, stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config +, enableStatic ? stdenv.hostPlatform.isStatic }: stdenv.mkDerivation rec { pname = "libff"; @@ -15,9 +16,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DWITH_PROCPS=Off" ] ++ lib.optional stdenv.isAarch64 [ "-DCURVE=ALT_BN128" "-DUSE_ASM=OFF" ]; - # 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 = lib.optionalString (!enableStatic) '' substituteInPlace libff/CMakeLists.txt --replace "STATIC" "SHARED" '';