nixpkgs/pkgs/development/libraries/botan/generic.nix

58 lines
1.5 KiB
Nix
Raw Normal View History

2021-03-25 10:08:09 +00:00
{ lib, stdenv, fetchurl, python3, bzip2, zlib, gmp, openssl, boost
2014-10-31 17:31:19 +00:00
# Passed by version specific builders
, baseVersion, revision, sha256
, sourceExtension ? "tar.xz"
2015-03-08 18:55:17 +00:00
, extraConfigureFlags ? ""
2021-09-08 00:59:44 +01:00
, extraPatches ? [ ]
, postPatch ? null
2021-04-29 14:32:10 +01:00
, knownVulnerabilities ? [ ]
2021-01-12 00:42:13 +00:00
, CoreServices
, Security
2014-10-31 17:31:19 +00:00
, ...
}:
stdenv.mkDerivation rec {
pname = "botan";
2014-10-31 17:31:19 +00:00
version = "${baseVersion}.${revision}";
src = fetchurl {
name = "Botan-${version}.${sourceExtension}";
urls = [
"http://files.randombit.net/botan/v${baseVersion}/Botan-${version}.${sourceExtension}"
"http://botan.randombit.net/releases/Botan-${version}.${sourceExtension}"
];
2014-10-31 17:31:19 +00:00
inherit sha256;
};
2021-09-08 00:59:44 +01:00
patches = extraPatches;
inherit postPatch;
2014-10-31 17:31:19 +00:00
2021-03-25 10:08:09 +00:00
buildInputs = [ python3 bzip2 zlib gmp openssl boost ]
++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
2014-10-31 17:31:19 +00:00
configurePhase = ''
2015-05-14 23:55:04 +01:00
python configure.py --prefix=$out --with-bzip2 --with-zlib ${if openssl != null then "--with-openssl" else ""} ${extraConfigureFlags}${if stdenv.cc.isClang then " --cc=clang" else "" }
2014-10-31 17:31:19 +00:00
'';
enableParallelBuilding = true;
2015-07-09 10:48:39 +01:00
preInstall = ''
if [ -d src/scripts ]; then
patchShebangs src/scripts
fi
'';
2014-10-31 17:31:19 +00:00
postInstall = ''
cd "$out"/lib/pkgconfig
ln -s botan-*.pc botan.pc || true
'';
meta = with lib; {
2014-10-31 17:31:19 +00:00
description = "Cryptographic algorithms library";
maintainers = with maintainers; [ raskin ];
2021-01-09 22:33:36 +00:00
platforms = platforms.unix;
2014-10-31 17:31:19 +00:00
license = licenses.bsd2;
2021-04-29 14:32:10 +01:00
inherit knownVulnerabilities;
2014-10-31 17:31:19 +00:00
};
passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
}