public static function getPkgConfigPrefix($package)
{
if (self::findBin('pkg-config')) {
$cmd = 'pkg-config --variable=prefix ' . $package;
$process = new Process($cmd);
$code = $process->run();
if (intval($code) === 0) {
$path = trim($process->getOutput());
if (file_exists($path)) {
return $path;
}
}
return false;
}
return false;
}