Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ncurses }:
2
3stdenv.mkDerivation rec {
4 pname = "ocaml-curses";
5 version = "1.0.8";
6
7 src = fetchFromGitHub {
8 owner = "mbacarella";
9 repo = "curses";
10 rev = version;
11 sha256 = "0yy3wf8i7jgvzdc40bni7mvpkvclq97cgb5fw265mrjj0iqpkqpd";
12 };
13
14 strictDeps = true;
15
16 propagatedBuildInputs = [ ncurses ];
17
18 nativeBuildInputs = [ ocaml findlib ];
19
20 # Fix build for recent ncurses versions
21 env.NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1";
22
23 createFindlibDestdir = true;
24
25 postPatch = ''
26 substituteInPlace curses.ml --replace "pp gcc" "pp $CC"
27 '';
28
29 buildPhase = "make all opt";
30
31 meta = with lib; {
32 description = "OCaml Bindings to curses/ncurses";
33 homepage = "https://github.com/mbacarella/curses";
34 license = licenses.lgpl21Plus;
35 changelog = "https://github.com/mbacarella/curses/raw/${version}/CHANGES";
36 maintainers = [ ];
37 inherit (ocaml.meta) platforms;
38 };
39}