lol
at v206 53 lines 1.8 kB view raw
1{ stdenv, fetchurl, ocaml, findlib, pkgconfig, cairo, lablgtk, gtk, 2 enableGtkSupport ? true # Whether to compile with support for Gtk 3 # integration (library file cairo2_gtk). Depends 4 # on lablgtk and gtk. 5}: 6 7let 8 inherit (stdenv.lib) optionals; 9 pname = "ocaml-cairo2"; 10 version = "0.4.6"; 11in 12 13stdenv.mkDerivation { 14 15 name = "${pname}-${version}"; 16 17 src = fetchurl { 18 url = "http://forge.ocamlcore.org/frs/download.php/1279/cairo2-0.4.6.tar.gz"; 19 sha256 = "1lc1iv5yz49avbc0wbrw9nrx8dn0c35r7cykivjln1zc2fwscf7w"; 20 }; 21 22 buildInputs = [ ocaml findlib pkgconfig cairo ] 23 ++ optionals enableGtkSupport [ gtk ]; 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"; 37 38 installPhase = "ocaml setup.ml -install"; 39 40 meta = with stdenv.lib; { 41 homepage = "http://forge.ocamlcore.org/projects/cairo"; 42 description = "Binding to Cairo, a 2D Vector Graphics Library"; 43 longDescription = '' 44 This is a binding to Cairo, a 2D graphics library with support for 45 multiple output devices. Currently supported output targets include 46 the X Window System, Quartz, Win32, image buffers, PostScript, PDF, 47 and SVG file output. 48 ''; 49 license = licenses.lgpl3; 50 platforms = ocaml.meta.platforms; 51 maintainers = [ maintainers.jirkamarsik ]; 52 }; 53}