* 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
wip/yesman
Marco Maggesi 14 years ago
parent 114fa21c48
commit ac457478e3
  1. 34
      pkgs/development/ocaml-modules/batteries/default.nix
  2. 23
      pkgs/development/ocaml-modules/camlzip/META
  3. 47
      pkgs/development/ocaml-modules/camlzip/default.nix
  4. 32
      pkgs/development/ocaml-modules/camlzip/makefile.patch
  5. 25
      pkgs/development/ocaml-modules/camomile/0.7.3.nix
  6. 25
      pkgs/development/ocaml-modules/camomile/0.8.1.nix
  7. 31
      pkgs/development/ocaml-modules/cryptgps/default.nix
  8. 8
      pkgs/development/ocaml-modules/cryptokit/META
  9. 43
      pkgs/development/ocaml-modules/cryptokit/default.nix
  10. 21
      pkgs/development/ocaml-modules/cryptokit/makefile.patch
  11. 25
      pkgs/development/ocaml-modules/lwt/default.nix
  12. 47
      pkgs/development/ocaml-modules/menhir/default.nix
  13. 31
      pkgs/development/ocaml-modules/ounit/default.nix
  14. 26
      pkgs/development/ocaml-modules/pcre/default.nix
  15. 33
      pkgs/development/ocaml-modules/react/default.nix
  16. 27
      pkgs/development/ocaml-modules/ssl/default.nix
  17. 54
      pkgs/development/tools/ocaml/findlib/default.nix
  18. 8
      pkgs/development/tools/ocaml/findlib/ldconf.patch
  19. 37
      pkgs/top-level/all-packages.nix

@ -0,0 +1,34 @@
{stdenv, fetchurl, ocaml, findlib, camomile, ounit}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "1.2.0";
in
stdenv.mkDerivation {
name = "ocaml-batteries-${version}";
src = fetchurl {
url = "http://forge.ocamlcore.org/frs/download.php/423/batteries-${version}.tar.gz";
sha256 = "0lkkbfj51zkhhr56nx167448pvg02nrzjjkl57ycic2ikzgq6lmx";
};
buildInputs = [ocaml findlib camomile ounit];
configurePhase = "true"; # Skip configure
doCheck = true;
checkTarget = "test";
meta = {
homepage = http://batteries.forge.ocamlcore.org/;
description = "OCaml Batteries Included";
longDescription = ''
A community-driven effort to standardize on an consistent, documented,
and comprehensive development platform for the OCaml programming
language.
'';
license = "LGPL";
};
}

@ -0,0 +1,23 @@
# Specifications for the "camlzip" library:
name="zip"
version="1.04"
description="A library for handling ZIP and GZIP files in OCaml"
directory="@INSTALLDIR@"
requires="unix"
requires(byte)="unix"
requires(native)="unix"
requires(toploop)="unix"
requires(byte,mt)="unix"
requires(native,mt)="unix"
requires(toploop,mt)="unix"
archive(byte)="zip.cma"
archive(native)="zip.cmxa"
archive(toploop)="zip.cma"
archive(byte,mt)="zip.cma"
archive(native,mt)="zip.cmxa"
archive(toploop,mt)="zip.cma"

@ -0,0 +1,47 @@
{stdenv, fetchurl, zlib, ocaml}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "1.04";
in
stdenv.mkDerivation {
name = "camlzip-${version}";
src = fetchurl {
url = "http://forge.ocamlcore.org/frs/download.php/328/" +
"camlzip-${version}.tar.gz";
sha256 = "1zpchmp199x7f4mzmapvfywgy7f6wy9yynd9nd8yh8l78s5gixbn";
};
buildInputs = [zlib ocaml];
patches = [ ./makefile.patch ];
configurePhase = ''
export INSTALLDIR="$out/lib/ocaml/${ocaml_version}/site-lib/zip"
substituteInPlace Makefile \
--subst-var-by ZLIB_LIBDIR "${zlib}/lib" \
--subst-var-by ZLIB_INCLUDE "${zlib}/include" \
--subst-var INSTALLDIR
'';
buildFlags = "all allopt";
installTargets = "install installopt";
postInstall = ''
substitute ${./META} $INSTALLDIR/META --subst-var INSTALLDIR
'';
meta = {
homepage = "http://cristal.inria.fr/~xleroy/software.html#camlzip";
description = "A library for handling ZIP and GZIP files in OCaml";
longDescription = ''
This Objective Caml library provides easy access to compressed files in
ZIP and GZIP format, as well as to Java JAR files. It provides functions
for reading from and writing to compressed files in these formats.
'';
license = "LGPL+linking exceptions";
};
}

