From a33c263d256dd3a1a99e41fa56ca6bc48976fa00 Mon Sep 17 00:00:00 2001
Message-Id: <a33c263d256dd3a1a99e41fa56ca6bc48976fa00.1687395567.git.john.kehayias@protonmail.com>
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 21 Jun 2023 20:57:10 -0400
Subject: [PATCH] gnu: imgui-1.86: Fix build for mangohud.
* gnu/packages/toolkits.scm (imgui-1.86)[phases]{build}: Inherit from imgui
but remove "-DImDrawIdx=unsigned int" as this breaks mangohud, the only user
of this package.
---
gnu/packages/toolkits.scm | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
@@ -164,4 +164,34 @@ (define-public imgui-1.86
(file-name (git-file-name name version))
(sha256
(base32
- "02a7b05zrka20jhzag2jb4jl624i1m456bsv69jb9zgys2p9dv1n"))))))
+ "02a7b05zrka20jhzag2jb4jl624i1m456bsv69jb9zgys2p9dv1n"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments imgui)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ ;; Same build phase as for imgui just without
+ ;; "-DImDrawIdx=unsigned int" as this breaks mangohud,
+ ;; the only user of this version.
+ (replace 'build
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Build main library.
+ (apply invoke #$(cc-for-target)
+ "-I" (getcwd)
+ "-I" (search-input-directory inputs "include/freetype2")
+ "-g" "-O2" "-fPIC" "-shared"
+ "-lGL" "-lSDL2" "-lglfw"
+ "-o" "libimgui.so"
+ "imgui.cpp"
+ "imgui_draw.cpp"
+ "imgui_tables.cpp"
+ "imgui_widgets.cpp"
+ ;; Include the supported backends.
+ "backends/imgui_impl_glfw.cpp"
+ (if (file-exists? "backends/imgui_impl_sdl2.cpp")
+ "backends/imgui_impl_sdl2.cpp"
+ "backends/imgui_impl_sdl.cpp")
+ "backends/imgui_impl_opengl2.cpp"
+ "backends/imgui_impl_opengl3.cpp"
+ ;; Include wrappers for C++ standard library (STL) and
+ ;; fontconfig.
+ (find-files "misc" "\\.cpp$"))))))))))
base-commit: dcca13ed7340f17a33a4c0907c13b64d5da66a8e
--
2.40.1