2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, python, bzip2, zlib, gmp, openssl, boost
|
2020-04-24 23:36:52 +00:00
|
|
|
# Passed by version specific builders
|
|
|
|
, baseVersion, revision, sha256
|
2020-12-25 13:55:36 +00:00
|
|
|
, sourceExtension ? "tar.xz"
|
2020-04-24 23:36:52 +00:00
|
|
|
, extraConfigureFlags ? ""
|
|
|
|
, postPatch ? null
|
2021-01-17 00:15:33 +00:00
|
|
|
, CoreServices
|
|
|
|
, Security
|
2020-04-24 23:36:52 +00:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "botan";
|
|
|
|
version = "${baseVersion}.${revision}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2020-12-25 13:55:36 +00:00
|
|
|
name = "Botan-${version}.${sourceExtension}";
|
2020-04-24 23:36:52 +00:00
|
|
|
urls = [
|
2020-12-25 13:55:36 +00:00
|
|
|
"http://files.randombit.net/botan/v${baseVersion}/Botan-${version}.${sourceExtension}"
|
|
|
|
"http://botan.randombit.net/releases/Botan-${version}.${sourceExtension}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
inherit postPatch;
|
|
|
|
|
|
|
|
buildInputs = [ python bzip2 zlib gmp openssl boost ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
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 "" }
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
if [ -d src/scripts ]; then
|
|
|
|
patchShebangs src/scripts
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cd "$out"/lib/pkgconfig
|
|
|
|
ln -s botan-*.pc botan.pc || true
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit version;
|
|
|
|
description = "Cryptographic algorithms library";
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
};
|
|
|
|
passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
|
|
|
|
}
|