Skip to content

Commit

Permalink
curses: Ignore /usr/bin/ncurses5.4-config on macOS
Browse files Browse the repository at this point in the history
macOS mistakenly ships /usr/bin/ncurses5.4-config and a man page for
it, but none of the headers or libraries are available in the location
advertised by it. Ignore /usr/bin because it can only contain this
broken configtool script. Homebrew is /usr/local or /opt/homebrew.

Xcode's command-line tools SDK does include curses, but the configtool
in there is wrong too, and anyway we can't just randomly pick it up
since the user must explicitly select that as a target by using
a native file. The MacOSX SDK itself does not include curses.

We also can't ignore ncurses5.4-config entirely because it might be
available in a different prefix.
  • Loading branch information
nirbheek committed Oct 4, 2024
1 parent 0f914b7 commit d48602a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mesonbuild/dependencies/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,14 @@ class CursesConfigToolDependency(ConfigToolDependency):
tools = ['ncursesw6-config', 'ncursesw5-config', 'ncurses6-config', 'ncurses5-config', 'ncurses5.4-config']

def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any], language: T.Optional[str] = None):
super().__init__(name, env, kwargs, language)
exclude_paths = None
# macOS mistakenly ships /usr/bin/ncurses5.4-config and a man page for
# it, but none of the headers or libraries. Ignore /usr/bin because it
# can only contain this broken configtool script.
# Homebrew is /usr/local or /opt/homebrew.
if env.machines.build and env.machines.build.system == 'darwin':
exclude_paths = ['/usr/bin']
super().__init__(name, env, kwargs, language, exclude_paths=exclude_paths)
if not self.is_found:
return
self.compile_args = self.get_config_value(['--cflags'], 'compile_args')
Expand Down

0 comments on commit d48602a

Please sign in to comment.