summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2021-01-26 21:37:26 -0500
committerGitHub <noreply@github.com>2021-01-26 21:37:26 -0500
commit652b2d6dba246abd696bc6f2cb8b30032ed4fb56 (patch)
tree3f09b7c80dc80f21ea0e10d7835a01ce24f95297 /pkgs
parentebc22e9921fbcc66ce4c4711e79ba5eb1cc01495 (diff)
parent60dea25dae798db0922e42e15dccc08fc3203499 (diff)
Merge pull request #110901 from obsidiansystems/cryptopp-static
crypto++: Fix static build and also do multiple outputs
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/crypto++/default.nix16
1 files changed, 13 insertions, 3 deletions
diff --git a/pkgs/development/libraries/crypto++/default.nix b/pkgs/development/libraries/crypto++/default.nix
index b2232907db7f..0402af92b3b3 100644
--- a/pkgs/development/libraries/crypto++/default.nix
+++ b/pkgs/development/libraries/crypto++/default.nix
@@ -1,4 +1,7 @@
-{ lib, stdenv, fetchFromGitHub, }:
+{ lib, stdenv, fetchFromGitHub, nasm, which
+, enableStatic ? stdenv.hostPlatform.isStatic
+, enableShared ? !enableStatic
+}:
stdenv.mkDerivation rec {
pname = "crypto++";
@@ -12,6 +15,8 @@ stdenv.mkDerivation rec {
sha256 = "1gwn8yh1mh41hkh6sgnhb9c3ygrdazd7645msl20i0zdvcp7f5w3";
};
+ outputs = [ "out" "dev" ];
+
postPatch = ''
substituteInPlace GNUmakefile \
--replace "AR = libtool" "AR = ar" \
@@ -19,12 +24,17 @@ stdenv.mkDerivation rec {
'';
makeFlags = [ "PREFIX=${placeholder "out"}" ];
- buildFlags = [ "shared" "libcryptopp.pc" ];
+ buildFlags =
+ lib.optional enableStatic "static"
+ ++ lib.optional enableShared "shared"
+ ++ [ "libcryptopp.pc" ];
enableParallelBuilding = true;
doCheck = true;
- preInstall = "rm libcryptopp.a"; # built for checks but we don't install static lib into the nix store
+ # built for checks but we don't install static lib into the nix store
+ preInstall = lib.optionalString (!enableStatic) "rm libcryptopp.a";
+
installTargets = [ "install-lib" ];
installFlags = [ "LDCONF=true" ];
postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''