summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/curses/default.nix
blob: 9bcf4fc411ffc3e6b8b78508b9a317c1165fc2d3 (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
{ stdenv, fetchurl, ocaml, findlib, ncurses }:

stdenv.mkDerivation rec {
  pname = "ocaml-curses";
  version = "1.0.4";

  src = fetchurl {
    url = "http://ocaml.phauna.org/distfiles/ocaml-curses-${version}.ogunden1.tar.gz";
    sha256 = "08wq1r93lincdfzlriyc5nl2p4q7ca4h6ygzgp1nhkgd93pgk9v2";
  };

  propagatedBuildInputs = [ ncurses ];

  buildInputs = [ ocaml findlib ];

  # Fix build for recent ncurses versions
  NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1";

  createFindlibDestdir = true;

  postPatch = ''
    substituteInPlace curses.ml --replace "pp gcc" "pp $CC"
  '';

  buildPhase = "make all opt";

  meta = with stdenv.lib; {
    description = "OCaml Bindings to curses/ncurses";
    homepage = https://opam.ocaml.org/packages/curses/curses.1.0.4/;
    license = licenses.gpl2;
    maintainers = [ maintainers.volth ];
    platforms = ocaml.meta.platforms or [];
  };
}