add ssh2 support

This commit is contained in:
crazywhalecc 2023-05-10 02:31:57 +08:00
parent 7527f9f099
commit a329445701
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
3 changed files with 31 additions and 0 deletions

View File

@ -302,6 +302,14 @@
"sqlite"
]
},
"ssh2": {
"type": "external",
"source": "ext-ssh2",
"arg-type": "with-prefix",
"lib-depends": [
"libssh2"
]
},
"swoole": {
"type": "external",
"source": "swoole",

View File

@ -61,6 +61,16 @@
"path": "LICENSE"
}
},
"ext-ssh2": {
"type": "url",
"url": "http://pecl.php.net/get/ssh2",
"path": "php-src/ext/ssh2",
"filename": "ssh2.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-zstd": {
"type": "git",
"path": "php-src/ext/zstd",

View File

@ -85,6 +85,9 @@ class SourcePatcher
if ($readline = $builder->getExt('readline')) {
$patch[] = ['readline patch', '/-lncurses/', $readline->getLibFilesString()];
}
if ($ssh2 = $builder->getExt('ssh2')) {
$patch[] = ['ssh2 patch', '/-lssh2/', $ssh2->getLibFilesString()];
}
$patch[] = ['disable capstone', '/have_capstone="yes"/', 'have_capstone="no"'];
foreach ($patch as $item) {
logger()->info('Patching configure: ' . $item[0]);
@ -110,6 +113,16 @@ class SourcePatcher
}
}
public static function patchUnixSsh2(): void
{
FileSystem::replaceFile(
SOURCE_PATH . '/php-src/configure',
REPLACE_FILE_STR,
'-lssh2',
BUILD_LIB_PATH . '/libssh2.a'
);
}
public static function patchCurlMacOS(): void
{
FileSystem::replaceFile(