class MiniPortile

def minimal_pkg_config(pkg, *pcoptions)


code paths that aren't helpful for mini-portile's use case of parsing pc files.
specifically with the fix from b90e56e6 to support multiple pkg-config options, and removing

this minimal version of pkg_config is based on ruby 29dc9378 (2023-01-09)
def minimal_pkg_config(pkg, *pcoptions)
  if pcoptions.empty?
    raise ArgumentError, "no pkg-config options are given"
  end
  if ($PKGCONFIG ||=
      (pkgconfig = MakeMakefile.with_config("pkg-config") {MakeMakefile.config_string("PKG_CONFIG") || "pkg-config"}) &&
      MakeMakefile.find_executable0(pkgconfig) && pkgconfig)
    pkgconfig = $PKGCONFIG
  else
    raise RuntimeError, "pkg-config is not found"
  end
  pcoptions = Array(pcoptions).map { |o| "--#{o}" }
  response = IO.popen([pkgconfig, *pcoptions, pkg], err:[:child, :out], &:read)
  raise RuntimeError, response unless $?.success?
  response.strip
end