From 8afcfb2bb6681c56ecf21e056d91d6748d953997 Mon Sep 17 00:00:00 2001
From: Tuomas Tynkkynen <tuomas@tuxera.com>
Date: Fri, 23 Feb 2018 01:54:50 +0200
Subject: [PATCH] ocamlPackages.curses: Fix build after ncurses5 changes

Fixes build after commit 3d24ae9b4426bb8adfcb08de57be21fdf0a377f8:

https://github.com/NixOS/nixpkgs/commit/3d24ae9b4426bb8adfcb08de57be21fdf0a377f8#commitcomment-27714305

Thanks to dtzWill for the pointer:
https://github.com/NixOS/nixpkgs/pull/34477#issuecomment-367359351
---
 pkgs/development/ocaml-modules/curses/default.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pkgs/development/ocaml-modules/curses/default.nix b/pkgs/development/ocaml-modules/curses/default.nix
index 4fd75e7aac53..eebb2f68f3dd 100644
--- a/pkgs/development/ocaml-modules/curses/default.nix
+++ b/pkgs/development/ocaml-modules/curses/default.nix
@@ -13,6 +13,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ocaml findlib ];
 
+  # Fix build for recent ncurses versions
+  NIX_CFLAGS_COMPILE = [ "-DNCURSES_INTERNALS=1" ];
+
   createFindlibDestdir = true;
 
   postPatch = ''