2022-08-10 21:42:50 +00:00
|
|
|
{ lib, stdenv, fetchurl, python3, bzip2, zlib, gmp, boost
|
2014-10-31 17:31:19 +00:00
|
|
|
# Passed by version specific builders
|
|
|
|
, baseVersion, revision, sha256
|
2020-11-30 16:00:57 +00:00
|
|
|
, sourceExtension ? "tar.xz"
|
2015-03-08 18:55:17 +00:00
|
|
|
, extraConfigureFlags ? ""
|
2021-09-07 23:59:44 +00:00
|
|
|
, extraPatches ? [ ]
|
2023-07-19 11:10:59 +00:00
|
|
|
, badPlatforms ? [ ]
|
2016-06-19 08:18:30 +00:00
|
|
|
, postPatch ? null
|
2021-04-29 13:32:10 +00:00
|
|
|
, knownVulnerabilities ? [ ]
|
2023-07-19 11:10:59 +00:00
|
|
|
, CoreServices ? null
|
|
|
|
, Security ? null
|
2014-10-31 17:31:19 +00:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "botan";
|
2014-10-31 17:31:19 +00:00
|
|
|
version = "${baseVersion}.${revision}";
|
|
|
|
|
2023-07-09 04:02:31 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2014-10-31 17:31:19 +00:00
|
|
|
src = fetchurl {
|
2020-11-30 16:00:57 +00:00
|
|
|
name = "Botan-${version}.${sourceExtension}";
|
2015-03-17 08:02:44 +00:00
|
|
|
urls = [
|
2020-11-30 16:00:57 +00:00
|
|
|
"http://files.randombit.net/botan/v${baseVersion}/Botan-${version}.${sourceExtension}"
|
|
|
|
"http://botan.randombit.net/releases/Botan-${version}.${sourceExtension}"
|
2015-03-17 08:02:44 +00:00
|
|
|
];
|
2014-10-31 17:31:19 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
2021-09-07 23:59:44 +00:00
|
|
|
patches = extraPatches;
|
2016-06-19 08:18:30 +00:00
|
|
|
inherit postPatch;
|
2014-10-31 17:31:19 +00:00
|
|
|
|
2023-07-31 15:56:09 +00:00
|
|
|
nativeBuildInputs = [ python3 ];
|
|
|
|
buildInputs = [ bzip2 zlib gmp boost ]
|
2021-01-21 17:00:13 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
2014-10-31 17:31:19 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
2023-07-09 04:02:31 +00:00
|
|
|
runHook preConfigure
|
2023-07-31 15:56:09 +00:00
|
|
|
python configure.py --prefix=$out --with-bzip2 --with-zlib ${extraConfigureFlags}${lib.optionalString stdenv.cc.isClang " --cc=clang"} ${lib.optionalString stdenv.hostPlatform.isAarch64 " --cpu=aarch64"}
|
2023-07-09 04:02:31 +00:00
|
|
|
runHook postConfigure
|
2014-10-31 17:31:19 +00:00
|
|
|
'';
|
|
|
|
|
2014-12-17 18:11:30 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-07-09 09:48:39 +00: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
|
|
|
|
'';
|
|
|
|
|
2022-12-02 22:15:05 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2014-10-31 17:31:19 +00:00
|
|
|
description = "Cryptographic algorithms library";
|
2023-07-19 11:28:19 +00:00
|
|
|
maintainers = with maintainers; [ raskin thillux ];
|
2021-01-09 22:33:36 +00:00
|
|
|
platforms = platforms.unix;
|
2014-10-31 17:31:19 +00:00
|
|
|
license = licenses.bsd2;
|
2023-07-19 11:10:59 +00:00
|
|
|
inherit badPlatforms;
|
2021-04-29 13:32:10 +00:00
|
|
|
inherit knownVulnerabilities;
|
2014-10-31 17:31:19 +00:00
|
|
|
};
|
|
|
|
passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
|
|
|
|
}
|