nerdfonts: fix wrong attribute name in error message (#364463)
[NixPkgs.git] / pkgs / development / ocaml-modules / ocaml-cairo / default.nix
blob6ba132b327291a182fdb5aa0f4cbf94ad506374f
2   stdenv,
3   lib,
4   fetchurl,
5   automake,
6   ocaml,
7   autoconf,
8   gnum4,
9   pkg-config,
10   freetype,
11   lablgtk,
12   unzip,
13   cairo,
14   findlib,
15   gdk-pixbuf,
16   gtk2,
17   pango,
20 let
21   pname = "ocaml-cairo";
24 if lib.versionAtLeast ocaml.version "4.06" then
25   throw "${pname} is not available for OCaml ${ocaml.version}"
26 else
28   stdenv.mkDerivation rec {
29     name = "${pname}-${version}";
30     version = "1.2.0";
32     src = fetchurl {
33       url = "http://cgit.freedesktop.org/cairo-ocaml/snapshot/cairo-ocaml-${version}.zip";
34       sha256 = "0l4p9bp6kclr570mxma8wafibr1g5fsjj8h10yr4b507g0hmlh0l";
35     };
37     patches = [ ./META.patch ];
39     strictDeps = true;
41     nativeBuildInputs = [
42       pkg-config
43       unzip
44       ocaml
45       automake
46       gnum4
47       autoconf
48       findlib
49     ];
50     buildInputs = [
51       freetype
52       lablgtk
53       cairo
54       gdk-pixbuf
55       gtk2
56       pango
57     ];
59     createFindlibDestdir = true;
61     preConfigure = ''
62       aclocal -I support
63       autoconf
64       export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE `pkg-config --cflags cairo gdk-pixbuf glib gtk+ pango`"
65       export LABLGTKDIR=${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2
66       cp ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2/pango.ml ./src
67       cp ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2/gaux.ml ./src
68     '';
70     postInstall = ''
71       cp META $out/lib/ocaml/${ocaml.version}/site-lib/cairo/
72     '';
74     makeFlags = [ "INSTALLDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/cairo" ];
76     meta = {
77       homepage = "http://cairographics.org/cairo-ocaml";
78       description = "ocaml bindings for cairo library";
79       license = lib.licenses.gpl2;
80       inherit (ocaml.meta) platforms;
81     };
82   }