From 53070a1c0668025e0b5219881b4ff5ef3d3bb215 Mon Sep 17 00:00:00 2001 From: pewpewnor <125549982+pewpewnor@users.noreply.github.com> Date: Thu, 13 Nov 2025 05:04:00 +0800 Subject: [PATCH 1/3] imgui-sfml: fix imgui dependency version (#8605) --- packages/i/imgui-sfml/xmake.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/i/imgui-sfml/xmake.lua b/packages/i/imgui-sfml/xmake.lua index 276d5d145cb..c4f1c8c7407 100644 --- a/packages/i/imgui-sfml/xmake.lua +++ b/packages/i/imgui-sfml/xmake.lua @@ -11,7 +11,6 @@ package("imgui-sfml") add_versions("v2.5", "3775c9303f656297f2392e91ffae2021e874ee319b4139c60076d6f757ede109") add_deps("cmake") - add_deps("imgui") add_deps("opengl", {optional = true}) if is_plat("windows", "mingw") then @@ -21,6 +20,11 @@ package("imgui-sfml") add_links("ImGui-SFML") on_load(function(package) + if package:version():eq("v3.0") then + package:add("deps", "imgui >=1.91.1 <=1.91.9") + else + package:add("deps", "imgui") + end if package:is_plat("linux") and package:config("shared") then package:add("deps", "sfml", {configs = {shared = true}}) else @@ -32,9 +36,11 @@ package("imgui-sfml") end) on_install("macosx", "linux", "windows", "mingw", function (package) - io.writefile("xmake.lua", [[ + local imgui_dep = package:dep("imgui") + local imgui_version = imgui_dep and " " .. imgui_dep:version_str() or "" + io.writefile("xmake.lua", string.format([[ add_rules("mode.release", "mode.debug") - add_requires("imgui") + add_requires("imgui%s") if is_plat("linux") and is_kind("shared") then add_requires("sfml", {configs = {shared = true}}) else @@ -57,7 +63,7 @@ package("imgui-sfml") end add_rules("utils.install.pkgconfig_importfiles") add_rules("utils.install.cmake_importfiles") - ]]) + ]], imgui_version)) local configs = {} if package:config("shared") then configs.kind = "shared" From 175942f3dfc4b8231b7901e15de0110c0f71095d Mon Sep 17 00:00:00 2001 From: pewpewnor <125549982+pewpewnor@users.noreply.github.com> Date: Thu, 20 Nov 2025 00:15:57 +0800 Subject: [PATCH 2/3] imgui-sfml: fix package test unused return value warning --- packages/i/imgui-sfml/xmake.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/i/imgui-sfml/xmake.lua b/packages/i/imgui-sfml/xmake.lua index c4f1c8c7407..9f52ed4330d 100644 --- a/packages/i/imgui-sfml/xmake.lua +++ b/packages/i/imgui-sfml/xmake.lua @@ -79,10 +79,11 @@ package("imgui-sfml") #include #include #include + #include void test() { - sf::RenderWindow window(sf::VideoMode({640, 480}), "ImGui + SFML = <3"); + sf::RenderWindow window(sf::VideoMode({640, 480}), "ImGui + SFML"); window.setFramerateLimit(60); - ImGui::SFML::Init(window); + std::ignore = ImGui::SFML::Init(window); } ]]}, {configs = {languages = "c++17"}})) end) From 756bddac215d8c5df080379d5550884c2c8a4255 Mon Sep 17 00:00:00 2001 From: pewpewnor <125549982+pewpewnor@users.noreply.github.com> Date: Thu, 20 Nov 2025 11:07:18 +0800 Subject: [PATCH 3/3] imgui-sfml: use add_deps auto version resolution --- packages/i/imgui-sfml/xmake.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/i/imgui-sfml/xmake.lua b/packages/i/imgui-sfml/xmake.lua index 9f52ed4330d..b7c385f6074 100644 --- a/packages/i/imgui-sfml/xmake.lua +++ b/packages/i/imgui-sfml/xmake.lua @@ -36,11 +36,9 @@ package("imgui-sfml") end) on_install("macosx", "linux", "windows", "mingw", function (package) - local imgui_dep = package:dep("imgui") - local imgui_version = imgui_dep and " " .. imgui_dep:version_str() or "" - io.writefile("xmake.lua", string.format([[ + io.writefile("xmake.lua", [[ add_rules("mode.release", "mode.debug") - add_requires("imgui%s") + add_requires("imgui") if is_plat("linux") and is_kind("shared") then add_requires("sfml", {configs = {shared = true}}) else @@ -63,7 +61,7 @@ package("imgui-sfml") end add_rules("utils.install.pkgconfig_importfiles") add_rules("utils.install.cmake_importfiles") - ]], imgui_version)) + ]]) local configs = {} if package:config("shared") then configs.kind = "shared"