This commit is contained in:
DubbleClick 2025-05-21 14:15:58 +07:00
parent 7698ceb108
commit 3f8d297fb1
6 changed files with 8 additions and 13 deletions

View File

@ -336,7 +336,7 @@ class Extension
if ($this->patchBeforeSharedConfigure()) {
logger()->info('ext [ . ' . $this->getName() . '] patching before shared configure');
}
shell()->cd($this->source_dir)
->setEnv($env)
->execWithEnv('./configure ' . $this->getUnixConfigureArg(true) . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --with-pic')

View File

@ -74,7 +74,6 @@ class curl extends Extension
// Match the line containing PHP_CHECK_LIBRARY for curl
$pattern = '/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],)/';
// Restore LIBS after the check — append this just after the macro block
$restore = '
LIBS="$save_LIBS"';
@ -87,13 +86,13 @@ class curl extends Extension
// Inject restore after the matching PHP_CHECK_LIBRARY block
$patched = preg_replace(
'/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],.*?\)\n)/s',
"$1$restore\n",
"$1{$restore}\n",
$patched,
1
);
if ($patched === null) {
throw new \RuntimeException("Failed to patch config.m4 due to a regex error");
throw new \RuntimeException('Failed to patch config.m4 due to a regex error');
}
FileSystem::writeFile($file, $patched);

View File

@ -21,11 +21,6 @@ class mbregex extends Extension
return '';
}
public function buildUnixShared(): void
{
print('mbregex is already built as part of mbstring, skipping build' . PHP_EOL);
}
/**
* mbregex is not an extension, we need to overwrite the default check.
*/

View File

@ -64,5 +64,6 @@ class sqlsrv extends Extension
// check shared extension with php-cli
if (file_exists(BUILD_BIN_PATH . '/php')) {
$this->runSharedExtensionCheckUnix();
} }
}
}
}

View File

@ -29,7 +29,7 @@ class xml extends Extension
'simplexml' => '--enable-simplexml',
default => throw new RuntimeException('Not accept non-xml extension'),
};
$arg .= ($shared ? '=shared' : '' ) . ' --with-libxml="' . BUILD_ROOT_PATH . '"';
$arg .= ($shared ? '=shared' : '') . ' --with-libxml="' . BUILD_ROOT_PATH . '"';
return $arg;
}

View File

@ -95,8 +95,8 @@ trait UnixLibraryTrait
logger()->debug('Patching ' . $realpath);
// replace prefix
$file = FileSystem::readFile($realpath);
$file = str_replace(' /lib/', ' ' . BUILD_LIB_PATH . '/', $file);
$file = preg_replace("/^libdir=.*$/m", "libdir='" . BUILD_LIB_PATH . "'", $file);
$file = str_replace(' /lib/', ' ' . BUILD_LIB_PATH . '/', $file);
+ $file = preg_replace('/^libdir=.*$/m', "libdir='" . BUILD_LIB_PATH . "'", $file);
FileSystem::writeFile($realpath, $file);
}
}