diff --git a/recipes/libxmlpp/all/conandata.yml b/recipes/libxmlpp/all/conandata.yml index b93f808923cc5..9676ddd7ccf09 100644 --- a/recipes/libxmlpp/all/conandata.yml +++ b/recipes/libxmlpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.4.0": + url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.4.0/libxml++-5.4.0.tar.xz" + sha256: "e9a23c436686a94698d2138e6bcbaf849121d63bfa0f50dc34fefbfd79566848" "5.2.0": url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.2.0/libxml++-5.2.0.tar.xz" sha256: "e41b8eae55210511585ae638615f00db7f982c0edea94699865f582daf03b44f" @@ -8,9 +11,6 @@ sources: "5.0.1": url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/5.0.1/libxml++-5.0.1.tar.xz" sha256: "15c38307a964fa6199f4da6683a599eb7e63cc89198545b36349b87cf9aa0098" - "2.42.1": - url: "https://github.com/libxmlplusplus/libxmlplusplus/releases/download/2.42.1/libxml++-2.42.1.tar.xz" - sha256: "9b59059abe5545d28ceb388a55e341095f197bd219c73e6623aeb6d801e00be8" patches: "5.2.0": - patch_file: "patches/5.2.0-0001-enable_static_builds_on_msvc.patch" @@ -27,8 +27,3 @@ patches: patch_type: "portability" patch_description: "Manage dllexport correctly to be able to build static libraries on MSVC" patch_source: "https://github.com/libxmlplusplus/libxmlplusplus/commit/2a2825c67a30ea34f3514659bfd91111db8e009d.patch" - "2.42.1": - - patch_file: "patches/2.42.1-0001-enable_static_builds_on_msvc.patch" - patch_type: "portability" - patch_description: "Manage dllexport correctly to be able to build static libraries on MSVC" - patch_source: "https://github.com/libxmlplusplus/libxmlplusplus/commit/2a2825c67a30ea34f3514659bfd91111db8e009d.patch" diff --git a/recipes/libxmlpp/all/conanfile.py b/recipes/libxmlpp/all/conanfile.py index b79b459f36df3..8c526bf0e516c 100644 --- a/recipes/libxmlpp/all/conanfile.py +++ b/recipes/libxmlpp/all/conanfile.py @@ -34,9 +34,25 @@ class LibXMLPlusPlus(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return "17" if Version(self.version) >= "5.4.0" else "11" + + @property + def _compilers_minimum_version(self): + return { + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) + @property def _lib_version(self): - return "2.6" if Version(self.version) <= "2.42.1" else "5.0" + return "5.0" def export_sources(self): export_conandata_patches(self) @@ -53,31 +69,24 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("libxml2/2.12.4") - if Version(self.version) <= "2.42.1": - self.requires("glibmm/2.66.4", transitive_headers=True, transitive_libs=True) - else: - self.requires("glibmm/2.75.0") + self.requires("libxml2/[>=2.12.5 <3]") + self.requires("glibmm/2.75.0") def validate(self): if hasattr(self, "settings_build") and cross_building(self): raise ConanInvalidConfiguration("Cross-building not implemented") - if Version(self.version) < "2.91.1": - from conan import conan_version - import sys - if conan_version.major == 2: - # FIXME: linter complains, but function is there - # https://docs.conan.io/2.0/reference/tools/build.html?highlight=check_min_cppstd#conan-tools-build-check-max-cppstd - check_max_cppstd = getattr(sys.modules['conan.tools.build'], 'check_max_cppstd') - # INFO: error: no template named 'auto_ptr' in namespace 'std'. Removed in C++17. - check_max_cppstd(self, 14) if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) def build_requirements(self): - self.tool_requires("meson/1.3.1") + self.tool_requires("meson/[>=1.2.3 <2]") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.1.0") + self.tool_requires("pkgconf/[>=2.2 <3]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libxmlpp/all/patches/2.42.1-0001-enable_static_builds_on_msvc.patch b/recipes/libxmlpp/all/patches/2.42.1-0001-enable_static_builds_on_msvc.patch deleted file mode 100644 index 32d4ca9bbdc42..0000000000000 --- a/recipes/libxmlpp/all/patches/2.42.1-0001-enable_static_builds_on_msvc.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/libxml++config.h.meson b/libxml++config.h.meson -index fdae143..5d853c2 100755 ---- a/libxml++config.h.meson -+++ b/libxml++config.h.meson -@@ -21,9 +21,16 @@ - /* Micro version number of libxml++. */ - #mesondefine LIBXMLXX_MICRO_VERSION - --#if defined (GLIBMM_DLL) && !defined (LIBXMLXX_STATIC) -+/* Defined if libxml++ is built as a static library. */ -+#mesondefine LIBXMLXX_STATIC -+ -+#if !defined (LIBXMLXX_STATIC) - #ifdef LIBXMLPP_BUILD -- #define LIBXMLPP_API __declspec(dllexport) -+ #ifdef __GNUC__ -+ #define LIBXMLPP_API __attribute__((visibility("default"))) -+ #else -+ #define LIBXMLPP_API __declspec(dllexport) -+ #endif - #elif !defined (__GNUC__) - #define LIBXMLPP_API __declspec(dllimport) - #else /* don't dllimport classes/methods on GCC/MinGW */ -diff --git a/meson.build b/meson.build -index e89f2c6..20d66ed 100644 ---- a/meson.build -+++ b/meson.build -@@ -292,15 +292,13 @@ endif - # Always set for backwards compatibility. - pkg_conf_data.set('LIBXMLCPP_EXCEPTIONS_ENABLED', 1) - -+if get_option('default_library') == 'static' -+ pkg_conf_data.set('LIBXMLXX_STATIC', 1) -+endif -+ - # Static library? - 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 -- - configure_file( - input: 'libxml++-2.6.pc.in', - output: '@BASENAME@', diff --git a/recipes/libxmlpp/all/test_package/CMakeLists.txt b/recipes/libxmlpp/all/test_package/CMakeLists.txt index 082b48301a3b9..0e449196b865f 100644 --- a/recipes/libxmlpp/all/test_package/CMakeLists.txt +++ b/recipes/libxmlpp/all/test_package/CMakeLists.txt @@ -5,4 +5,8 @@ find_package(libxmlpp REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE libxmlpp::libxmlpp) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +if(libxmlpp_VERSION VERSION_GREATER_EQUAL "5.4.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/libxmlpp/config.yml b/recipes/libxmlpp/config.yml index 9005a59d2fb31..f9ffdcfd89507 100644 --- a/recipes/libxmlpp/config.yml +++ b/recipes/libxmlpp/config.yml @@ -1,9 +1,9 @@ versions: + "5.4.0": + folder: all "5.2.0": folder: all "5.0.3": folder: all "5.0.1": folder: all - "2.42.1": - folder: all