@ -0,0 +1,32 @@
diff -Naur camlzip-1.04/Makefile camlzip-1.04.nixos/Makefile
--- camlzip-1.04/Makefile 2002-04-22 17:28:57.000000000 +0200
+++ camlzip-1.04.nixos/Makefile 2010-08-17 14:40:07.000000000 +0200
@@ -4,14 +4,14 @@
ZLIB_LIB=-lz
# The directory containing the Zlib library (libz.a or libz.so)
-ZLIB_LIBDIR=/usr/local/lib
+ZLIB_LIBDIR=@ZLIB_LIBDIR@
# The directory containing the Zlib header file (zlib.h)
-ZLIB_INCLUDE=/usr/local/include
+ZLIB_INCLUDE=@ZLIB_INCLUDE@
# Where to install the library. By default: sub-directory 'zip' of
# OCaml's standard library directory.
-INSTALLDIR=`$(OCAMLC) -where`/zip
+INSTALLDIR=@INSTALLDIR@
### End of configuration section
@@ -59,10 +59,6 @@
cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR)
if test -f dllcamlzip.so; then \
cp dllcamlzip.so $(INSTALLDIR); \
- ldconf=`$(OCAMLC) -where`/ld.conf; \
- installdir=$(INSTALLDIR); \
- if test `grep -s -c $$installdir'$$' $$ldconf || :` = 0; \
- then echo $$installdir >> $$ldconf; fi \
fi
installopt:

@ -0,0 +1,25 @@
{stdenv, fetchurl, ocaml, findlib}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "0.7.3";
in
stdenv.mkDerivation {
name = "camomile-${version}";
src = fetchurl {
url = "mirror://sourceforge/camomile/camomile-${version}.tar.bz2";
sha256 = "0cm3j3ppl15fp597ih3qiagxyg8kpql9apapkqaib2xccc44zb5l";
};
buildInputs = [ocaml findlib];
#dontAddPrefix = true;
meta = {
homepage = http://camomile.sourceforge.net/;
description = "A comprehensive Unicode library for OCaml";
license = "LGPL";
};
}

@ -0,0 +1,25 @@
{stdenv, fetchurl, ocaml, findlib}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "0.8.1";
in
stdenv.mkDerivation {
name = "camomile-${version}";
src = fetchurl {
url = "mirror://sourceforge/camomile/camomile-${version}.tar.bz2";
sha256 = "1r84y7wl10zkjmp8qqq2bcmll23qmfczlnykm74hxkig8ksm0g6a";
};
buildInputs = [ocaml findlib];
#dontAddPrefix = true;
meta = {
homepage = http://camomile.sourceforge.net/;
description = "A comprehensive Unicode library for OCaml";
license = "LGPL";
};
}

@ -0,0 +1,31 @@
{stdenv, fetchurl, ocaml, findlib}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "0.2.1";
in
stdenv.mkDerivation {
name = "ocaml-cryptgps-${version}";
src = fetchurl {
url = "http://download.camlcity.org/download/cryptgps-0.2.1.tar.gz";
sha256 = "1mp7i42cm9w9grmcsa69m3h1ycpn6a48p43y4xj8rsc12x9nav3s";
};
buildInputs = [ocaml findlib];
configurePhase = "true"; # Skip configure phase
meta = {
homepage = http://projects.camlcity.org/projects/cryptgps.html;
description = "Cryptographic functions for OCaml";
longDescription = ''
This library implements the symmetric cryptographic algorithms
Blowfish, DES, and 3DES. The algorithms are written in O'Caml,
i.e. this is not a binding to some C library, but the implementation
itself.
'';
license = "MIT/X11";
};
}

@ -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"

@ -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";
};
}

@ -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)

@ -0,0 +1,25 @@
{stdenv, fetchurl, which, cryptopp, ocaml, findlib, ocaml_react, ocaml_ssl}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "2.1.1";
in
stdenv.mkDerivation {
name = "ocaml-lwt-${version}";
src = fetchurl {
url = "http://ocsigen.org/download/lwt-${version}.tar.gz";
sha256 = "1zjn0sgihryshancn4kna1xslhc8gifliny1qd3a85f72xxxnw0w";
};
buildInputs = [which cryptopp ocaml findlib ocaml_react ocaml_ssl];
configurePhase = "true";
meta = {
homepage = http://ocsigen.org/lwt;
description = "Lightweight thread library for Objective Caml";
license = "LGPL";
};
}

