2021-03-25 13:08:09 +03:00
|
|
|
{ lib, stdenv, fetchurl, python3, bzip2, zlib, gmp, openssl, boost
|
2014-10-31 20:31:19 +03:00
|
|
|
# Passed by version specific builders
|
|
|
|
, baseVersion, revision, sha256
|
2020-11-30 19:00:57 +03:00
|
|
|
, sourceExtension ? "tar.xz"
|
2015-03-08 21:55:17 +03:00
|
|
|
, extraConfigureFlags ? ""
|
2016-06-19 11:18:30 +03:00
|
|
|
, postPatch ? null
|
2021-04-29 16:32:10 +03:00
|
|
|
, knownVulnerabilities ? [ ]
|
2021-01-12 03:42:13 +03:00
|
|
|
, CoreServices
|
|
|
|
, Security
|
2014-10-31 20:31:19 +03:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "botan";
|
2014-10-31 20:31:19 +03:00
|
|
|
version = "${baseVersion}.${revision}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2020-11-30 19:00:57 +03:00
|
|
|
name = "Botan-${version}.${sourceExtension}";
|
2015-03-17 11:02:44 +03:00
|
|
|
urls = [
|
2020-11-30 19:00:57 +03:00
|
|
|
"http://files.randombit.net/botan/v${baseVersion}/Botan-${version}.${sourceExtension}"
|
|
|
|
"http://botan.randombit.net/releases/Botan-${version}.${sourceExtension}"
|
2015-03-17 11:02:44 +03:00
|
|
|
];
|
2014-10-31 20:31:19 +03:00
|
|
|
inherit sha256;
|
|
|
|
};
|
2016-06-19 11:18:30 +03:00
|
|
|
inherit postPatch;
|
2014-10-31 20:31:19 +03:00
|
|
|
|
2021-03-25 13:08:09 +03:00
|
|
|
buildInputs = [ python3 bzip2 zlib gmp openssl boost ]
|
2021-01-21 20:00:13 +03:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
2014-10-31 20:31:19 +03:00
|
|
|
|
|
|
|
configurePhase = ''
|
2015-05-15 01:55:04 +03: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 20:31:19 +03:00
|
|
|
'';
|
|
|
|
|
2014-12-17 21:11:30 +03:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-07-09 12:48:39 +03:00
|
|
|
preInstall = ''
|
|
|
|
if [ -d src/scripts ]; then
|
|
|
|
patchShebangs src/scripts
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2014-10-31 20:31:19 +03:00
|
|
|
postInstall = ''
|
|
|
|
cd "$out"/lib/pkgconfig
|
|
|
|
ln -s botan-*.pc botan.pc || true
|
|
|
|
'';
|
|
|
|
|
2021-01-21 20:00:13 +03:00
|
|
|
meta = with lib; {
|
2015-01-06 18:47:02 +03:00
|
|
|
inherit version;
|
2014-10-31 20:31:19 +03:00
|
|
|
description = "Cryptographic algorithms library";
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
2021-01-10 01:33:36 +03:00
|
|
|
platforms = platforms.unix;
|
2014-10-31 20:31:19 +03:00
|
|
|
license = licenses.bsd2;
|
2021-04-29 16:32:10 +03:00
|
|
|
inherit knownVulnerabilities;
|
2014-10-31 20:31:19 +03:00
|
|
|
};
|
|
|
|
passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
|
|
|
|
}
|