mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
Merge pull request #110901 from obsidiansystems/cryptopp-static
crypto++: Fix static build and also do multiple outputs
This commit is contained in:
commit
652b2d6dba
1 changed files with 13 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, }:
|
{ lib, stdenv, fetchFromGitHub, nasm, which
|
||||||
|
, enableStatic ? stdenv.hostPlatform.isStatic
|
||||||
|
, enableShared ? !enableStatic
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "crypto++";
|
pname = "crypto++";
|
||||||
|
@ -12,6 +15,8 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "1gwn8yh1mh41hkh6sgnhb9c3ygrdazd7645msl20i0zdvcp7f5w3";
|
sha256 = "1gwn8yh1mh41hkh6sgnhb9c3ygrdazd7645msl20i0zdvcp7f5w3";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace GNUmakefile \
|
substituteInPlace GNUmakefile \
|
||||||
--replace "AR = libtool" "AR = ar" \
|
--replace "AR = libtool" "AR = ar" \
|
||||||
|
@ -19,12 +24,17 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
||||||
buildFlags = [ "shared" "libcryptopp.pc" ];
|
buildFlags =
|
||||||
|
lib.optional enableStatic "static"
|
||||||
|
++ lib.optional enableShared "shared"
|
||||||
|
++ [ "libcryptopp.pc" ];
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
doCheck = 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" ];
|
installTargets = [ "install-lib" ];
|
||||||
installFlags = [ "LDCONF=true" ];
|
installFlags = [ "LDCONF=true" ];
|
||||||
postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
||||||
|
|
Loading…
Reference in a new issue