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

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

  src = fetchFromGitHub {
    owner = "mbacarella";
    repo = "curses";
    rev = version;
    sha256 = "0yy3wf8i7jgvzdc40bni7mvpkvclq97cgb5fw265mrjj0iqpkqpd";
  };

  strictDeps = true;

  propagatedBuildInputs = [ ncurses ];

  nativeBuildInputs = [ 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 lib; {
    description = "OCaml Bindings to curses/ncurses";
    homepage = "https://github.com/mbacarella/curses";
    license = licenses.lgpl21Plus;
    changelog = "https://github.com/mbacarella/curses/raw/${version}/CHANGES";
    maintainers = [ ];
    inherit (ocaml.meta) platforms;
  };
}