about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/botan
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/botan')
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/2.0.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/3.0.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/generic.nix67
3 files changed, 81 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/botan/2.0.nix b/nixpkgs/pkgs/development/libraries/botan/2.0.nix
new file mode 100644
index 000000000000..53b4e167a7d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/botan/2.0.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  baseVersion = "2.19";
+  revision = "3";
+  hash = "sha256-2uBH85nFpH8IfbXT2dno8RrkmF0UySjXHaGv+AGALVU=";
+})
diff --git a/nixpkgs/pkgs/development/libraries/botan/3.0.nix b/nixpkgs/pkgs/development/libraries/botan/3.0.nix
new file mode 100644
index 000000000000..4c0eae63493a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/botan/3.0.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  baseVersion = "3.2";
+  revision = "0";
+  hash = "sha256-BJyEeDX89u86niBrM94F3TiZnDJeJHSCdypVmNnl7OM=";
+})
diff --git a/nixpkgs/pkgs/development/libraries/botan/generic.nix b/nixpkgs/pkgs/development/libraries/botan/generic.nix
new file mode 100644
index 000000000000..a2acb8183283
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/botan/generic.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchurl, python3, bzip2, zlib, gmp, boost
+# Passed by version specific builders
+, baseVersion, revision, hash
+, sourceExtension ? "tar.xz"
+, extraConfigureFlags ? ""
+, extraPatches ? [ ]
+, badPlatforms ? [ ]
+, postPatch ? null
+, knownVulnerabilities ? [ ]
+, CoreServices ? null
+, Security ? null
+, ...
+}:
+
+stdenv.mkDerivation rec {
+  pname = "botan";
+  version = "${baseVersion}.${revision}";
+
+  outputs = [ "out" "dev" ];
+
+  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}"
+    ];
+    inherit hash;
+  };
+  patches = extraPatches;
+  inherit postPatch;
+
+  nativeBuildInputs = [ python3 ];
+  buildInputs = [ bzip2 zlib gmp boost ]
+    ++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
+
+  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
+  '';
+
+  enableParallelBuilding = true;
+
+  preInstall = ''
+    if [ -d src/scripts ]; then
+      patchShebangs src/scripts
+    fi
+  '';
+
+  postInstall = ''
+    cd "$out"/lib/pkgconfig
+    ln -s botan-*.pc botan.pc || true
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Cryptographic algorithms library";
+    mainProgram = "botan";
+    maintainers = with maintainers; [ raskin thillux ];
+    platforms = platforms.unix;
+    license = licenses.bsd2;
+    inherit badPlatforms;
+    inherit knownVulnerabilities;
+  };
+  passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
+}