MangoHud icon indicating copy to clipboard operation
MangoHud copied to clipboard

Bump dependencies to upstream version

Open gbschenkel opened this issue 8 months ago • 6 comments

Hi, I was wondering if we could bump the subprojects to a newer version.

I was able to upgrade and build this ones

diff -Naur MangoHud-0.8.1/subprojects/cmocka.wrap MangoHud-0.8.1-alt/subprojects/cmocka.wrap
--- MangoHud-0.8.1/subprojects/cmocka.wrap	2025-03-05 06:56:10.000000000 -0300
+++ MangoHud-0.8.1-alt/subprojects/cmocka.wrap	2024-08-16 16:38:59.000000000 -0300
@@ -1,5 +1,13 @@
-[wrap-git]
-url = https://gitlab.com/cmocka/cmocka.git
-revision = 59dc0013f9f29fcf212fe4911c78e734263ce24c
-depth = 1
-branch = master
\ No newline at end of file
+[wrap-file]
+directory = cmocka-1.1.7
+source_url = https://cmocka.org/files/1.1/cmocka-1.1.7.tar.xz
+source_filename = cmocka-1.1.7.tar.xz
+source_hash = 810570eb0b8d64804331f82b29ff47c790ce9cd6b163e98d47a4807047ecad82
+patch_filename = cmocka_1.1.7-3_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/cmocka_1.1.7-3/get_patch
+patch_hash = 527c16d9819a69e69e807eadb4d101cc93b99858120da239da07208562a83d55
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/cmocka_1.1.7-3/cmocka-1.1.7.tar.xz
+wrapdb_version = 1.1.7-3
+
+[provide]
+cmocka = cmocka_dep
diff -Naur MangoHud-0.8.1/subprojects/nlohmann_json.wrap MangoHud-0.8.1-alt/subprojects/nlohmann_json.wrap
--- MangoHud-0.8.1/subprojects/nlohmann_json.wrap	2025-03-05 06:56:10.000000000 -0300
+++ MangoHud-0.8.1-alt/subprojects/nlohmann_json.wrap	2025-04-13 02:25:37.000000000 -0300
@@ -1,10 +1,11 @@
 [wrap-file]
-directory = nlohmann_json-3.10.5
+directory = nlohmann_json-3.12.0
 lead_directory_missing = true
-source_url = https://github.com/nlohmann/json/releases/download/v3.10.5/include.zip
-source_filename = nlohmann_json-3.10.5.zip
-source_hash = b94997df68856753b72f0d7a3703b7d484d4745c567f3584ef97c96c25a5798e
+source_url = https://github.com/nlohmann/json/releases/download/v3.12.0/include.zip
+source_filename = nlohmann_json-3.12.0.zip
+source_hash = b8cb0ef2dd7f57f18933997c9934bb1fa962594f701cd5a8d3c2c80541559372
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/nlohmann_json_3.12.0-1/nlohmann_json-3.12.0.zip
+wrapdb_version = 3.12.0-1
 
 [provide]
 nlohmann_json = nlohmann_json_dep
-
diff -Naur MangoHud-0.8.1/subprojects/spdlog.wrap MangoHud-0.8.1-alt/subprojects/spdlog.wrap
--- MangoHud-0.8.1/subprojects/spdlog.wrap	2025-03-05 06:56:10.000000000 -0300
+++ MangoHud-0.8.1-alt/subprojects/spdlog.wrap	2025-04-21 22:16:34.000000000 -0300
@@ -1,13 +1,13 @@
 [wrap-file]
-directory = spdlog-1.14.1
-source_url = https://github.com/gabime/spdlog/archive/refs/tags/v1.14.1.tar.gz
-source_filename = spdlog-1.14.1.tar.gz
-source_hash = 1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b
-patch_filename = spdlog_1.14.1-1_patch.zip
-patch_url = https://wrapdb.mesonbuild.com/v2/spdlog_1.14.1-1/get_patch
-patch_hash = ae878e732330ea1048f90d7e117c40c0cd2a6fb8ae5492c7955818ce3aaade6c
-source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/spdlog_1.14.1-1/spdlog-1.14.1.tar.gz
-wrapdb_version = 1.14.1-1
+directory = spdlog-1.15.2
+source_url = https://github.com/gabime/spdlog/archive/refs/tags/v1.15.2.tar.gz
+source_filename = spdlog-1.15.2.tar.gz
+source_hash = 7a80896357f3e8e920e85e92633b14ba0f229c506e6f978578bdc35ba09e9a5d
+patch_filename = spdlog_1.15.2-3_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/spdlog_1.15.2-3/get_patch
+patch_hash = d5ab078661f571ef5113a8e4bc5c4121e16c044e7772a24b44b1ca8f3ee7c6cb
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/spdlog_1.15.2-3/spdlog-1.15.2.tar.gz
+wrapdb_version = 1.15.2-3
 
 [provide]
 spdlog = spdlog_dep
diff -Naur MangoHud-0.8.1/subprojects/vulkan-headers.wrap MangoHud-0.8.1-alt/subprojects/vulkan-headers.wrap
--- MangoHud-0.8.1/subprojects/vulkan-headers.wrap	2025-03-05 06:56:10.000000000 -0300
+++ MangoHud-0.8.1-alt/subprojects/vulkan-headers.wrap	2024-05-04 11:04:35.000000000 -0300
@@ -1,9 +1,9 @@
 [wrap-file]
