aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/default.nix
blob: df684f166e173eca3554e390b8c07863706e6ac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ 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
    ];
  };
}