@ -0,0 +1,47 @@
{stdenv, fetchurl, ocaml, findlib}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "20090505";
in
stdenv.mkDerivation {
name = "menhir-${version}";
src = fetchurl {
url = "http://pauillac.inria.fr/~fpottier/menhir/menhir-${version}.tar.gz";
sha256 = "1dsy80wp7k9wbxc89pjzy2izdkk4b72104m9ik747xzy23mssbyx";
};
buildInputs = [ocaml findlib];
configurePhase = "true"; # Skip configure
preBuild = ''
#Fix makefiles.
RM=$(type -p rm)
CHMOD=$(type -p chmod)
ENV=$(type -p env)
for f in src/Makefile demos/OMakefile* demos/Makefile* demos/ocamldep.wrapper
do
substituteInPlace $f \
--replace /bin/rm $RM \
--replace /bin/chmod $CHMOD \
--replace /usr/bin/env $ENV
done
export PREFIX=$out
'';
meta = {
homepage = http://pauillac.inria.fr/~fpottier/menhir/;
description = "A LR(1) parser generator for OCaml";
longDescription = ''
Menhir is a LR(1) parser generator for the Objective Caml programming
language. That is, Menhir compiles LR(1) grammar specifications down
to OCaml code. Menhir was designed and implemented by François Pottier
and Yann Régis-Gianas.
'';
license = "QPL,LGPL+linking exceptions";
};
}

@ -0,0 +1,31 @@
{stdenv, fetchurl, ocaml, findlib}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "1.0.3";
in
stdenv.mkDerivation {
name = "ounit-${version}";
src = fetchurl {
url = "http://www.xs4all.nl/~mmzeeman/ocaml/ounit-${version}.tar.gz";
sha256 = "1n7ylrbi2m00gn0kjg5zxnyzxki8v1dy31fcz3vh1xnwcx6hii97";
};
buildInputs = [ocaml findlib];
configurePhase = "true"; # Skip configure
buildFlags = "all allopt";
doCheck = true;
checkTarget = "test";
meta = {
homepage = http://www.xs4all.nl/~mmzeeman/ocaml/;
description = "Unit test framework for OCaml";
license = "MIT/X11";
};
}

@ -0,0 +1,26 @@
{stdenv, fetchurl, pcre, ocaml, findlib}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "6.1.0";
in
stdenv.mkDerivation {
name = "ocaml-pcre-${version}";
src = fetchurl {
url = "http://hg.ocaml.info/release/pcre-ocaml/archive/" +
"release-${version}.tar.bz2";
sha256 = "1lj9mzabi1crxwvb2ly1l10h4hlx0fw20nbnq76bbzzkzabjs4ll";
};
buildInputs = [pcre ocaml findlib];
configurePhase = "true"; # Skip configure phase
meta = {
homepage = "http://www.ocaml.info/home/ocaml_sources.html#pcre-ocaml";
description = "An efficient C-library for pattern matching with Perl-style regular expressions in OCaml";
license = "LGPL";
};
}

@ -0,0 +1,33 @@
{stdenv, fetchurl, ocaml}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "0.9.2";
in
stdenv.mkDerivation {
name = "ocaml-react-${version}";
src = fetchurl {
url = "http://erratique.ch/software/react/releases/react-${version}.tbz";
sha256 = "0fiaxzfxv8pc82d31jz85zryz06k84is0l3sn5g0di5mpc5falxr";
};
buildInputs = [ocaml];
buildCommand = ''
export INSTALLDIR=$out/lib/ocaml/${ocaml_version}/site-lib/react
tar xjf $src
cd react-*
substituteInPlace src/META --replace '+react' $INSTALLDIR
chmod +x build
./build
./build install
'';
meta = {
homepage = http://erratique.ch/software/react;
description = "Applicative events and signals for OCaml";
license = "BSD";
};
}

