Skip to content

Commit

Permalink
(conan-io#11209) [at-spi2-core]: use shared glib for shared at-spi2-core
Browse files Browse the repository at this point in the history
  • Loading branch information
theartful authored Jun 16, 2022
1 parent ddf5074 commit f0964c0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions recipes/at-spi2-core/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class AtSpi2CoreConan(ConanFile):
@property
def _source_subfolder(self):
return "source_subfolder"

@property
def _build_subfolder(self):
return "build_subfolder"

_meson = None

def export_sources(self):
Expand All @@ -43,13 +43,21 @@ def configure(self):
del self.options.fPIC
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd
if self.options.shared:
self.options["glib"].shared = True

def validate(self):
if self.options.shared and not self.options["glib"].shared:
raise ConanInvalidConfiguration(
"Linking a shared library against static glib can cause unexpected behaviour."
)

def build_requirements(self):
self.build_requires("meson/0.59.1")
self.build_requires("meson/0.62.2")
self.build_requires("pkgconf/1.7.4")

def requirements(self):
self.requires("glib/2.70.0")
self.requires("glib/2.73.0")
if self.options.with_x11:
self.requires("xorg/system")
self.requires("dbus/1.12.20")
Expand Down Expand Up @@ -77,7 +85,7 @@ def _configure_meson(self):
self._meson.configure(defs=defs, build_folder=self._build_subfolder, source_folder=self._source_subfolder, pkg_config_paths=".", args=args)
return self._meson

def build(self):
def build(self):
for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.patch(**patch)
if tools.Version(self.version) >= "2.42.0":
Expand All @@ -100,3 +108,5 @@ def package_info(self):
self.cpp_info.includedirs = ["include/at-spi-2.0"]
self.cpp_info.names["pkg_config"] = "atspi-2"

def package_id(self):
self.info.requires["glib"].full_package_mode()

0 comments on commit f0964c0

Please sign in to comment.