Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

at-spi2-core: enable non-linux #20101

Merged
merged 19 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions recipes/at-spi2-core/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ versions:
folder: new
"2.49.1":
folder: new
"2.50.0":
folder: new
3 changes: 3 additions & 0 deletions recipes/at-spi2-core/new/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"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
"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
Expand Down
32 changes: 21 additions & 11 deletions recipes/at-spi2-core/new/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,20 @@ def requirements(self):
self.requires("glib/2.77.0")
if self.options.with_x11:
self.requires("xorg/system")
self.requires("dbus/1.15.6")
if self.settings.os != "Windows":
self.requires("dbus/1.15.6")

def validate(self):
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 self.settings.os != "Linux":
raise ConanInvalidConfiguration("only linux is supported by this recipe")
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")

def layout(self):
basic_layout(self, src_folder="src")
Expand All @@ -80,6 +85,9 @@ def generate(self):
else:
tc.project_options["introspection"] = "no"
tc.project_options["x11"] = "yes" if self.options.with_x11 else "no"
if self.settings.os == "Windows":
tc.project_options["atk_only"] = "true"

tc.project_options["docs"] = "false"
tc.generate()
tc = PkgConfigDeps(self)
Expand Down Expand Up @@ -110,17 +118,19 @@ def package(self):


def package_info(self):
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"]
self.cpp_info.components["atspi"].set_property("pkg_config_name", "atspi-2")
if self.settings.os != "Windows":
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"]
self.cpp_info.components["atspi"].set_property("pkg_config_name", "atspi-2")

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')

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')
if self.settings.os != "Windows":
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')
2 changes: 1 addition & 1 deletion recipes/at-spi2-core/new/test_package/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('test_package', 'c')
package_dep = dependency('atspi-2')
package_dep = dependency('atk')
executable('test_package',
sources : ['test_package.c'],
dependencies : [package_dep])
11 changes: 6 additions & 5 deletions recipes/at-spi2-core/new/test_package/test_package.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include "atspi/atspi.h"
#include "assert.h"
#include <stdio.h>
#include <atk/atk.h>

int main()
{
atspi_init ();
assert(atspi_get_desktop_count() > 0);
return atspi_exit();
printf("ATK version %d.%d.%d\n",atk_get_major_version(), atk_get_minor_version(), atk_get_micro_version());
printf("binary age %d\n", atk_get_binary_age());
printf("interface age %d\n", atk_get_interface_age());
return 0;
}