2021-01-19 06:50:56 +00:00
|
|
|
{stdenv, lib, fetchurl, automake, ocaml, autoconf, gnum4, pkg-config, freetype, lablgtk, unzip, cairo, findlib, gdk-pixbuf, gtk2, pango }:
|
2013-06-04 19:49:10 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "ocaml-cairo";
|
|
|
|
in
|
|
|
|
|
2021-01-11 12:49:15 +00:00
|
|
|
if lib.versionAtLeast ocaml.version "4.06"
|
2018-08-21 18:34:09 +01:00
|
|
|
then throw "${pname} is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2016-10-05 08:32:30 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2013-06-04 19:49:10 +01:00
|
|
|
name = "${pname}-${version}";
|
2016-10-05 08:32:30 +01:00
|
|
|
version = "1.2.0";
|
2013-06-04 19:49:10 +01:00
|
|
|
|
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 ];
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 22:26:13 +01:00
|
|
|
buildInputs = [ ocaml automake gnum4 autoconf unzip
|
2019-05-22 12:03:39 +01:00
|
|
|
findlib freetype lablgtk cairo gdk-pixbuf gtk2 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`"
|
2016-10-05 08:32:30 +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
|
2013-06-04 19:49:10 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2016-10-05 08:32:30 +01:00
|
|
|
cp META $out/lib/ocaml/${ocaml.version}/site-lib/cairo/
|
2013-06-04 19:49:10 +01:00
|
|
|
'';
|
|
|
|
|
2019-10-27 13:03:25 +00:00
|
|
|
makeFlags = [ "INSTALLDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/cairo" ];
|
2013-06-04 19:49:10 +01:00
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://cairographics.org/cairo-ocaml";
|
2013-06-04 19:49:10 +01:00
|
|
|
description = "ocaml bindings for cairo library";
|
2021-01-11 12:49:15 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2013-06-04 19:49:10 +01:00
|
|
|
};
|
|
|
|
}
|