2016-10-08 07:44:25 +01:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, pkgconfig, cairo, lablgtk, gtk2,
|
2014-10-31 13:14:17 +00:00
|
|
|
enableGtkSupport ? true # Whether to compile with support for Gtk
|
|
|
|
# integration (library file cairo2_gtk). Depends
|
2016-09-11 22:24:51 +01:00
|
|
|
# on lablgtk and gtk2.
|
2014-10-31 13:14:17 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) optionals;
|
2017-12-09 08:38:50 +00:00
|
|
|
version = "0.5";
|
2014-10-31 13:14:17 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
2017-12-09 08:38:50 +00:00
|
|
|
name = "ocaml${ocaml.version}-cairo2-${version}";
|
2014-10-31 13:14:17 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-12-09 08:38:50 +00:00
|
|
|
url = "https://github.com/Chris00/ocaml-cairo/releases/download/${version}/cairo2-${version}.tar.gz";
|
|
|
|
sha256 = "1559df74rzh4v7c9hr6phymq1f5121s83q0xy3r83x4apj74dchj";
|
2014-10-31 13:14:17 +00:00
|
|
|
};
|
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ ocaml findlib ocamlbuild cairo ]
|
2016-09-11 22:24:51 +01:00
|
|
|
++ optionals enableGtkSupport [ gtk2 ];
|
2014-10-31 13:14:17 +00: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-12-09 08:38:50 +00:00
|
|
|
homepage = "https://github.com/Chris00/ocaml-cairo";
|
2014-10-31 13:14:17 +00: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 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-10-31 13:14:17 +00:00
|
|
|
maintainers = [ maintainers.jirkamarsik ];
|
|
|
|
};
|
|
|
|
}
|