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

Glib: Make libelf dependency optional #2925

Merged
merged 14 commits into from
Jan 16, 2021
Merged
Changes from 10 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
20 changes: 15 additions & 5 deletions recipes/glib/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def configure(self):
"glib can not be built as static library on Windows. "
"see https://gitlab.gnome.org/GNOME/glib/-/issues/692"
)
if tools.Version(self.version) < "2.67.0":
if not self.options.with_elf:
self.output.warn("libelf dependency can't be disabled in glib < 2.67.0")
del self.options.with_elf
Erlkoenig90 marked this conversation as resolved.
Show resolved Hide resolved

def config_options(self):
if self.settings.os == "Windows":
Expand All @@ -66,7 +70,7 @@ def requirements(self):
self.requires("libffi/3.3")
if self.options.with_pcre:
self.requires("pcre/8.44")
if self.options.with_elf:
if self.options.get_safe("with_elf", True):
Erlkoenig90 marked this conversation as resolved.
Show resolved Hide resolved
self.requires("libelf/0.8.13")
if self.options.get_safe("with_mount"):
self.requires("libmount/2.36")
Expand Down Expand Up @@ -96,12 +100,17 @@ def _configure_meson(self):
if self.settings.os == "FreeBSD":
defs["xattr"] = "false"
defs["tests"] = "false"

if tools.Version(self.version) >= "2.67.0":
defs["libelf"] = "enabled" if self.options.with_elf else "disabled"

meson.configure(
source_folder=self._source_subfolder,
args=["--wrap-mode=nofallback"],
build_folder=self._build_subfolder,
defs=defs,
)

return meson

def _patch_sources(self):
Expand Down Expand Up @@ -276,10 +285,11 @@ def package_info(self):
self.package_folder, "bin", "glib-compile-schemas"
)

self.cpp_info.components["gresource"].libs = [] # this is actualy an executable
self.cpp_info.components["gresource"].requires.append(
"libelf::libelf"
) # this is actualy an executable
self.cpp_info.components["gresource"].libs = [] # this is actually an executable
if self.options.get_safe("with_elf", True):
self.cpp_info.components["gresource"].requires.append(
"libelf::libelf"
) # this is actualy an executable
Erlkoenig90 marked this conversation as resolved.
Show resolved Hide resolved

bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH env var with: {}".format(bin_path))
Expand Down