about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/botan/generic.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/botan/generic.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/generic.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/botan/generic.nix b/nixpkgs/pkgs/development/libraries/botan/generic.nix
new file mode 100644
index 000000000000..0369f603b8e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/botan/generic.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchurl, python, bzip2, zlib, gmp, openssl, boost
+# Passed by version specific builders
+, baseVersion, revision, sha256
+, sourceExtension ? "tar.xz"
+, extraConfigureFlags ? ""
+, postPatch ? null
+, CoreServices
+, Security
+, ...
+}:
+
+stdenv.mkDerivation rec {
+  pname = "botan";
+  version = "${baseVersion}.${revision}";
+
+  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 sha256;
+  };
+  inherit postPatch;
+
+  buildInputs = [ python bzip2 zlib gmp openssl boost ]
+    ++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
+
+  configurePhase = ''
+    python configure.py --prefix=$out --with-bzip2 --with-zlib ${if openssl != null then "--with-openssl" else ""} ${extraConfigureFlags}${if stdenv.cc.isClang then " --cc=clang" else "" }
+  '';
+
+  enableParallelBuilding = true;
+
+  preInstall = ''
+    if [ -d src/scripts ]; then
+      patchShebangs src/scripts
+    fi
+  '';
+
+  postInstall = ''
+    cd "$out"/lib/pkgconfig
+    ln -s botan-*.pc botan.pc || true
+  '';
+
+  meta = with lib; {
+    inherit version;
+    description = "Cryptographic algorithms library";
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.unix;
+    license = licenses.bsd2;
+  };
+  passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
+}