2016-10-08 08:44:25 +02:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, pkgconfig, cairo, lablgtk, gtk2,
|
2014-10-31 14:14:17 +01:00
|
|
|
enableGtkSupport ? true # Whether to compile with support for Gtk
|
|
|
|
# integration (library file cairo2_gtk). Depends
|
2016-09-11 23:24:51 +02:00
|
|
|
# on lablgtk and gtk2.
|
2014-10-31 14:14:17 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) optionals;
|
|
|
|
pname = "ocaml-cairo2";
|
|
|
|
version = "0.4.6";
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://forge.ocamlcore.org/frs/download.php/1279/cairo2-0.4.6.tar.gz";
|
|
|
|
sha256 = "1lc1iv5yz49avbc0wbrw9nrx8dn0c35r7cykivjln1zc2fwscf7w";
|
|
|
|
};
|
|
|
|
|
2016-10-08 08:44:25 +02:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild pkgconfig cairo ]
|
2016-09-11 23:24:51 +02:00
|
|
|
++ optionals enableGtkSupport [ gtk2 ];
|
2014-10-31 14:14:17 +01:00
|
|
|
|
|
|
|
# lablgtk2 is marked as a propagated build input since loading the
|
|
|
|
# cairo.lablgtk2 package from the toplevel tries to load lablgtk2 as
|
|
|
|
# well.
|
|
|
|
propagatedBuildInputs = optionals enableGtkSupport [ lablgtk ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
configurePhase = "ocaml setup.ml -configure --prefix $out"
|
|
|
|
+ (if enableGtkSupport then " --enable-lablgtk2"
|
|
|
|
else " --disable-lablgtk2");
|
|
|
|
|
|
|
|
buildPhase = "ocaml setup.ml -build";
|
|
|
|
|
|
|
|
installPhase = "ocaml setup.ml -install";
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://forge.ocamlcore.org/projects/cairo;
|
2014-10-31 14:14:17 +01:00
|
|
|
description = "Binding to Cairo, a 2D Vector Graphics Library";
|
|
|
|
longDescription = ''
|
|
|
|
This is a binding to Cairo, a 2D graphics library with support for
|
|
|
|
multiple output devices. Currently supported output targets include
|
|
|
|
the X Window System, Quartz, Win32, image buffers, PostScript, PDF,
|
|
|
|
and SVG file output.
|
|
|
|
'';
|
|
|
|
license = licenses.lgpl3;
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-10-31 14:14:17 +01:00
|
|
|
maintainers = [ maintainers.jirkamarsik ];
|
|
|
|
};
|
|
|
|
}
|