2014-09-23 06:22:00 +01:00
|
|
|
{stdenv, fetchurl, automake, ocaml, autoconf, gnum4, pkgconfig, freetype, lablgtk, unzip, cairo, findlib, gdk_pixbuf, glib, gtk, pango }:
|
2013-06-04 19:49:10 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
|
|
|
pname = "ocaml-cairo";
|
|
|
|
version = "1.2.0";
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
2014-09-23 06:22:00 +01:00
|
|
|
src = fetchurl {
|
2013-06-04 19:49:10 +01:00
|
|
|
url = "http://cgit.freedesktop.org/cairo-ocaml/snapshot/cairo-ocaml-${version}.zip";
|
2014-09-23 06:22:00 +01:00
|
|
|
sha256 = "0l4p9bp6kclr570mxma8wafibr1g5fsjj8h10yr4b507g0hmlh0l";
|
2013-06-04 19:49:10 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./META.patch ];
|
|
|
|
|
2014-09-23 06:22:00 +01:00
|
|
|
buildInputs = [ ocaml automake gnum4 autoconf unzip pkgconfig
|
|
|
|
findlib freetype lablgtk cairo gdk_pixbuf gtk pango ];
|
2013-06-04 19:49:10 +01:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
aclocal -I support
|
|
|
|
autoconf
|
2014-09-23 06:22:00 +01:00
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE `pkg-config --cflags cairo gdk-pixbuf glib gtk+ pango`"
|
2013-06-04 19:49:10 +01:00
|
|
|
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";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2014-09-23 06:24:34 +01:00
|
|
|
platforms = ocaml.meta.platforms;
|
2013-06-04 19:49:10 +01:00
|
|
|
};
|
|
|
|
}
|