Skip to content

Commit

Permalink
(#20269) graphene: fix missing glibc symbols on newer systems
Browse files Browse the repository at this point in the history
* graphene: bump deps

* graphene: add -fno-finite-math-only to fix issues with glibc >= 2.31
  • Loading branch information
valgur authored Oct 18, 2023
1 parent 632fec1 commit 2bdcd7e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions recipes/graphene/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from conan.errors import ConanInvalidConfiguration
from conan.tools.apple import fix_apple_shared_install_name
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import copy, get, rm, rmdir
from conan.tools.files import copy, get, rm, rmdir, replace_in_file
from conan.tools.gnu import PkgConfigDeps
from conan.tools.layout import basic_layout
from conan.tools.meson import Meson, MesonToolchain
Expand Down Expand Up @@ -51,7 +51,7 @@ def layout(self):

def requirements(self):
if self.options.with_glib:
self.requires("glib/2.77.0")
self.requires("glib/2.78.0")

def validate(self):
if self.settings.compiler == "gcc":
Expand All @@ -70,9 +70,9 @@ def validate(self):
)

def build_requirements(self):
self.tool_requires("meson/1.2.1")
self.tool_requires("meson/1.2.2")
if not self.conf.get("tools.gnu:pkg_config", default=False):
self.tool_requires("pkgconf/1.9.5")
self.tool_requires("pkgconf/2.0.3")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand All @@ -97,7 +97,15 @@ def generate(self):
meson.project_options["introspection"] = "disabled"
meson.generate()

def _patch_sources(self):
# The finite-math-only optimization has no effect and can cause linking errors
# when linked against glibc >= 2.31
replace_in_file(self, os.path.join(self.source_folder, "meson.build"),
"'-ffast-math'",
"'-ffast-math', '-fno-finite-math-only'")

def build(self):
self._patch_sources()
meson = Meson(self)
meson.configure()
meson.build()
Expand Down

0 comments on commit 2bdcd7e

Please sign in to comment.