-directory = Vulkan-Headers-1.2.158
-source_url = https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.158.tar.gz
-source_filename = vulkan-headers-1.2.158.tar.gz
-source_hash = 53361271cfe274df8782e1e47bdc9e61b7af432ba30acbfe31723f9df2c257f3
-patch_url = https://wrapdb.mesonbuild.com/v2/vulkan-headers_1.2.158-2/get_patch
-patch_filename = vulkan-headers-1.2.158-2-wrap.zip
-patch_hash = 860358cf5e73f458cd1e88f8c38116d123ab421d5ce2e4129ec38eaedd820e17
+directory = Vulkan-Headers-1.2.203
+source_url = https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.2.203.tar.gz
+source_filename = vulkan-headers-1.2.203.tar.gz
+source_hash = 7239108c372f1fbe365bd8d1610ca2bb4e72b73b2151f2551bf9df54dd539639
+patch_filename = vulkan-headers_1.2.203-1_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/vulkan-headers_1.2.203-1/get_patch
+patch_hash = 4293bee9450ba3ff87d1c8c94e6107a0a5f8003f0120bf606010db0cae4a0e3b

Imgui couldn't use the latest version, didn't check yet others. Vulkan-Headers I could update to just a newer version than mangohud currently use, the latest version crash the compilation of MangoHud, appears some functions are now deprecated/changed.

gbschenkel avatar May 14 '25 20:05 gbschenkel

Is there a reason to bump them? are there new features you'd like to use in mangohud?

flightlessmango avatar May 15 '25 16:05 flightlessmango

Not really, I just thought it could be tough to maintain it when the dependencies changed too much between spaced versions. I am currently a SlackBuilds.org package maintainer, but MangoHud is not maintained by me, but I upgrade it soon I can on https://gitlab.com/slackware-brazil/slackbuilds, in SlackBuilds we provide all deps "not allowing" the project download it for anyway, in the case of MangoHud, all deps are downloaded before meson setup is been called. I wrongly have updated the deps on SlackBuild, but then I checked the build and saw the meson was downloading the "old" version, that is why I created this issue. I am more a DevOps guy than a Developer.

gbschenkel avatar May 15 '25 16:05 gbschenkel

Is there a reason to bump them? are there new features you'd like to use in mangohud?

Is there any reason to put existing external projects as "subprojects"? This only creates mess for distribution package maintainers. Especially if the only change from upstream is meson build file.

@gbschenkel you may just drop "subprojects" and use upstream packages, like gentoo ebuilds do:

src_prepare() {
	default
	# replace all occurences of "#include <imgui.h>" to "#include <imgui/imgui.h>"
	find . -type f -exec sed -i 's|<imgui.h>|<imgui/imgui.h>|g' {} \; || die
	find . -type f -exec sed -i 's|"imgui.h"|<imgui/imgui.h>|g' {} \; || die
	find . -type f -exec sed -i 's|<imgui_internal.h>|<imgui/imgui_internal.h>|g' {} \; || die
	find . -type f -exec sed -i 's|"imgui_internal.h"|<imgui/imgui_internal.h>|g' {} \; || die
	find . -type f -exec sed -i 's|"imgui_impl_glfw.h"|<imgui/imgui_impl_glfw.h>|g' {} \; || die
	find . -type f -exec sed -i 's|"imgui_impl_opengl3.h"|<imgui/imgui_impl_opengl3.h>|g' {} \; || die
}

Here is an example https://data.gpo.zugaina.org/guru/games-util/mangohud/mangohud-0.8.1.ebuild

Perlovka avatar Jun 28 '25 21:06 Perlovka

Imgui couldn't use the latest version

imgui 1.91 should work with no edits, 1.92 refactored textures (now using TextureRefs, referring to the Texture[] array) and font atlases.

TextureRefs can be used in-place of legacy TextureIDs while IMGUI_DISABLE_OBSOLETE_FUNCTIONS is NOT defined.

This which works for the OpenGL backend, however due to the vulkan backend in mangohud, some refactors will need to be made for the new ImFontAtlas logic as that will fail at the moment.

Three assertions get hit;

  • ImGui::UpdateTexturesNewFrame(): Assertion 'atlas->Builder != __null && atlas->Builder->FrameCount != -1' if TextureRefs are used and the global Font Context is NOT the one made by the vulkan backend.
  • ImFontAtlasRemoveDrawListSharedData(ImFontAtlas *, ImDrawListSharedData *): Assertion 'atlas->DrawListSharedDatas.contains(data)' failed. if TextureRefs are used and the global Font Context is the one made by the vulkan backend.
  • Backend does not support ImGuiBackendFlags_RendererHasTextures, and font atlas is not built! Update backend OR make sure you called ImGui_ImplXXXX_NewFrame() function for renderer backend, which should call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8(). which happens if font textures are built entirely by imgui internally.

Imgui has marked the old texture id logic as obsolete, and will probably be removed eventually for the new texture references logic.

neptuwunium avatar Aug 16 '25 19:08 neptuwunium

imgui 1.91 should work with no edits

Nope, there was some breaking changes in 1.90, like following:

Commented out obsolete redirecting enums/functions that were marked obsolete two years ago:
GetWindowContentRegionWidth() -> use GetWindowContentRegionMax().x - GetWindowContentRegionMin().x
Consider that generally GetContentRegionAvail().x is often more correct and more useful.

https://github.com/ocornut/imgui/releases/tag/v1.90

Perlovka avatar Oct 28 '25 21:10 Perlovka

That's still significantly less work than using the entire new TextureID system, but you're right.

neptuwunium avatar Oct 29 '25 00:10 neptuwunium