about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/imtui
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/imtui')
-rw-r--r--nixpkgs/pkgs/development/libraries/imtui/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/development/libraries/imtui/default.nix b/nixpkgs/pkgs/development/libraries/imtui/default.nix
index e534a55ae5a4..86b488c1a888 100644
--- a/nixpkgs/pkgs/development/libraries/imtui/default.nix
+++ b/nixpkgs/pkgs/development/libraries/imtui/default.nix
@@ -8,6 +8,7 @@
 , withCurl ? (!withEmscripten), curl
 , withNcurses ? (!withEmscripten), ncurses
 , static ? withEmscripten
+, darwin
 }:
 
 stdenv.mkDerivation rec {
@@ -25,10 +26,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = lib.optional withEmscripten emscripten
     ++ lib.optional withCurl curl
-    ++ lib.optional withNcurses ncurses;
+    ++ lib.optional withNcurses ncurses
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa;
 
   postPatch = ''
     cp -r ${imgui}/include/imgui third-party/imgui
+  '' + lib.optionalString (lib.versionAtLeast imgui.version "1.90.1") ''
+    substituteInPlace src/imtui-impl-{emscripten,ncurses}.cpp \
+      --replace "ImGuiKey_KeyPadEnter" "ImGuiKey_KeypadEnter"
   '';
 
   cmakeFlags = [
@@ -54,5 +59,6 @@ stdenv.mkDerivation rec {
     changelog = "https://github.com/ggerganov/imtui/blob/${src.rev}/CHANGELOG.md";
     license = licenses.mit;
     maintainers = with maintainers; [ azahi ];
+    platforms = platforms.unix;
   };
 }