2014-10-31 18:31:19 +01:00
|
|
|
{ stdenv, fetchurl, python, bzip2, zlib, gmp, openssl, boost
|
|
|
|
# Passed by version specific builders
|
|
|
|
, baseVersion, revision, sha256
|
2015-03-08 19:55:17 +01:00
|
|
|
, extraConfigureFlags ? ""
|
2016-06-19 10:18:30 +02:00
|
|
|
, postPatch ? null
|
2017-04-09 06:49:55 +02:00
|
|
|
, darwin
|
2014-10-31 18:31:19 +01:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "botan-${version}";
|
|
|
|
version = "${baseVersion}.${revision}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2015-01-06 16:47:02 +01:00
|
|
|
name = "Botan-${version}.tgz";
|
2015-03-17 09:02:44 +01:00
|
|
|
urls = [
|
|
|
|
"http://files.randombit.net/botan/v${baseVersion}/Botan-${version}.tgz"
|
|
|
|
"http://botan.randombit.net/releases/Botan-${version}.tgz"
|
|
|
|
];
|
2014-10-31 18:31:19 +01:00
|
|
|
inherit sha256;
|
|
|
|
};
|
2016-06-19 10:18:30 +02:00
|
|
|
inherit postPatch;
|
2014-10-31 18:31:19 +01:00
|
|
|
|
2017-04-09 06:49:55 +02:00
|
|
|
buildInputs = [ python bzip2 zlib gmp openssl boost ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
|
2014-10-31 18:31:19 +01:00
|
|
|
|
|
|
|
configurePhase = ''
|
2015-05-15 00:55:04 +02: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 18:31:19 +01:00
|
|
|
'';
|
|
|
|
|
2014-12-17 19:11:30 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-07-09 11:48:39 +02:00
|
|
|
preInstall = ''
|
|
|
|
if [ -d src/scripts ]; then
|
|
|
|
patchShebangs src/scripts
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2014-10-31 18:31:19 +01:00
|
|
|
postInstall = ''
|
|
|
|
cd "$out"/lib/pkgconfig
|
|
|
|
ln -s botan-*.pc botan.pc || true
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2015-01-06 16:47:02 +01:00
|
|
|
inherit version;
|
2014-10-31 18:31:19 +01:00
|
|
|
description = "Cryptographic algorithms library";
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
2017-06-11 03:41:47 +02:00
|
|
|
platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
|
2014-10-31 18:31:19 +01:00
|
|
|
license = licenses.bsd2;
|
|
|
|
};
|
|
|
|
passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
|
|
|
|
}
|