1 {stdenv, lib, fetchurl, automake, ocaml, autoconf, gnum4, pkg-config, freetype, lablgtk, unzip, cairo, findlib, gdk-pixbuf, gtk2, pango }:
7 if lib.versionAtLeast ocaml.version "4.06"
8 then throw "${pname} is not available for OCaml ${ocaml.version}"
11 stdenv.mkDerivation rec {
12 name = "${pname}-${version}";
16 url = "http://cgit.freedesktop.org/cairo-ocaml/snapshot/cairo-ocaml-${version}.zip";
17 sha256 = "0l4p9bp6kclr570mxma8wafibr1g5fsjj8h10yr4b507g0hmlh0l";
20 patches = [ ./META.patch ];
22 nativeBuildInputs = [ pkg-config unzip ocaml automake gnum4 autoconf findlib ];
23 buildInputs = [ freetype lablgtk cairo gdk-pixbuf gtk2 pango ];
25 createFindlibDestdir = true;
30 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE `pkg-config --cflags cairo gdk-pixbuf glib gtk+ pango`"
31 export LABLGTKDIR=${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2
32 cp ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2/pango.ml ./src
33 cp ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2/gaux.ml ./src
37 cp META $out/lib/ocaml/${ocaml.version}/site-lib/cairo/
40 makeFlags = [ "INSTALLDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/cairo" ];
43 homepage = "http://cairographics.org/cairo-ocaml";
44 description = "ocaml bindings for cairo library";
45 license = lib.licenses.gpl2;
46 inherit (ocaml.meta) platforms;