@ -0,0 +1,27 @@
{stdenv, fetchurl, which, openssl, ocaml, findlib}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "0.4.4";
in
stdenv.mkDerivation {
name = "ocaml-ssl-${version}";
src = fetchurl {
url = "mirror://debian/pool/main/o/ocaml-ssl/ocaml-ssl_${version}.orig.tar.gz";
sha256 = "1m45d0bd4ndxswaa1symp6c1npzjmm9pz0nf7w0q15gflqhba5ch";
};
buildInputs = [which openssl ocaml findlib];
dontAddPrefix = true;
configureFlags = "--disable-ldconf";
meta = {
homepage = http://savonet.rastageeks.org/;
description = "OCaml bindings for libssl ";
license = "LGPL+link exception";
};
}

@ -0,0 +1,54 @@
{stdenv, fetchurl, m4, ncurses, ocaml, writeText}:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
version = "1.2.6";
in
stdenv.mkDerivation {
name = "ocaml-findlib-${version}";
src = fetchurl {
url = "http://download.camlcity.org/download/findlib-${version}.tar.gz";
sha256 = "1b6z5lylsjxxaifw2yc21cs0dc84zqi4q57sgwg4j8k3m60ivpxs";
};
buildInputs = [m4 ncurses ocaml];
patches = [ ./ldconf.patch ];
dontAddPrefix=true;
preConfigure=''
configureFlagsArray=(
-bindir $out/bin
-mandir $out/share/man
-sitelib $out/lib/ocaml/${ocaml_version}/site-lib
-config $out/etc/findlib.conf
-no-topfind
)
'';
buildPhase = ''
make all
make opt
'';
setupHook = writeText "setupHook.sh" ''
addOCamlPath () {
if test -d "''$1/lib/ocaml/${ocaml_version}/site-lib"; then
export OCAMLPATH="''${OCAMLPATH}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/"
fi
export OCAMLFIND_DESTDIR="''$out/lib/ocaml/${ocaml_version}/site-lib/"
ensureDir ''$OCAMLFIND_DESTDIR
}
envHooks=(''${envHooks[@]} addOCamlPath)
'';
meta = {
homepage = http://projects.camlcity.org/projects/findlib.html;
description = "O'Caml library manager";
license = "MIT/X11";
};
}

@ -0,0 +1,8 @@
Setting paths to search for dnynmic libraries isn't very useful in Nix.
--- findlib-1.2.6/findlib.conf.in 2010-08-17 14:50:28.000000000 -0400
+++ findlib-1.2.6/findlib.conf.in 2010-11-24 09:46:55.179648354 -0500
@@ -1,2 +1,3 @@
destdir="@SITELIB@"
path="@SITELIB@"
+ldconf="ignore"

@ -1982,6 +1982,43 @@ let
ocaml_3_12_0 = callPackage ../development/compilers/ocaml/3.12.0.nix { };
mkOcamlPackages = ocaml: self: let callPackage = newScope self; in rec {
inherit ocaml;
camlzip = callPackage ../development/ocaml-modules/camlzip { };
camomile = camomile_0_7_3;
camomile_0_7_3 = callPackage ../development/ocaml-modules/camomile/0.7.3.nix { };
camomile_0_8_1 = callPackage ../development/ocaml-modules/camomile/0.8.1.nix { };
cryptokit = callPackage ../development/ocaml-modules/cryptokit { };
findlib = callPackage ../development/tools/ocaml/findlib { };
menhir = callPackage ../development/ocaml-modules/menhir { };
ocaml_batteries = callPackage ../development/ocaml-modules/batteries { };
ocaml_cryptgps = callPackage ../development/ocaml-modules/cryptgps { };
ocaml_lwt = callPackage ../development/ocaml-modules/lwt { };
ocaml_pcre = callPackage ../development/ocaml-modules/pcre {
inherit pcre;
};
ocaml_react = callPackage ../development/ocaml-modules/react { };
ocaml_ssl = callPackage ../development/ocaml-modules/ssl { };
ounit = callPackage ../development/ocaml-modules/ounit { };
};
ocamlPackages = recurseIntoAttrs ocamlPackages_3_11_1;
ocamlPackages_3_10_0 = mkOcamlPackages ocaml_3_10_0 pkgs.ocamlPackages_3_10_0;
ocamlPackages_3_11_1 = mkOcamlPackages ocaml_3_11_1 pkgs.ocamlPackages_3_11_1;
ocamlPackages_3_12_0 = mkOcamlPackages ocaml_3_12_0 pkgs.ocamlPackages_3_12_0;
opencxx = callPackage ../development/compilers/opencxx {
gcc = gcc33;
};

Loading…
Cancel
Save