Skip to content

Commit

Permalink
cpython: use cpp_info.aggregated_components() for deps
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Nov 13, 2023
1 parent ec99e2e commit 220c472
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions recipes/cpython/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,10 @@ def _generate_autotools(self):
tcltk_libs = []
# FIXME: collect using some conan util (https://github.com/conan-io/conan/issues/7656)
for dep in ("tcl", "tk", "zlib"):
tcltk_includes += [f"-I{d}" for d in self.dependencies[dep].cpp_info.includedirs]
tcltk_libs += [f"-L{lib}" for lib in self.dependencies[dep].cpp_info.libdirs]
tcltk_libs += [f"-l{lib}" for lib in self.dependencies[dep].cpp_info.libs]
cpp_info = self.dependencies[dep].cpp_info.aggregated_components()
tcltk_includes += [f"-I{d}" for d in cpp_info.includedirs]
tcltk_libs += [f"-L{lib}" for lib in cpp_info.libdirs]
tcltk_libs += [f"-l{lib}" for lib in cpp_info.libs]
if self.settings.os in ["Linux", "FreeBSD"] and not self.dependencies["tk"].options.shared:
# FIXME: use info from xorg.components (x11, xscrnsaver)
tcltk_libs.extend([f"-l{lib}" for lib in ("X11", "Xss")])
Expand Down Expand Up @@ -312,7 +313,7 @@ def _patch_sources(self):

if self.options.get_safe("with_curses", False):
# FIXME: this will link to ALL libraries of ncurses. Only need to link to ncurses(w) (+ eventually tinfo)
ncurses_info = self.dependencies["ncurses"].cpp_info
ncurses_info = self.dependencies["ncurses"].cpp_info.aggregated_components()
replace_in_file(self, os.path.join(self.source_folder, "setup.py"),
"curses_libs = ",
"curses_libs = {} #".format(repr(ncurses_info.libs + ncurses_info.system_libs)))
Expand Down

0 comments on commit 220c472

Please sign in to comment.