Skip to content

Commit

Permalink
Merge pull request #315917 from wegank/imgui-darwin
Browse files Browse the repository at this point in the history
imgui: fix build on darwin
  • Loading branch information
SomeoneSerge authored May 30, 2024
2 parents 4c9c9a8 + d9ebd6b commit b8d134f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions pkgs/development/libraries/imgui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ stdenv.mkDerivation rec {

buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.ApplicationServices
darwin.apple_sdk.frameworks.Cocoa
darwin.apple_sdk.frameworks.GameController
];

propagatedBuildInputs =
Expand Down
7 changes: 2 additions & 5 deletions pkgs/development/libraries/imtui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ stdenv.mkDerivation rec {
++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa;

postPatch = ''
cp -r ${imgui}/include/imgui third-party/imgui
cp -r ${imgui.src}/* third-party/imgui/imgui
chmod -R u+w third-party/imgui
'' + lib.optionalString (lib.versionAtLeast imgui.version "1.90.1") ''
substituteInPlace src/imtui-impl-{emscripten,ncurses}.cpp \
--replace "ImGuiKey_KeyPadEnter" "ImGuiKey_KeypadEnter"
Expand All @@ -45,10 +46,6 @@ stdenv.mkDerivation rec {
"-DIMTUI_INSTALL_IMGUI_HEADERS:BOOL=OFF"
];

postInstall = ''
rm -rf $out/include/imgui
'';

meta = with lib; {
description = "Immediate mode text-based user interface library";
longDescription = ''
Expand Down
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21466,7 +21466,9 @@ with pkgs;

ilmbase = callPackage ../development/libraries/ilmbase { };

imgui = callPackage ../development/libraries/imgui { };
imgui = callPackage ../development/libraries/imgui {
stdenv = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv;
};

imtui = callPackage ../development/libraries/imtui { };

Expand Down

0 comments on commit b8d134f

Please sign in to comment.