diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-02-22 10:43:06 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-03-11 16:17:56 +0000 |
commit | ca1aada113c0ebda1ab8667199f6453f8e01c4fc (patch) | |
tree | 55e402280096f62eb0bc8bcad5ce6050c5a0aec7 /nixpkgs/pkgs/development/libraries/crypto++ | |
parent | e4df5a52a6a6531f32626f57205356a773ac2975 (diff) | |
parent | 93883402a445ad467320925a0a5dbe43a949f25b (diff) | |
download | nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.gz nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.bz2 nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.lz nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.xz nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.zst nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.zip |
Merge commit '93883402a445ad467320925a0a5dbe43a949f25b'
Conflicts: nixpkgs/nixos/modules/programs/ssh.nix nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix nixpkgs/pkgs/data/fonts/noto-fonts/default.nix nixpkgs/pkgs/development/go-modules/generic/default.nix nixpkgs/pkgs/development/interpreters/ruby/default.nix nixpkgs/pkgs/development/libraries/mesa/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/crypto++')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/crypto++/default.nix | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/nixpkgs/pkgs/development/libraries/crypto++/default.nix b/nixpkgs/pkgs/development/libraries/crypto++/default.nix index bedf75e75ca4..a31a4472e1c4 100644 --- a/nixpkgs/pkgs/development/libraries/crypto++/default.nix +++ b/nixpkgs/pkgs/development/libraries/crypto++/default.nix @@ -1,6 +1,12 @@ -{ lib, stdenv, fetchFromGitHub +{ lib +, stdenv +, fetchFromGitHub , enableStatic ? stdenv.hostPlatform.isStatic , enableShared ? !enableStatic +# Multi-threading with OpenMP is disabled by default +# more info on https://www.cryptopp.com/wiki/OpenMP +, withOpenMP ? false +, llvmPackages }: stdenv.mkDerivation rec { @@ -19,36 +25,45 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace GNUmakefile \ - --replace "AR = libtool" "AR = ar" \ + --replace "AR = /usr/bin/libtool" "AR = ar" \ --replace "ARFLAGS = -static -o" "ARFLAGS = -cru" ''; + buildInputs = lib.optionals (stdenv.cc.isClang && withOpenMP) [ llvmPackages.openmp ]; + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + buildFlags = lib.optional enableStatic "static" ++ lib.optional enableShared "shared" ++ [ "libcryptopp.pc" ]; + enableParallelBuilding = true; hardeningDisable = [ "fortify" ]; + CXXFLAGS = lib.optionals (withOpenMP) [ "-fopenmp" ]; doCheck = true; # always built for checks but install static lib only when necessary - preInstall = lib.optionalString (!enableStatic) "rm libcryptopp.a"; + preInstall = lib.optionalString (!enableStatic) "rm -f libcryptopp.a"; installTargets = [ "install-lib" ]; installFlags = [ "LDCONF=true" ]; + # TODO: remove postInstall hook with v8.7 -> https://github.com/weidai11/cryptopp/commit/230c558a postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) '' ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${lib.versions.majorMinor version} ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${lib.versions.major version} ''; - meta = { - description = "Crypto++, a free C++ class library of cryptographic schemes"; + meta = with lib; { + description = "A free C++ class library of cryptographic schemes"; homepage = "https://cryptopp.com/"; - changelog = "https://raw.githubusercontent.com/weidai11/cryptopp/CRYPTOPP_${underscoredVersion}/History.txt"; - license = with lib.licenses; [ boost publicDomain ]; - platforms = lib.platforms.all; - maintainers = with lib.maintainers; [ c0bw3b ]; + changelog = [ + "https://raw.githubusercontent.com/weidai11/cryptopp/CRYPTOPP_${underscoredVersion}/History.txt" + "https://github.com/weidai11/cryptopp/releases/tag/CRYPTOPP_${underscoredVersion}" + ]; + license = with licenses; [ boost publicDomain ]; + platforms = platforms.all; + maintainers = with maintainers; [ c0bw3b ]; }; } |