From 4adcc53460600452649959ed7b91b2c093937bea Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 12 Sep 2024 12:30:51 +0300 Subject: [PATCH] (#25091) at-spi2-core: add v2.53.1, fix X11 support and enable by default * at-spi2-core: fix X11 support, enable by default * at-spi2-core: add v2.53.1 --- recipes/at-spi2-core/config.yml | 2 + recipes/at-spi2-core/new/conandata.yml | 15 ++++--- recipes/at-spi2-core/new/conanfile.py | 59 +++++++++++++------------- 3 files changed, 41 insertions(+), 35 deletions(-) diff --git a/recipes/at-spi2-core/config.yml b/recipes/at-spi2-core/config.yml index f37e219eb66cb..c890631d2ad5f 100644 --- a/recipes/at-spi2-core/config.yml +++ b/recipes/at-spi2-core/config.yml @@ -25,3 +25,5 @@ versions: folder: new "2.51.0": folder: new + "2.53.1": + folder: new diff --git a/recipes/at-spi2-core/new/conandata.yml b/recipes/at-spi2-core/new/conandata.yml index 58e8f4f097094..225eb1193882e 100644 --- a/recipes/at-spi2-core/new/conandata.yml +++ b/recipes/at-spi2-core/new/conandata.yml @@ -1,13 +1,16 @@ sources: + "2.53.1": + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.53/at-spi2-core-2.53.1.tar.xz" + sha256: "2affe2c88dae3defcd754c2c2bcecfb2e52b9541edf2e469f94b3a0bb1307cf4" "2.51.0": - sha256: 8dd07c6160e3115f4f77e2205963449def6822a3dc85d495c5db389f56663037 - url: https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.51/at-spi2-core-2.51.0.tar.xz + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.51/at-spi2-core-2.51.0.tar.xz" + sha256: "8dd07c6160e3115f4f77e2205963449def6822a3dc85d495c5db389f56663037" "2.50.0": - sha256: e9f5a8c8235c9dd963b2171de9120301129c677dde933955e1df618b949c4adc - url: https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.50/at-spi2-core-2.50.0.tar.xz + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.50/at-spi2-core-2.50.0.tar.xz" + sha256: "e9f5a8c8235c9dd963b2171de9120301129c677dde933955e1df618b949c4adc" "2.49.1": - sha256: 53ed9eb77e4c48b3bf6ac4afb5689391e0d7d0f44f7ca4443d8b13c7dd26119c - url: https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.49/at-spi2-core-2.49.1.tar.xz + url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.49/at-spi2-core-2.49.1.tar.xz" + sha256: "53ed9eb77e4c48b3bf6ac4afb5689391e0d7d0f44f7ca4443d8b13c7dd26119c" "2.48.3": url: "https://ftp.gnome.org/pub/gnome/sources/at-spi2-core/2.48/at-spi2-core-2.48.3.tar.xz" sha256: "37316df43ca9989ce539d54cf429a768c28bb38a0b34950beadd0421827edf55" diff --git a/recipes/at-spi2-core/new/conanfile.py b/recipes/at-spi2-core/new/conanfile.py index 265bde97b8ace..e12168d36a06f 100644 --- a/recipes/at-spi2-core/new/conanfile.py +++ b/recipes/at-spi2-core/new/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile -from conan.errors import ConanException, ConanInvalidConfiguration -from conan.tools.apple import fix_apple_shared_install_name +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir from conan.tools.gnu import PkgConfigDeps @@ -32,7 +32,7 @@ class AtSpi2CoreConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "with_x11": False, + "with_x11": True, } def export_sources(self): @@ -41,6 +41,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_x11 def configure(self): if self.options.shared: @@ -56,22 +58,20 @@ def build_requirements(self): def requirements(self): self.requires("glib/2.78.3") - if self.options.with_x11: - self.requires("xorg/system") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.requires("dbus/1.15.8") + if self.options.get_safe("with_x11"): + self.requires("xorg/system") def validate(self): - if self.options.shared and not self.dependencies["glib"].options.shared: + if self.options.shared and not self.dependencies["glib"].options.shared: raise ConanInvalidConfiguration( "Linking a shared library against static glib can cause unexpected behaviour." ) - if Version(self.version) < "2.49.1": - if self.settings.os == "Windows": - raise ConanInvalidConfiguration("Windows is not supported before version 2.49.1") - if Version(self.version) < "2.50.0": - if self.settings.os == "Macos": - raise ConanInvalidConfiguration("macos is not supported before version 2.50.0") + if Version(self.version) < "2.49.1" and self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported before version 2.49.1") + if Version(self.version) < "2.50.0" and is_apple_os(self): + raise ConanInvalidConfiguration("macOS is not supported before version 2.50.0") def layout(self): basic_layout(self, src_folder="src") @@ -86,10 +86,10 @@ def generate(self): tc = MesonToolchain(self) if Version(self.version) >= "2.47.1": tc.project_options["introspection"] = "disabled" - tc.project_options["x11"] = "enabled" if self.options.with_x11 else "disabled" + tc.project_options["x11"] = "enabled" if self.options.get_safe("with_x11") else "disabled" else: tc.project_options["introspection"] = "no" - tc.project_options["x11"] = "yes" if self.options.with_x11 else "no" + tc.project_options["x11"] = "yes" if self.options.get_safe("with_x11") else "no" if self.settings.os != "Linux": tc.project_options["atk_only"] = "true" @@ -124,24 +124,25 @@ def package(self): fix_apple_shared_install_name(self) fix_msvc_libname(self) - def package_info(self): - if self.settings.os == "Linux": - self.cpp_info.components["atspi"].libs = ['atspi'] - self.cpp_info.components["atspi"].includedirs = ["include/at-spi-2.0"] - self.cpp_info.components["atspi"].requires = ["dbus::dbus", "glib::glib"] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["atspi"].set_property("pkg_config_name", "atspi-2") + self.cpp_info.components["atspi"].libs = ["atspi"] + self.cpp_info.components["atspi"].includedirs = ["include/at-spi-2.0"] + self.cpp_info.components["atspi"].requires = ["dbus::dbus", "glib::glib-2.0", "glib::gobject-2.0"] + if self.options.with_x11: + self.cpp_info.components["atspi"].requires.extend(["xorg::x11", "xorg::xtst", "xorg::xi"]) + self.cpp_info.components["atk"].set_property("pkg_config_name", "atk") self.cpp_info.components["atk"].libs = ["atk-1.0"] - self.cpp_info.components["atk"].includedirs = ['include/atk-1.0'] - self.cpp_info.components["atk"].requires = ["glib::glib"] - self.cpp_info.components["atk"].set_property("pkg_config_name", 'atk') - - if self.settings.os == "Linux": - self.cpp_info.components["atk-bridge"].libs = ['atk-bridge-2.0'] - self.cpp_info.components["atk-bridge"].includedirs = [os.path.join('include', 'at-spi2-atk', '2.0')] - self.cpp_info.components["atk-bridge"].requires = ["dbus::dbus", "atk", "glib::glib", "atspi"] - self.cpp_info.components["atk-bridge"].set_property("pkg_config_name", 'atk-bridge-2.0') + self.cpp_info.components["atk"].includedirs = ["include/atk-1.0"] + self.cpp_info.components["atk"].requires = ["glib::glib-2.0", "glib::gobject-2.0"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["atk-bridge"].set_property("pkg_config_name", "atk-bridge-2.0") + self.cpp_info.components["atk-bridge"].libs = ["atk-bridge-2.0"] + self.cpp_info.components["atk-bridge"].includedirs = [os.path.join("include", "at-spi2-atk", "2.0")] + self.cpp_info.components["atk-bridge"].requires = ["atspi", "atk", "glib::gmodule-2.0"] def fix_msvc_libname(conanfile, remove_lib_prefix=True):