From ecf8a7d3540a026caefb2c980b125fe3290a012c Mon Sep 17 00:00:00 2001 From: EZ4Stephen Date: Thu, 7 May 2026 16:14:38 +0400 Subject: [PATCH 1/8] Add glibmm (2.66.8, 2.88.0) to xrepo Adds the latest versions of glibmm-2.4 and glibmm-2.68 respectively, to xrepo. glibmm cannot be built static for msvc-like compilers though, per [glib/meson.build](https://gitlab.gnome.org/GNOME/glibmm/-/blob/master/glib/meson.build). --- packages/g/glibmm/xmake.lua | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 packages/g/glibmm/xmake.lua diff --git a/packages/g/glibmm/xmake.lua b/packages/g/glibmm/xmake.lua new file mode 100644 index 00000000000..86e16ea28bf --- /dev/null +++ b/packages/g/glibmm/xmake.lua @@ -0,0 +1,50 @@ +package("glibmm") + set_homepage("https://gtkmm.gnome.org") + set_description("A C++ API for parts of glib that are useful for C++.") + set_license("LGPL-2.1-or-later") + -- The giomm library is also built with glibmm. There isn't an option to separate them, under meson build system. + + add_urls("https://gitlab.gnome.org/GNOME/glibmm.git") + add_urls("https://download.gnome.org/sources/glibmm/$(version).tar.xz", {version = function (version) + return format("%d.%d/glibmm-%s", version:major(), version:minor(), version) + end}) + + add_versions("2.88.0", "a6549da3a6c43de83b8717dae5413c57a60d92f6ecc624615c612d0bb0ad0fe2") + add_versions("2.66.8", "64f11d3b95a24e2a8d4166ecff518730f79ecc27222ef41faf7c7e0340fc9329") + + add_configs("deprecated_api", {description = "Build deprecated API and include it in the library", default = false, type = "boolean"}) + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + + add_deps("meson", "ninja") + + on_load(function (package) + -- glibmm doesn't allow static build for MSVC-like compilers. + if package:is_plat("windows") then + package:config_set("shared", true) + end + + if package:version():lt("2.68") then + package:add("deps", "libsigcplusplus <3.0.0") + package:add("deps", "glib >=2.61.2") + else + package:add("deps", "libsigcplusplus >=3.0.0") + package:add("deps", "glib >=2.87.3") + end + + local abi = package:version() and package:version():lt("2.68") and "2.4" or "2.68" + package:add("includedirs", + "include/glibmm-" .. abi, + "lib/glibmm-" .. abi .. "/include", + "include/giomm-" .. abi, + "lib/giomm-" .. abi .. "/include") + end) + + on_install(function (package) + local configs = {"-Dbuild-documentation=false", "-Dbuild-examples=false"} + table.insert(configs, "-Dbuild-deprecated-api=" .. (package:config("deprecated_api") and "true" or "false")) + import("package.tools.meson").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxincludes("glibmm.h", {configs = {languages = "c++17"}})) + end) \ No newline at end of file From 8e11496199872acc298c73ff03bd1dea61421731 Mon Sep 17 00:00:00 2001 From: EZ4Stephen Date: Thu, 7 May 2026 19:15:00 +0400 Subject: [PATCH 2/8] Some fixes to glibmm's xmake.lua - Removed the readonly = true for shared library config - Added c++ language versions for the 2 abi's. - Excluded android, iphoneos, wasm and bsd due to not having the dependencies (though glibmm IS buildable on freebsd). --- packages/g/glibmm/xmake.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/g/glibmm/xmake.lua b/packages/g/glibmm/xmake.lua index 86e16ea28bf..ffe50eedf13 100644 --- a/packages/g/glibmm/xmake.lua +++ b/packages/g/glibmm/xmake.lua @@ -13,7 +13,7 @@ package("glibmm") add_versions("2.66.8", "64f11d3b95a24e2a8d4166ecff518730f79ecc27222ef41faf7c7e0340fc9329") add_configs("deprecated_api", {description = "Build deprecated API and include it in the library", default = false, type = "boolean"}) - add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) + add_configs("shared", {description = "Build shared library.", default = false, type = "boolean"}) add_deps("meson", "ninja") @@ -26,9 +26,11 @@ package("glibmm") if package:version():lt("2.68") then package:add("deps", "libsigcplusplus <3.0.0") package:add("deps", "glib >=2.61.2") + package:add("languages", "c++11") else package:add("deps", "libsigcplusplus >=3.0.0") package:add("deps", "glib >=2.87.3") + package:add("languages", "c++17") end local abi = package:version() and package:version():lt("2.68") and "2.4" or "2.68" @@ -39,12 +41,13 @@ package("glibmm") "lib/giomm-" .. abi .. "/include") end) - on_install(function (package) + on_install("!android" and "!wasm" and "!iphone" and "!bsd", function (package) local configs = {"-Dbuild-documentation=false", "-Dbuild-examples=false"} table.insert(configs, "-Dbuild-deprecated-api=" .. (package:config("deprecated_api") and "true" or "false")) + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) import("package.tools.meson").install(package, configs) end) on_test(function (package) assert(package:has_cxxincludes("glibmm.h", {configs = {languages = "c++17"}})) - end) \ No newline at end of file + end) From 66afebe2055db3f61def1d36591ac65333cf7994 Mon Sep 17 00:00:00 2001 From: EZ4Stephen Date: Thu, 7 May 2026 19:19:11 +0400 Subject: [PATCH 3/8] Fix platform exclusion - Remove extra double quotes. --- packages/g/glibmm/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/g/glibmm/xmake.lua b/packages/g/glibmm/xmake.lua index ffe50eedf13..6b281677940 100644 --- a/packages/g/glibmm/xmake.lua +++ b/packages/g/glibmm/xmake.lua @@ -41,7 +41,7 @@ package("glibmm") "lib/giomm-" .. abi .. "/include") end) - on_install("!android" and "!wasm" and "!iphone" and "!bsd", function (package) + on_install("!android and !wasm and !iphone and !bsd", function (package) local configs = {"-Dbuild-documentation=false", "-Dbuild-examples=false"} table.insert(configs, "-Dbuild-deprecated-api=" .. (package:config("deprecated_api") and "true" or "false")) table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) From b17206696a7972b897b3c9727c87be72f514b678 Mon Sep 17 00:00:00 2001 From: EZ4Stephen Date: Thu, 7 May 2026 19:23:07 +0400 Subject: [PATCH 4/8] Fix for iphoneos exclusion --- packages/g/glibmm/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/g/glibmm/xmake.lua b/packages/g/glibmm/xmake.lua index 6b281677940..64a69a51b01 100644 --- a/packages/g/glibmm/xmake.lua +++ b/packages/g/glibmm/xmake.lua @@ -41,7 +41,7 @@ package("glibmm") "lib/giomm-" .. abi .. "/include") end) - on_install("!android and !wasm and !iphone and !bsd", function (package) + on_install("!android and !wasm and !iphoneos and !bsd", function (package) local configs = {"-Dbuild-documentation=false", "-Dbuild-examples=false"} table.insert(configs, "-Dbuild-deprecated-api=" .. (package:config("deprecated_api") and "true" or "false")) table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) From 4e14018741256cad80a2b8e043ee5ff131215597 Mon Sep 17 00:00:00 2001 From: EZ4Stephen Date: Sat, 9 May 2026 00:00:57 +0400 Subject: [PATCH 5/8] Attempt to fix shared build Unsure if this fixes the MinGW builds, but probably a better representation of the check of msvc-like compilers. --- packages/g/glibmm/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/g/glibmm/xmake.lua b/packages/g/glibmm/xmake.lua index 64a69a51b01..beb7cbd369d 100644 --- a/packages/g/glibmm/xmake.lua +++ b/packages/g/glibmm/xmake.lua @@ -19,7 +19,7 @@ package("glibmm") on_load(function (package) -- glibmm doesn't allow static build for MSVC-like compilers. - if package:is_plat("windows") then + if package:toolchain("msvc") then package:config_set("shared", true) end From 47bbc0796da99598a7f57d2bc3943208363a142c Mon Sep 17 00:00:00 2001 From: EZ4Stephen Date: Sat, 9 May 2026 20:03:44 +0400 Subject: [PATCH 6/8] Prevent building generate_defs_glib.exe, generate_defs_gio.exe. Attempts to fix mingw builds. --- packages/g/glibmm/xmake.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/g/glibmm/xmake.lua b/packages/g/glibmm/xmake.lua index beb7cbd369d..2ea3153a116 100644 --- a/packages/g/glibmm/xmake.lua +++ b/packages/g/glibmm/xmake.lua @@ -42,6 +42,10 @@ package("glibmm") end) on_install("!android and !wasm and !iphoneos and !bsd", function (package) + -- Prevent building generate_defs_glib, generate_defs_gio. Otherwise when being built, + -- errors arise on mingw builds. Doesn't hurt to filter for all platforms. + io.replace(path.join(package:sourcedir(), "tools/extra_defs_gen/meson.build"), + "executable(", "# executable(", {plain = true}) local configs = {"-Dbuild-documentation=false", "-Dbuild-examples=false"} table.insert(configs, "-Dbuild-deprecated-api=" .. (package:config("deprecated_api") and "true" or "false")) table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) From 2fc9b9978c6a2e78f93485e44e91cfcd6def7a48 Mon Sep 17 00:00:00 2001 From: EZ4Stephen Date: Sat, 9 May 2026 20:18:56 +0400 Subject: [PATCH 7/8] Fix path for replacing string to prevent building generate_defs_glib/gio. --- packages/g/glibmm/xmake.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/g/glibmm/xmake.lua b/packages/g/glibmm/xmake.lua index 2ea3153a116..2bf4c0ed272 100644 --- a/packages/g/glibmm/xmake.lua +++ b/packages/g/glibmm/xmake.lua @@ -44,8 +44,7 @@ package("glibmm") on_install("!android and !wasm and !iphoneos and !bsd", function (package) -- Prevent building generate_defs_glib, generate_defs_gio. Otherwise when being built, -- errors arise on mingw builds. Doesn't hurt to filter for all platforms. - io.replace(path.join(package:sourcedir(), "tools/extra_defs_gen/meson.build"), - "executable(", "# executable(", {plain = true}) + io.replace("tools/extra_defs_gen/meson.build", "executable(", "# executable(", {plain = true}) local configs = {"-Dbuild-documentation=false", "-Dbuild-examples=false"} table.insert(configs, "-Dbuild-deprecated-api=" .. (package:config("deprecated_api") and "true" or "false")) table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) From b5d48b196f74b53538040146c6d53f7419fdc87c Mon Sep 17 00:00:00 2001 From: EZ4Stephen Date: Sat, 9 May 2026 20:32:03 +0400 Subject: [PATCH 8/8] 3rd attempt at excluding building 2 .exe's --- packages/g/glibmm/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/g/glibmm/xmake.lua b/packages/g/glibmm/xmake.lua index 2bf4c0ed272..d8517ee1a21 100644 --- a/packages/g/glibmm/xmake.lua +++ b/packages/g/glibmm/xmake.lua @@ -44,7 +44,7 @@ package("glibmm") on_install("!android and !wasm and !iphoneos and !bsd", function (package) -- Prevent building generate_defs_glib, generate_defs_gio. Otherwise when being built, -- errors arise on mingw builds. Doesn't hurt to filter for all platforms. - io.replace("tools/extra_defs_gen/meson.build", "executable(", "# executable(", {plain = true}) + io.replace("tools/extra_defs_gen/meson.build", "%s*executable%b()", "", {pattern = true, multiline = true}) local configs = {"-Dbuild-documentation=false", "-Dbuild-examples=false"} table.insert(configs, "-Dbuild-deprecated-api=" .. (package:config("deprecated_api") and "true" or "false")) table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))