New ocaml packages:

- ocaml-cairo
- camlimages
- dypgen
- patoline
This commit is contained in:
Christophe Raffalli
2013-06-07 21:40:38 +02:00
parent 43faad8063
commit 270d929089
8 changed files with 359 additions and 0 deletions
@@ -0,0 +1,16 @@
diff -Naur cairo-ocaml-1.2.0.ori/META cairo-ocaml-1.2.0/META
--- cairo-ocaml-1.2.0.ori/META 1970-01-01 01:00:00.000000000 +0100
+++ cairo-ocaml-1.2.0/META 2013-06-04 03:31:32.000000000 +0200
@@ -0,0 +1,12 @@
+name = "cairo-ocaml"
+description = "Bindings to the cairo library."
+version = "@VERSION@"
+archive(byte) = "cairo.cma"
+archive(native) = "cairo.cmxa"
+requires = "bigarray"
+
+package "lablgtk2" (
+ requires = "cairo lablgtk2"
+ archive(byte) = "cairo_lablgtk.cma"
+ archive(native) = "cairo_lablgtk.cmxa"
+)
@@ -0,0 +1,44 @@
{stdenv, fetchurl, automake, ocaml, autoconf, gnum4, pkgconfig, freetype, lablgtk, unzip, cairo, findlib, gdk_pixbuf, glib, gtk, pango }:
let
ocaml_version = (builtins.parseDrvName ocaml.name).version;
pname = "ocaml-cairo";
version = "1.2.0";
in
stdenv.mkDerivation {
name = "${pname}-${version}";
src = fetchurl {
url = "http://cgit.freedesktop.org/cairo-ocaml/snapshot/cairo-ocaml-${version}.zip";
sha256 = "2d59678e322c331e3f4bc02a77240fce4a0917acb0d3ae75953a6ac62d70a125";
};
patches = [ ./META.patch ];
buildInputs = [ocaml automake gnum4 autoconf unzip pkgconfig findlib freetype lablgtk cairo gdk_pixbuf gtk pango ];
createFindlibDestdir = true;
preConfigure = ''
aclocal -I support
autoconf
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE `pkg-config --cflags cairo gdk-pixbuf glib gtk+ pango`"
export LABLGTKDIR=${lablgtk}/lib/ocaml/${ocaml_version}/site-lib/lablgtk2
cp ${lablgtk}/lib/ocaml/${ocaml_version}/site-lib/lablgtk2/pango.ml ./src
cp ${lablgtk}/lib/ocaml/${ocaml_version}/site-lib/lablgtk2/gaux.ml ./src
'';
postInstall = ''
cp META $out/lib/ocaml/${ocaml_version}/site-lib/cairo/
'';
makeFlags = "INSTALLDIR=$(out)/lib/ocaml/${ocaml_version}/site-lib/cairo";
meta = {
homepage = http://cairographics.org/cairo-ocaml;
description = "ocaml bindings for cairo library";
license = "GnuGPLV2";
# maintainers = [ stdenv.lib.maintainers.roconnor ];
};
}