From 8c7d14a9af0f4c823047b7f725ad925493bfac7d Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 28 Dec 2023 18:06:41 +0200 Subject: [PATCH 1/4] glibmm: add v2.78.0, simplify patching --- recipes/glibmm/all/conandata.yml | 12 ++----- recipes/glibmm/all/conanfile.py | 28 +++++++++------- .../patches/enable_static_libs_2_66_4.patch | 32 ------------------- .../patches/enable_static_libs_2_72_1.patch | 32 ------------------- .../patches/enable_static_libs_2_75_0.patch | 32 ------------------- recipes/glibmm/config.yml | 2 ++ 6 files changed, 22 insertions(+), 116 deletions(-) delete mode 100644 recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch delete mode 100644 recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch delete mode 100644 recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch diff --git a/recipes/glibmm/all/conandata.yml b/recipes/glibmm/all/conandata.yml index 171a01a50da60..87869e74a977a 100644 --- a/recipes/glibmm/all/conandata.yml +++ b/recipes/glibmm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.78.0": + url: "https://download.gnome.org/sources/glibmm/2.78/glibmm-2.78.0.tar.xz" + sha256: "5d2e872564996f02a06d8bbac3677e7c394af8b00dd1526aebd47af842a3ef50" "2.75.0": url: "https://download.gnome.org/sources/glibmm/2.75/glibmm-2.75.0.tar.xz" sha256: "60bb12e66488aa8ce41f0eb2f3612f89f5ddc887e3e4d45498524bf60b266b3d" @@ -11,23 +14,14 @@ sources: patches: "2.75.0": - - patch_file: "patches/enable_static_libs_2_75_0.patch" - patch_type: portability - patch_description: enable static library build for msvc - patch_file: "patches/fix_initialization_order_fiasco_2_75_0.patch" patch_type: bugfix patch_description: fix initialization order for static library "2.72.1": - - patch_file: "patches/enable_static_libs_2_72_1.patch" - patch_type: portability - patch_description: enable static library build for msvc - patch_file: "patches/fix_initialization_order_fiasco_2_72_1.patch" patch_type: bugfix patch_description: fix initialization order for static library "2.66.4": - - patch_file: "patches/enable_static_libs_2_66_4.patch" - patch_type: portability - patch_description: enable static library build for msvc - patch_file: "patches/fix_initialization_order_fiasco_2_66_4.patch" patch_type: bugfix patch_description: fix initialization order for static library diff --git a/recipes/glibmm/all/conanfile.py b/recipes/glibmm/all/conanfile.py index a6d3f4c904bd4..8df15cac19fa8 100644 --- a/recipes/glibmm/all/conanfile.py +++ b/recipes/glibmm/all/conanfile.py @@ -67,15 +67,14 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - if self.options.shared: - wildcard = "" if Version(conan_version) < "2.0.0" else "/*" + wildcard = "" if conan_version.major == 1 else "/*" self.options[f"glib{wildcard}"].shared = True def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.78.0", transitive_headers=True) + self.requires("glib/2.78.3", transitive_headers=True) if self._abi_version == "2.68": self.requires("libsigcpp/3.0.7", transitive_headers=True) else: @@ -96,10 +95,15 @@ def validate(self): if self.dependencies["glib"].options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Linking shared glib with the MSVC static runtime is not supported") + if not self.options.shared and Version(self.version) >= "2.78": + # The project does not support static builds out of the box + # and extensive patching is required, including at the source code level. + raise ConanInvalidConfiguration("Static builds are not supported") + def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.3.1") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.0.3") + self.tool_requires("pkgconf/2.1.0") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -129,12 +133,9 @@ def _patch_sources(self): # when building a static build !defined(GLiBMM_GEN_EXTRA_DEFS_STATIC) # evaluates to 0 if not self.options.shared: - replace_in_file(self, - os.path.join(self.source_folder, "tools", - "extra_defs_gen", "generate_extra_defs.h"), - "#if defined (_MSC_VER) && !defined (GLIBMM_GEN_EXTRA_DEFS_STATIC)", - "#if 0", - ) + replace_in_file(self, os.path.join(self.source_folder, "tools", "extra_defs_gen", "generate_extra_defs.h"), + "#if defined (_MSC_VER) && !defined (GLIBMM_GEN_EXTRA_DEFS_STATIC)", + "#if 0") # when using cpp_std=c++NM the /permissive- flag is added which # attempts enforcing standard conformant c++ code @@ -142,6 +143,11 @@ def _patch_sources(self): # conformant! see: # https://developercommunity.visualstudio.com/t/error-c2760-in-combaseapih-with-windows-sdk-81-and/185399 replace_in_file(self, meson_build, "cpp_std=c++", "cpp_std=vc++") + if not self.options.shared: + replace_in_file(self, os.path.join(self.source_folder, "glib", "glibmmconfig.h.meson"), + "# define GLIBMM_DLL 1", "# define GLIBMM_DLL 0") + replace_in_file(self, os.path.join(self.source_folder, "glib", "meson.build"), + "error('Static builds are not supported by MSVC-style builds')", "") def build(self): self._patch_sources() diff --git a/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch b/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch deleted file mode 100644 index c94b5200949f7..0000000000000 --- a/recipes/glibmm/all/patches/enable_static_libs_2_66_4.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson -index e50dcccf..19e64a46 100644 ---- a/glib/glibmmconfig.h.meson -+++ b/glib/glibmmconfig.h.meson -@@ -47,7 +47,9 @@ - # if defined(_MSC_VER) - # define GLIBMM_MSC 1 - # define GLIBMM_WIN32 1 --# define GLIBMM_DLL 1 -+# ifndef GLIBMM_STATIC_LIB -+# define GLIBMM_DLL 1 -+# endif - # elif defined(__CYGWIN__) - # define GLIBMM_CONFIGURE 1 - # elif defined(__MINGW32__) -diff --git a/glib/meson.build b/glib/meson.build -index 4feee0fd..9382645a 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -36,12 +36,6 @@ pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) - - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - if library_build_type == 'static' - pkg_conf_data.set('GLIBMM_STATIC_LIB', 1) - pkg_conf_data.set('GIOMM_STATIC_LIB', 1) diff --git a/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch b/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch deleted file mode 100644 index b9ec412d84d2e..0000000000000 --- a/recipes/glibmm/all/patches/enable_static_libs_2_72_1.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson -index ef4753d..58b343c 100644 ---- a/glib/glibmmconfig.h.meson -+++ b/glib/glibmmconfig.h.meson -@@ -27,7 +27,9 @@ - # if defined(_MSC_VER) - # define GLIBMM_MSC 1 - # define GLIBMM_WIN32 1 --# define GLIBMM_DLL 1 -+# ifndef GLIBMM_STATIC_LIB -+# define GLIBMM_DLL 1 -+# endif - # elif defined(__CYGWIN__) - # define GLIBMM_CONFIGURE 1 - # elif defined(__MINGW32__) -diff --git a/glib/meson.build b/glib/meson.build -index 0c20a91..6b8baa0 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -36,12 +36,6 @@ pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) - - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - if library_build_type == 'static' - pkg_conf_data.set('GLIBMM_STATIC_LIB', 1) - pkg_conf_data.set('GIOMM_STATIC_LIB', 1) diff --git a/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch b/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch deleted file mode 100644 index f24c64bb5bd54..0000000000000 --- a/recipes/glibmm/all/patches/enable_static_libs_2_75_0.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/glib/glibmmconfig.h.meson b/glib/glibmmconfig.h.meson -index ef4753d7..b926720b 100644 ---- a/glib/glibmmconfig.h.meson -+++ b/glib/glibmmconfig.h.meson -@@ -27,7 +27,9 @@ - # if defined(_MSC_VER) - # define GLIBMM_MSC 1 - # define GLIBMM_WIN32 1 --# define GLIBMM_DLL 1 -+# ifndef GLIBMM_STATIC_LIB -+# define GLIBMM_DLL 1 -+# endif - # elif defined(__CYGWIN__) - # define GLIBMM_CONFIGURE 1 - # elif defined(__MINGW32__) -diff --git a/glib/meson.build b/glib/meson.build -index d16621e9..3eb8bc47 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -37,12 +37,6 @@ pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) - - library_build_type = get_option('default_library') - --if cpp_compiler.get_argument_syntax() == 'msvc' -- if library_build_type == 'static' or library_build_type == 'both' -- error('Static builds are not supported by MSVC-style builds') -- endif --endif -- - if library_build_type == 'static' - pkg_conf_data.set('GLIBMM_STATIC_LIB', 1) - pkg_conf_data.set('GIOMM_STATIC_LIB', 1) diff --git a/recipes/glibmm/config.yml b/recipes/glibmm/config.yml index 6aaa4e9d859bb..774ad09bc1cf5 100644 --- a/recipes/glibmm/config.yml +++ b/recipes/glibmm/config.yml @@ -1,4 +1,6 @@ versions: + "2.78.0": + folder: "all" "2.75.0": folder: "all" "2.72.1": From 484ca4d3fe79ae03413917565a80f2ba8112e96a Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 28 Dec 2023 18:31:33 +0200 Subject: [PATCH 2/4] glibmm: drop static build support --- recipes/glibmm/all/conandata.yml | 14 -- recipes/glibmm/all/conanfile.py | 72 +------- ...x_initialization_order_fiasco_2_66_4.patch | 163 ------------------ ...x_initialization_order_fiasco_2_72_1.patch | 95 ---------- ...x_initialization_order_fiasco_2_75_0.patch | 84 --------- 5 files changed, 7 insertions(+), 421 deletions(-) delete mode 100644 recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch delete mode 100644 recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch delete mode 100644 recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch diff --git a/recipes/glibmm/all/conandata.yml b/recipes/glibmm/all/conandata.yml index 87869e74a977a..8c7e5d9b0ff57 100644 --- a/recipes/glibmm/all/conandata.yml +++ b/recipes/glibmm/all/conandata.yml @@ -11,17 +11,3 @@ sources: "2.66.4": url: "https://download.gnome.org/sources/glibmm/2.66/glibmm-2.66.4.tar.xz" sha256: "199ace5682d81b15a1d565480b4a950682f2db6402c8aa5dd7217d71edff81d5" - -patches: - "2.75.0": - - patch_file: "patches/fix_initialization_order_fiasco_2_75_0.patch" - patch_type: bugfix - patch_description: fix initialization order for static library - "2.72.1": - - patch_file: "patches/fix_initialization_order_fiasco_2_72_1.patch" - patch_type: bugfix - patch_description: fix initialization order for static library - "2.66.4": - - patch_file: "patches/fix_initialization_order_fiasco_2_66_4.patch" - patch_type: bugfix - patch_description: fix initialization order for static library diff --git a/recipes/glibmm/all/conanfile.py b/recipes/glibmm/all/conanfile.py index 8df15cac19fa8..e24da677d7d77 100644 --- a/recipes/glibmm/all/conanfile.py +++ b/recipes/glibmm/all/conanfile.py @@ -1,22 +1,13 @@ -import os import glob +import os import shutil -from conan import ConanFile, conan_version +from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import check_min_cppstd from conan.tools.env import VirtualBuildEnv -from conan.tools.files import ( - apply_conandata_patches, - copy, - export_conandata_patches, - get, - replace_in_file, - rename, - rm, - rmdir -) +from conan.tools.files import copy, get, replace_in_file, rm, rmdir from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain @@ -33,16 +24,8 @@ class GlibmmConan(ConanFile): url = "/~https://github.com/conan-io/conan-center-index" description = "glibmm is a C++ API for parts of glib that are useful for C++." topics = ("giomm",) - package_type = "library" + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" - options = { - "shared": [True, False], - "fPIC": [True, False], - } - default_options = { - "shared": False, - "fPIC": True, - } short_paths = True @property @@ -57,18 +40,8 @@ def _glibmm_lib(self): def _giomm_lib(self): return f"giomm-{self._abi_version}" - def export_sources(self): - export_conandata_patches(self) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - wildcard = "" if conan_version.major == 1 else "/*" - self.options[f"glib{wildcard}"].shared = True + self.options["glib"].shared = True def layout(self): basic_layout(self, src_folder="src") @@ -82,12 +55,12 @@ def requirements(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - if self._abi_version == "2.68": + if Version(self._abi_version) >= "2.68": check_min_cppstd(self, 17) else: check_min_cppstd(self, 11) - if self.options.shared and not self.dependencies["glib"].options.shared: + if not self.dependencies["glib"].options.shared: raise ConanInvalidConfiguration( "Linking a shared library against static glib can cause unexpected behaviour." ) @@ -95,11 +68,6 @@ def validate(self): if self.dependencies["glib"].options.shared and is_msvc_static_runtime(self): raise ConanInvalidConfiguration("Linking shared glib with the MSVC static runtime is not supported") - if not self.options.shared and Version(self.version) >= "2.78": - # The project does not support static builds out of the box - # and extensive patching is required, including at the source code level. - raise ConanInvalidConfiguration("Static builds are not supported") - def build_requirements(self): self.tool_requires("meson/1.3.1") if not self.conf.get("tools.gnu:pkg_config", check_type=str): @@ -124,30 +92,15 @@ def generate(self): tc.generate() def _patch_sources(self): - apply_conandata_patches(self) meson_build = os.path.join(self.source_folder, "meson.build") replace_in_file(self, meson_build, "subdir('tests')", "") if is_msvc(self): - # GLiBMM_GEN_EXTRA_DEFS_STATIC is not defined anywhere and is not - # used anywhere except here - # when building a static build !defined(GLiBMM_GEN_EXTRA_DEFS_STATIC) - # evaluates to 0 - if not self.options.shared: - replace_in_file(self, os.path.join(self.source_folder, "tools", "extra_defs_gen", "generate_extra_defs.h"), - "#if defined (_MSC_VER) && !defined (GLIBMM_GEN_EXTRA_DEFS_STATIC)", - "#if 0") - # when using cpp_std=c++NM the /permissive- flag is added which # attempts enforcing standard conformant c++ code # the problem is that older versions of Windows SDK is not standard # conformant! see: # https://developercommunity.visualstudio.com/t/error-c2760-in-combaseapih-with-windows-sdk-81-and/185399 replace_in_file(self, meson_build, "cpp_std=c++", "cpp_std=vc++") - if not self.options.shared: - replace_in_file(self, os.path.join(self.source_folder, "glib", "glibmmconfig.h.meson"), - "# define GLIBMM_DLL 1", "# define GLIBMM_DLL 0") - replace_in_file(self, os.path.join(self.source_folder, "glib", "meson.build"), - "error('Static builds are not supported by MSVC-style builds')", "") def build(self): self._patch_sources() @@ -156,15 +109,6 @@ def build(self): meson.build() def package(self): - def rename_msvc_static_libs(): - lib_folder = os.path.join(self.package_folder, "lib") - rename(self, os.path.join(lib_folder, f"libglibmm-{self._abi_version}.a"), - os.path.join(lib_folder, f"{self._glibmm_lib}.lib")) - rename(self, os.path.join(lib_folder, f"libgiomm-{self._abi_version}.a"), - os.path.join(lib_folder, f"{self._giomm_lib}.lib")) - rename(self, os.path.join(lib_folder, f"libglibmm_generate_extra_defs-{self._abi_version}.a"), - os.path.join(lib_folder, f"glibmm_generate_extra_defs-{self._abi_version}.lib")) - meson = Meson(self) meson.install() @@ -172,8 +116,6 @@ def rename_msvc_static_libs(): if is_msvc(self): rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - if not self.options.shared: - rename_msvc_static_libs() for directory in [self._glibmm_lib, self._giomm_lib]: directory_path = os.path.join(self.package_folder, "lib", directory, "include", "*.h") diff --git a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch deleted file mode 100644 index 3cf9f867ed1f0..0000000000000 --- a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_66_4.patch +++ /dev/null @@ -1,163 +0,0 @@ -Author: Hesham -Date: Fri May 6 20:02:25 2022 +0000 - - Fix initialization order fiasco - - By default global static initialization with shared libraries begins down - the linking chain upwards, so that the deepest dependency initializes first - This is not guaranteed with static libraries, which might cause glibmm to - initialize before glib. This fix uses lazy initialization for static vars - in glibmm that depend on glib. - -diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc -index 057abed..e51d01b 100644 ---- a/glib/glibmm/class.cc -+++ b/glib/glibmm/class.cc -@@ -170,7 +170,11 @@ Class::clone_custom_type( - } - - // Initialize the static quark to store/get custom type properties. -+#if GLIB_STATIC_COMPILATION -+GQuark Class::iface_properties_quark = 0; -+#else - GQuark Class::iface_properties_quark = g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif - - // static - void -diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc -index ab96892..267a6c0 100644 ---- a/glib/glibmm/init.cc -+++ b/glib/glibmm/init.cc -@@ -14,15 +14,25 @@ - * License along with this library. If not, see . - */ - -+#include - #include - #include - -+#if GLIB_STATIC_COMPILATION -+#include -+#endif -+ - namespace Glib - { - - void - init() - { -+#if GLIB_STATIC_COMPILATION -+ Glib::Class::iface_properties_quark = -+ g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif -+ - // Also calls Glib::wrap_register_init() and Glib::wrap_init(). - Glib::Error::register_init(); - } -diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc -index a2624e5..d9f1095 100644 ---- a/glib/glibmm/property.cc -+++ b/glib/glibmm/property.cc -@@ -89,8 +89,10 @@ struct custom_properties_type - }; - - // The quark used for storing/getting the custom properties of custom types. --static const GQuark custom_properties_quark = -- g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+static const GQuark& custom_properties_quark() { -+ static const GQuark custom_properties_quark_ = g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+ return custom_properties_quark_; -+} - - // Delete the custom properties data when an object of a custom type is finalized. - void destroy_notify_obj_custom_props(void* data) -@@ -111,12 +113,12 @@ custom_properties_type* - get_obj_custom_props(GObject* obj) - { - auto obj_custom_props = -- static_cast(g_object_get_qdata(obj, custom_properties_quark)); -+ static_cast(g_object_get_qdata(obj, custom_properties_quark())); - if (!obj_custom_props) - { - obj_custom_props = new custom_properties_type(); - g_object_set_qdata_full( -- obj, custom_properties_quark, obj_custom_props, destroy_notify_obj_custom_props); -+ obj, custom_properties_quark(), obj_custom_props, destroy_notify_obj_custom_props); - } - return obj_custom_props; - } -diff --git a/untracked/gio/giomm/application.cc b/untracked/gio/giomm/application.cc -index 43ae9df..0d12c9d 100644 ---- a/untracked/gio/giomm/application.cc -+++ b/untracked/gio/giomm/application.cc -@@ -51,8 +51,13 @@ struct ExtraApplicationData - } - }; - --GQuark quark_extra_application_data = -- g_quark_from_string("glibmm__Gio::Application::quark_extra_application_data"); -+static GQuark& -+quark_extra_application_data() -+{ -+ static GQuark quark_extra_application_data_ = -+ g_quark_from_string("glibmm__Gio::Application::quark_extra_application_data"); -+ return quark_extra_application_data_; -+} - - void - Application_delete_extra_application_data(gpointer data) -@@ -465,11 +470,11 @@ Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustring& - gchar* arg_desc = arg_description.empty() ? nullptr : g_strdup(arg_description.c_str()); - - ExtraApplicationData* extra_application_data = -- static_cast(g_object_get_qdata(gobject_, quark_extra_application_data)); -+ static_cast(g_object_get_qdata(gobject_, quark_extra_application_data())); - if (!extra_application_data) - { - extra_application_data = new ExtraApplicationData(); -- g_object_set_qdata_full(gobject_, quark_extra_application_data, extra_application_data, -+ g_object_set_qdata_full(gobject_, quark_extra_application_data(), extra_application_data, - Application_delete_extra_application_data); - } - -@@ -1546,5 +1551,3 @@ void Gio::Application::run_mainloop_vfunc() - - - } // namespace Gio -- -- -diff --git a/untracked/glib/glibmm/binding.cc b/untracked/glib/glibmm/binding.cc -index d0d4f47..0528893 100644 ---- a/untracked/glib/glibmm/binding.cc -+++ b/untracked/glib/glibmm/binding.cc -@@ -29,7 +29,10 @@ - namespace - { - // TODO: When we can break ABI, replace this GQuark by a new data member in Glib::Binding. --GQuark quark_manage = g_quark_from_string("glibmm__Glib::Binding::manage"); -+GQuark& quark_manage() { -+ static GQuark quark_manage_ = g_quark_from_string("glibmm__Glib::Binding::manage"); -+ return quark_manage_; -+} - - struct BindingTransformSlots - { -@@ -150,7 +153,7 @@ Binding::unbind() - void - Binding::unreference() const - { -- if (!g_object_get_qdata(gobject_, quark_manage)) -+ if (!g_object_get_qdata(gobject_, quark_manage())) - { - GBinding* const binding = const_cast(gobj()); - -@@ -168,7 +171,7 @@ void - Binding::set_manage() - { - // Any pointer can be set, just not nullptr. -- g_object_set_qdata(gobject_, quark_manage, this); -+ g_object_set_qdata(gobject_, quark_manage(), this); - } - - const Glib::RefPtr& diff --git a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch deleted file mode 100644 index e2f8e705abbe0..0000000000000 --- a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_72_1.patch +++ /dev/null @@ -1,95 +0,0 @@ -Author: Hesham -Date: Fri May 6 19:37:32 2022 +0000 - - Fix initialization order fiasco - - By default global static initialization with shared libraries begins down - the linking chain upwards, so that the deepest dependency initializes first - This is not guaranteed with static libraries, which might cause glibmm to - initialize before glib. This fix uses lazy initialization for static vars - in glibmm that depend on glib. - -diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc -index 36c3c4b..f735129 100644 ---- a/glib/glibmm/class.cc -+++ b/glib/glibmm/class.cc -@@ -157,7 +157,11 @@ Class::clone_custom_type( - } - - // Initialize the static quark to store/get custom type properties. -+#if GLIB_STATIC_COMPILATION -+GQuark Class::iface_properties_quark = 0; -+#else - GQuark Class::iface_properties_quark = g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif - - // static - void -diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc -index 0b34447..6b70a4c 100644 ---- a/glib/glibmm/init.cc -+++ b/glib/glibmm/init.cc -@@ -14,12 +14,17 @@ - * License along with this library. If not, see . - */ - -+#include - #include - #include - #include - #include - #include - -+#if GLIB_STATIC_COMPILATION -+#include -+#endif -+ - namespace - { - bool init_to_users_preferred_locale = true; -@@ -45,6 +50,11 @@ void init() - if (is_initialized) - return; - -+#if GLIB_STATIC_COMPILATION -+ Glib::Class::iface_properties_quark = -+ g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif -+ - if (init_to_users_preferred_locale) - { - try -diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc -index 56dad84..630b35b 100644 ---- a/glib/glibmm/property.cc -+++ b/glib/glibmm/property.cc -@@ -89,8 +89,12 @@ struct custom_properties_type - }; - - // The quark used for storing/getting the custom properties of custom types. --static const GQuark custom_properties_quark = -- g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+static const GQuark& -+custom_properties_quark() -+{ -+ static GQuark custom_properties_quark_ = g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+ return custom_properties_quark_; -+} - - // Delete the custom properties data when an object of a custom type is finalized. - void destroy_notify_obj_custom_props(void* data) -@@ -111,12 +115,12 @@ custom_properties_type* - get_obj_custom_props(GObject* obj) - { - auto obj_custom_props = -- static_cast(g_object_get_qdata(obj, custom_properties_quark)); -+ static_cast(g_object_get_qdata(obj, custom_properties_quark())); - if (!obj_custom_props) - { - obj_custom_props = new custom_properties_type(); - g_object_set_qdata_full( -- obj, custom_properties_quark, obj_custom_props, destroy_notify_obj_custom_props); -+ obj, custom_properties_quark(), obj_custom_props, destroy_notify_obj_custom_props); - } - return obj_custom_props; - } diff --git a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch b/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch deleted file mode 100644 index 6a24ae04d3038..0000000000000 --- a/recipes/glibmm/all/patches/fix_initialization_order_fiasco_2_75_0.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc -index 31f92c61..f5befb2d 100644 ---- a/glib/glibmm/class.cc -+++ b/glib/glibmm/class.cc -@@ -166,7 +166,11 @@ Class::clone_custom_type( - } - - // Initialize the static quark to store/get custom type properties. -+#if GLIB_STATIC_COMPILATION -+GQuark Class::iface_properties_quark = 0; -+#else - GQuark Class::iface_properties_quark = g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif - - // static - void -diff --git a/glib/glibmm/init.cc b/glib/glibmm/init.cc -index 0b34447d..6b70a4c2 100644 ---- a/glib/glibmm/init.cc -+++ b/glib/glibmm/init.cc -@@ -14,12 +14,17 @@ - * License along with this library. If not, see . - */ - -+#include - #include - #include - #include - #include - #include - -+#if GLIB_STATIC_COMPILATION -+#include -+#endif -+ - namespace - { - bool init_to_users_preferred_locale = true; -@@ -45,6 +50,11 @@ void init() - if (is_initialized) - return; - -+#if GLIB_STATIC_COMPILATION -+ Glib::Class::iface_properties_quark = -+ g_quark_from_string("gtkmm_CustomObject_iface_properties"); -+#endif -+ - if (init_to_users_preferred_locale) - { - try -diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc -index 56dad849..630b35b1 100644 ---- a/glib/glibmm/property.cc -+++ b/glib/glibmm/property.cc -@@ -89,8 +89,12 @@ struct custom_properties_type - }; - - // The quark used for storing/getting the custom properties of custom types. --static const GQuark custom_properties_quark = -- g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+static const GQuark& -+custom_properties_quark() -+{ -+ static GQuark custom_properties_quark_ = g_quark_from_string("gtkmm_CustomObject_custom_properties"); -+ return custom_properties_quark_; -+} - - // Delete the custom properties data when an object of a custom type is finalized. - void destroy_notify_obj_custom_props(void* data) -@@ -111,12 +115,12 @@ custom_properties_type* - get_obj_custom_props(GObject* obj) - { - auto obj_custom_props = -- static_cast(g_object_get_qdata(obj, custom_properties_quark)); -+ static_cast(g_object_get_qdata(obj, custom_properties_quark())); - if (!obj_custom_props) - { - obj_custom_props = new custom_properties_type(); - g_object_set_qdata_full( -- obj, custom_properties_quark, obj_custom_props, destroy_notify_obj_custom_props); -+ obj, custom_properties_quark(), obj_custom_props, destroy_notify_obj_custom_props); - } - return obj_custom_props; - } From 2b2239aec092f6d2afc3b47712d82e52ce90bec0 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 19 Mar 2024 19:04:00 +0200 Subject: [PATCH 3/4] glibmm: bump to v2.78.1 --- recipes/glibmm/all/conandata.yml | 6 +++--- recipes/glibmm/config.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/glibmm/all/conandata.yml b/recipes/glibmm/all/conandata.yml index 8c7e5d9b0ff57..830679f3678f2 100644 --- a/recipes/glibmm/all/conandata.yml +++ b/recipes/glibmm/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "2.78.0": - url: "https://download.gnome.org/sources/glibmm/2.78/glibmm-2.78.0.tar.xz" - sha256: "5d2e872564996f02a06d8bbac3677e7c394af8b00dd1526aebd47af842a3ef50" + "2.78.1": + url: "https://download.gnome.org/sources/glibmm/2.78/glibmm-2.78.1.tar.xz" + sha256: "f473f2975d26c3409e112ed11ed36406fb3843fa975df575c22d4cb843085f61" "2.75.0": url: "https://download.gnome.org/sources/glibmm/2.75/glibmm-2.75.0.tar.xz" sha256: "60bb12e66488aa8ce41f0eb2f3612f89f5ddc887e3e4d45498524bf60b266b3d" diff --git a/recipes/glibmm/config.yml b/recipes/glibmm/config.yml index 774ad09bc1cf5..c3ca69bc81afd 100644 --- a/recipes/glibmm/config.yml +++ b/recipes/glibmm/config.yml @@ -1,5 +1,5 @@ versions: - "2.78.0": + "2.78.1": folder: "all" "2.75.0": folder: "all" From 91ea193c5cd832b1e4d3fab8487fc69d6e2b8b57 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 19 Mar 2024 19:04:24 +0200 Subject: [PATCH 4/4] glibmm: bump meson --- recipes/glibmm/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/glibmm/all/conanfile.py b/recipes/glibmm/all/conanfile.py index e24da677d7d77..d36d4666df42d 100644 --- a/recipes/glibmm/all/conanfile.py +++ b/recipes/glibmm/all/conanfile.py @@ -69,7 +69,7 @@ def validate(self): raise ConanInvalidConfiguration("Linking shared glib with the MSVC static runtime is not supported") def build_requirements(self): - self.tool_requires("meson/1.3.1") + self.tool_requires("meson/1.3.2") if not self.conf.get("tools.gnu:pkg_config", check_type=str): self.tool_requires("pkgconf/2.1.0")