about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/cryptokit
diff options
context:
space:
mode:
authorMarco Maggesi <maggesi@math.unifi.it>2010-12-09 15:40:04 +0000
committerMarco Maggesi <maggesi@math.unifi.it>2010-12-09 15:40:04 +0000
commitac457478e35e56e7370e3e40167e5df75de98363 (patch)
treefcbfe2bb58b8e32bbb60c0c4e25e069139e73ceb /pkgs/development/ocaml-modules/cryptokit
parent114fa21c481f0c9b52f4e7a2915bffbdfb61467e (diff)
downloadnixlib-ac457478e35e56e7370e3e40167e5df75de98363.tar
nixlib-ac457478e35e56e7370e3e40167e5df75de98363.tar.gz
nixlib-ac457478e35e56e7370e3e40167e5df75de98363.tar.bz2
nixlib-ac457478e35e56e7370e3e40167e5df75de98363.tar.lz
nixlib-ac457478e35e56e7370e3e40167e5df75de98363.tar.xz
nixlib-ac457478e35e56e7370e3e40167e5df75de98363.tar.zst
nixlib-ac457478e35e56e7370e3e40167e5df75de98363.zip
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
Diffstat (limited to 'pkgs/development/ocaml-modules/cryptokit')
-rw-r--r--pkgs/development/ocaml-modules/cryptokit/META8
-rw-r--r--pkgs/development/ocaml-modules/cryptokit/default.nix43
-rw-r--r--pkgs/development/ocaml-modules/cryptokit/makefile.patch21
3 files changed, 72 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/cryptokit/META b/pkgs/development/ocaml-modules/cryptokit/META
new file mode 100644
index 000000000000..661170835fdf
--- /dev/null
+++ b/pkgs/development/ocaml-modules/cryptokit/META
@@ -0,0 +1,8 @@
+# Specifications for the "cryptokit" library:
+requires = ""
+description = "A library of cryptographic primitives for OCaml"
+version = "1.3"
+directory = "^"
+
+archive(byte) = "cryptokit.cma"
+archive(native) = "cryptokit.cmxa"
diff --git a/pkgs/development/ocaml-modules/cryptokit/default.nix b/pkgs/development/ocaml-modules/cryptokit/default.nix
new file mode 100644
index 000000000000..1c7e361f3fc3
--- /dev/null
+++ b/pkgs/development/ocaml-modules/cryptokit/default.nix
@@ -0,0 +1,43 @@
+{stdenv, fetchurl, zlib, ocaml}:
+
+let
+  ocaml_version = (builtins.parseDrvName ocaml.name).version;
+  version = "1.3";
+in
+
+stdenv.mkDerivation {
+  name = "cryptokit-${version}";
+
+  src = fetchurl {
+    url = "http://forge.ocamlcore.org/frs/download.php/326/" +
+          "cryptokit-${version}.tar.gz";
+    sha256 = "0kqrlxkpzrj2qpniy6mhn7gx3n29s86vk4q0im2hqpxi9knkkwwy";
+  };
+
+  buildInputs = [zlib ocaml];
+
+  patches = [ ./makefile.patch ];
+
+  configurePhase = ''
+    export INSTALLDIR="$out/lib/ocaml/${ocaml_version}/site-lib/cryptokit"
+    substituteInPlace Makefile \
+      --subst-var-by ZLIB_LIBDIR "${zlib}/lib" \
+      --subst-var-by ZLIB_INCLUDE "${zlib}/include" \
+      --subst-var INSTALLDIR 
+  '';
+
+  buildFlags = "all allopt";
+
+  doCheck = true;
+  
+  checkTarget = "test";
+
+  preInstall = "ensureDir $INSTALLDIR";
+
+  postInstall = "cp -a ${./META} $INSTALLDIR/META";
+
+  meta = {
+    homepage = "http://pauillac.inria.fr/~xleroy/software.html";
+    description = "A library of cryptographic primitives for OCaml";
+  };
+}
diff --git a/pkgs/development/ocaml-modules/cryptokit/makefile.patch b/pkgs/development/ocaml-modules/cryptokit/makefile.patch
new file mode 100644
index 000000000000..b4a82c7d677f
--- /dev/null
+++ b/pkgs/development/ocaml-modules/cryptokit/makefile.patch
@@ -0,0 +1,21 @@
+diff -Nuar cryptokit-1.3/Makefile cryptokit-1.3.nixos/Makefile
+--- cryptokit-1.3/Makefile	2005-04-20 15:19:54.000000000 +0200
++++ cryptokit-1.3.nixos/Makefile	2010-08-17 15:22:07.000000000 +0200
+@@ -9,14 +9,13 @@
+ 
+ # The directory containing the Zlib library (libz.a or libz.so)
+ # Leave blank if you don't have Zlib.
+-ZLIB_LIBDIR=/usr/lib
+-#ZLIB_LIBDIR=/usr/lib64    # for x86-64 Linux
++ZLIB_LIBDIR=@ZLIB_LIBDIR@
+ 
+ # The directory containing the Zlib header file (zlib.h)
+-ZLIB_INCLUDE=/usr/include
++ZLIB_INCLUDE=@ZLIB_INCLUDE@
+ 
+ # Where to install the library. By default: OCaml's standard library directory.
+-INSTALLDIR=`$(OCAMLC) -where`
++INSTALLDIR=@INSTALLDIR@
+ 
+ # Flags for the C compiler.
+ CFLAGS=-O -I$(ZLIB_INCLUDE) $(ZLIB)