2022-08-12 12:06:08 +00:00
|
|
|
{ lib, stdenv, fetchurl, python3, bzip2, zlib, gmp, boost
|
2020-04-24 23:36:52 +00:00
|
|
|
# Passed by version specific builders
|
2024-01-02 11:29:13 +00:00
|
|
|
, baseVersion, revision, hash
|
2020-12-25 13:55:36 +00:00
|
|
|
, sourceExtension ? "tar.xz"
|
2020-04-24 23:36:52 +00:00
|
|
|
, extraConfigureFlags ? ""
|
2021-09-18 10:52:07 +00:00
|
|
|
, extraPatches ? [ ]
|
2023-08-04 22:07:22 +00:00
|
|
|
, badPlatforms ? [ ]
|
2020-04-24 23:36:52 +00:00
|
|
|
, postPatch ? null
|
2021-05-03 20:48:10 +00:00
|
|
|
, knownVulnerabilities ? [ ]
|
2023-08-04 22:07:22 +00:00
|
|
|
, CoreServices ? null
|
|
|
|
, Security ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "botan";
|
|
|
|
version = "${baseVersion}.${revision}";
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
inherit hash;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-09-18 10:52:07 +00:00
|
|
|
patches = extraPatches;
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit postPatch;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = [ python3 ];
|
|
|
|
buildInputs = [ bzip2 zlib gmp boost ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
runHook preConfigure
|
2023-08-04 22:07:22 +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-15 17:15:38 +00:00
|
|
|
runHook postConfigure
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
if [ -d src/scripts ]; then
|
|
|
|
patchShebangs src/scripts
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cd "$out"/lib/pkgconfig
|
|
|
|
ln -s botan-*.pc botan.pc || true
|
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Cryptographic algorithms library";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "botan";
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ raskin thillux ];
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
2023-08-04 22:07:22 +00:00
|
|
|
inherit badPlatforms;
|
2021-05-03 20:48:10 +00:00
|
|
|
inherit knownVulnerabilities;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
|
|
|
|
}
|