e3c2934213
When `gtkSupport` is true, additional components are built: - a module to render a graph on a GTK2 canvas - two GTK-based programs: a graph viewer and a graph editor. The default is to have `gtkSupport` as it is used in e.g., Frama-C.
40 lines
942 B
Nix
40 lines
942 B
Nix
{ stdenv, fetchurl, ocaml, findlib
|
|
, gtkSupport ? true
|
|
, lablgtk
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "ocamlgraph";
|
|
version = "1.8.8";
|
|
|
|
src = fetchurl {
|
|
url = "http://ocamlgraph.lri.fr/download/ocamlgraph-${version}.tar.gz";
|
|
sha256 = "0m9g16wrrr86gw4fz2fazrh8nkqms0n863w7ndcvrmyafgxvxsnr";
|
|
};
|
|
|
|
buildInputs = [ ocaml findlib ]
|
|
++ stdenv.lib.optional gtkSupport lablgtk
|
|
;
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
buildFlags = [ "all" ];
|
|
installTargets = [ "install-findlib" ];
|
|
|
|
postInstall = stdenv.lib.optionalString gtkSupport ''
|
|
mkdir -p $out/bin
|
|
cp dgraph/dgraph.opt $out/bin/graph-viewer
|
|
cp editor/editor.opt $out/bin/graph-editor
|
|
'';
|
|
|
|
meta = {
|
|
homepage = "http://ocamlgraph.lri.fr/";
|
|
description = "Graph library for Objective Caml";
|
|
license = stdenv.lib.licenses.gpl2Oss;
|
|
platforms = ocaml.meta.platforms or [];
|
|
maintainers = [
|
|
stdenv.lib.maintainers.kkallio
|
|
];
|
|
};
|
|
}
|