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 all 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
15 changes: 11 additions & 4 deletions recipes/glib/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ 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" and not self.options.with_elf:
raise ConanInvalidConfiguration("libelf dependency can't be disabled in glib < 2.67.0")

def config_options(self):
if self.settings.os == "Windows":
Expand Down Expand Up @@ -96,6 +98,10 @@ 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"],
Expand Down Expand Up @@ -276,10 +282,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 actually an executable

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