pkg-config automatically discards paths that match system include paths, but it also matches any path that _ends_ in what looks like a system path.
This was impacting Neovim's CI system where the build artefacts are placed in "~/neovim/.deps/usr/include". When running `pkg-config --cflags`, it matches the "/usr/include" at the end of the path, discards and does not output the correct include flags. The included patch anchors the regex to the start of the path. I am not sure if this is actually intentional, but well, here it is a patch in case it's not. See also: https://github.com/neovim/neovim/pull/14745#issuecomment-860201794 diff --git usr.bin/pkg-config/pkg-config usr.bin/pkg-config/pkg-config index 71a69b69bb3..f978cdc1dbc 100644 --- usr.bin/pkg-config/pkg-config +++ usr.bin/pkg-config/pkg-config @@ -504,7 +504,7 @@ sub do_cflags my $l = $configs{$pkg}->get_property('Cflags', $variables); PATH: for my $path (@$l) { for my $sys_path (@sys_includes) { - next PATH if ($path =~ /${sys_path}\/*$/); + next PATH if ($path =~ /^${sys_path}\/*$/); } push(@$cflags, $path); }
