nixpkgs/pkgs/development/libraries/botan/generic.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
1.7 KiB
Nix
Raw Normal View History

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