2012-07-12 16:22:45 +01:00
|
|
|
{stdenv, fetchurl, ocaml, findlib, ocamlPackages }:
|
2011-11-27 23:58:46 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
2014-05-01 08:28:23 +01:00
|
|
|
version = "1.8.5";
|
2011-11-27 23:58:46 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ocamlgraph-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ocamlgraph.lri.fr/download/ocamlgraph-${version}.tar.gz";
|
2014-05-01 08:28:23 +01:00
|
|
|
sha256 = "0bxqxzd5sd7siz57vhzb8bmiz1ddhgdv49gcsmwwfmd16mj4cryi";
|
2011-11-27 23:58:46 +00:00
|
|
|
};
|
|
|
|
|
2012-07-12 16:22:45 +01:00
|
|
|
buildInputs = [ ocaml findlib ocamlPackages.lablgtk ];
|
2011-11-27 23:58:46 +00:00
|
|
|
|
|
|
|
patches = ./destdir.patch;
|
|
|
|
|
2012-07-12 16:22:45 +01:00
|
|
|
# some patching is required so that the lablgtk2 library is taken into account. It
|
|
|
|
# does not reside in a subdirectory of the default library path, hence:
|
|
|
|
# * configure looked in the wrong path
|
|
|
|
# * ocaml needs that directory and the stubs directory as -I flag
|
2011-11-27 23:58:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's@$(DESTDIR)$(OCAMLLIB)/ocamlgraph@$(DESTDIR)/lib/ocaml/${ocaml_version}/site-lib/ocamlgraph@' Makefile.in
|
2012-07-12 16:22:45 +01:00
|
|
|
sed -i 's@$OCAMLLIB/lablgtk2@${ocamlPackages.lablgtk}/lib/ocaml/${ocaml_version}/site-lib/lablgtk2@' configure Makefile.in
|
2014-05-01 08:28:23 +01:00
|
|
|
sed -i 's@+lablgtk2@${ocamlPackages.lablgtk}/lib/ocaml/${ocaml_version}/site-lib/lablgtk2 -I ${ocamlPackages.lablgtk}/lib/ocaml/${ocaml_version}/site-lib/stublibs@' configure Makefile.in editor/Makefile
|
2011-11-27 23:58:46 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make all
|
|
|
|
make install-findlib
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://ocamlgraph.lri.fr/;
|
2013-10-06 10:49:53 +01:00
|
|
|
description = "Graph library for Objective Caml";
|
2011-11-27 23:58:46 +00:00
|
|
|
license = "GNU Library General Public License version 2, with the special exception on linking described in file LICENSE";
|
|
|
|
platforms = ocaml.meta.platforms;
|
|
|
|
maintainers = [
|
|
|
|
stdenv.lib.maintainers.kkallio
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|