nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl, python3, bzip2, zlib, gmp, boost
2# Passed by version specific builders
3, baseVersion, revision, hash
4, sourceExtension ? "tar.xz"
5, extraConfigureFlags ? ""
6, extraPatches ? [ ]
7, badPlatforms ? [ ]
8, postPatch ? null
9, knownVulnerabilities ? [ ]
10, CoreServices ? null
11, Security ? null
12, ...
13}:
14
15stdenv.mkDerivation rec {
16 pname = "botan";
17 version = "${baseVersion}.${revision}";
18
19 outputs = [ "out" "dev" ];
20
21 src = fetchurl {
22 name = "Botan-${version}.${sourceExtension}";
23 urls = [
24 "http://files.randombit.net/botan/v${baseVersion}/Botan-${version}.${sourceExtension}"
25 "http://botan.randombit.net/releases/Botan-${version}.${sourceExtension}"
26 ];
27 inherit hash;
28 };
29 patches = extraPatches;
30 inherit postPatch;
31
32 nativeBuildInputs = [ python3 ];
33 buildInputs = [ bzip2 zlib gmp boost ]
34 ++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
35
36 configurePhase = ''
37 runHook preConfigure
38 python configure.py --prefix=$out --with-bzip2 --with-zlib ${extraConfigureFlags}${lib.optionalString stdenv.cc.isClang " --cc=clang"} ${lib.optionalString stdenv.hostPlatform.isAarch64 " --cpu=aarch64"}
39 runHook postConfigure
40 '';
41
42 enableParallelBuilding = true;
43
44 preInstall = ''
45 if [ -d src/scripts ]; then
46 patchShebangs src/scripts
47 fi
48 '';
49
50 postInstall = ''
51 cd "$out"/lib/pkgconfig
52 ln -s botan-*.pc botan.pc || true
53 '';
54
55 doCheck = true;
56
57 meta = with lib; {
58 description = "Cryptographic algorithms library";
59 mainProgram = "botan";
60 maintainers = with maintainers; [ raskin thillux ];
61 platforms = platforms.unix;
62 license = licenses.bsd2;
63 inherit badPlatforms;
64 inherit knownVulnerabilities;
65 };
66 passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
67}