2012-07-12 19:22:45 +04:00
|
|
|
{stdenv, fetchurl, ocaml, findlib, ocamlPackages }:
|
2011-11-28 03:58:46 +04:00
|
|
|
|
|
|
|
let
|
|
|
|
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
2012-07-12 19:22:45 +04:00
|
|
|
version = "1.8.2";
|
2011-11-28 03:58:46 +04:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ocamlgraph-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ocamlgraph.lri.fr/download/ocamlgraph-${version}.tar.gz";
|
2012-07-12 19:22:45 +04:00
|
|
|
sha256 = "e54ae60cd977a032854166dad56348d0fb76c6cd8e03e960af455268f0c8b5a6";
|
2011-11-28 03:58:46 +04:00
|
|
|
};
|
|
|
|
|
2012-07-12 19:22:45 +04:00
|
|
|
buildInputs = [ ocaml findlib ocamlPackages.lablgtk ];
|
2011-11-28 03:58:46 +04:00
|
|
|
|
|
|
|
patches = ./destdir.patch;
|
|
|
|
|
2012-07-12 19:22:45 +04: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-28 03:58:46 +04:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's@$(DESTDIR)$(OCAMLLIB)/ocamlgraph@$(DESTDIR)/lib/ocaml/${ocaml_version}/site-lib/ocamlgraph@' Makefile.in
|
2012-07-12 19:22:45 +04:00
|
|
|
sed -i 's@$OCAMLLIB/lablgtk2@${ocamlPackages.lablgtk}/lib/ocaml/${ocaml_version}/site-lib/lablgtk2@' configure Makefile.in
|
|
|
|
sed -i 's@-I +lablgtk2@-I ${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-28 03:58:46 +04:00
|
|
|
'';
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make all
|
|
|
|
make install-findlib
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://ocamlgraph.lri.fr/;
|
|
|
|
description = "ocamlgraph is a graph library for Objective Caml.";
|
|
|
|
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
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|