depot/third_party/nixpkgs/pkgs/development/ocaml-modules/curses/default.nix
Default email 93df2b837e Project import generated by Copybara.
GitOrigin-RevId: 18d4025a8ee2f656d897505ccd0ba61a5b89bbea
2021-10-08 17:17:17 +02:00

37 lines
958 B
Nix

{ 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";
};
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 = [ maintainers.volth ];
platforms = ocaml.meta.platforms or [];
};
}