summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ocamlgraph/default.nix
blob: 92a46573117473acc8d0846a9d19cac73dbb8020 (plain) (blame)
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
40
{stdenv, fetchurl, ocaml, findlib }:

let
  ocaml_version = (builtins.parseDrvName ocaml.name).version;
  version = "1.8.1";
in

stdenv.mkDerivation {
  name = "ocamlgraph-${version}";

  src = fetchurl {
    url = "http://ocamlgraph.lri.fr/download/ocamlgraph-${version}.tar.gz";
    sha256 = "0hrba69wvw9b42irkvjf6q7zzw12v5nyyc33yaq3jlf1qbzqhqxs";
  };

  buildInputs = [ ocaml findlib ];

  patches = ./destdir.patch;

  postPatch = ''
    sed -i 's@$(DESTDIR)$(OCAMLLIB)/ocamlgraph@$(DESTDIR)/lib/ocaml/${ocaml_version}/site-lib/ocamlgraph@' Makefile.in
  '';

  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
    ];
  };
}