@@ -1,43 +1,22 @@
1−{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, pkgconfig, cairo, lablgtk, gtk2,
2− enableGtkSupport ? true # Whether to compile with support for Gtk
3− # integration (library file cairo2_gtk). Depends
4− # on lablgtk and gtk2.
1+{ stdenv, lib, fetchurl, buildDunePackage
2+, pkgconfig, cairo
53}:
64
7−let
8− inherit (stdenv.lib) optionals;
9− version = "0.5";
10−in
11−
12−stdenv.mkDerivation {
13−
14− name = "ocaml${ocaml.version}-cairo2-${version}";
5+buildDunePackage rec {
6+ pname = "cairo2";
7+ version = "0.6";
158
169 src = fetchurl {
17− url = "https://github.com/Chris00/ocaml-cairo/releases/download/${version}/cairo2-${version}.tar.gz";
18− sha256 = "1559df74rzh4v7c9hr6phymq1f5121s83q0xy3r83x4apj74dchj";
10+ url = "https://github.com/Chris00/ocaml-cairo/releases/download/${version}/cairo2-${version}.tbz";
11+ sha256 = "1k2q7ipmddqnd2clybj4qb5xwzzrnl2fxnd6kv60dlzgya18lchs";
1912 };
2013
2114 nativeBuildInputs = [ pkgconfig ];
22− buildInputs = [ ocaml findlib ocamlbuild cairo ]
23− ++ optionals enableGtkSupport [ gtk2 ];
24−
25− # lablgtk2 is marked as a propagated build input since loading the
26− # cairo.lablgtk2 package from the toplevel tries to load lablgtk2 as
27− # well.
28− propagatedBuildInputs = optionals enableGtkSupport [ lablgtk ];
29−
30− createFindlibDestdir = true;
31−
32− configurePhase = "ocaml setup.ml -configure --prefix $out"
33− + (if enableGtkSupport then " --enable-lablgtk2"
34− else " --disable-lablgtk2");
35−
36− buildPhase = "ocaml setup.ml -build";
15+ buildInputs = [ cairo ];
3716
38− installPhase = "ocaml setup.ml -install";
17+ doCheck = !stdenv.isDarwin;
3918
40− meta = with stdenv.lib; {
19+ meta = {
4120 homepage = "https://github.com/Chris00/ocaml-cairo";
4221 description = "Binding to Cairo, a 2D Vector Graphics Library";
4322 longDescription = ''
@@ -46,8 +25,7 @@ stdenv.mkDerivation {
4625 the X Window System, Quartz, Win32, image buffers, PostScript, PDF,
4726 and SVG file output.
4827 '';
49− license = licenses.lgpl3;
50− platforms = ocaml.meta.platforms or [];
51− maintainers = [ maintainers.jirkamarsik ];
28+ license = lib.licenses.lgpl3;
29+ maintainers = with lib.maintainers; [ jirkamarsik vbgl ];
5230 };
5331}