mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 16:55:38 +08:00
Support define php extension arg-type in config
This commit is contained in:
20
src/Package/Artifact/gmssl.php
Normal file
20
src/Package/Artifact/gmssl.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Artifact;
|
||||
|
||||
use StaticPHP\Attribute\Artifact\AfterSourceExtract;
|
||||
use StaticPHP\Attribute\PatchDescription;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
|
||||
class gmssl
|
||||
{
|
||||
#[AfterSourceExtract('gmssl')]
|
||||
#[PatchDescription('Patch gmssl hex.c to rename OPENSSL functions to GMSSL')]
|
||||
public function patch(string $target_path): void
|
||||
{
|
||||
FileSystem::replaceFileStr($target_path . '/src/hex.c', 'unsigned char *OPENSSL_hexstr2buf(const char *str, size_t *len)', 'unsigned char *GMSSL_hexstr2buf(const char *str, size_t *len)');
|
||||
FileSystem::replaceFileStr($target_path . '/src/hex.c', 'OPENSSL_hexchar2int', 'GMSSL_hexchar2int');
|
||||
}
|
||||
}
|
||||
22
src/Package/Artifact/libaom.php
Normal file
22
src/Package/Artifact/libaom.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Artifact;
|
||||
|
||||
use StaticPHP\Attribute\Artifact\AfterSourceExtract;
|
||||
use StaticPHP\Attribute\PatchDescription;
|
||||
use StaticPHP\Runtime\SystemTarget;
|
||||
use StaticPHP\Util\SourcePatcher;
|
||||
use StaticPHP\Util\System\LinuxUtil;
|
||||
|
||||
class libaom
|
||||
{
|
||||
#[AfterSourceExtract('libaom')]
|
||||
#[PatchDescription('Patch libaom for Linux Musl distributions - posix implicit declaration')]
|
||||
public function patch(string $target_path): void
|
||||
{
|
||||
spc_skip_if(SystemTarget::getTargetOS() !== 'Linux' || !LinuxUtil::isMuslDist(), 'Only for Linux Musl distros');
|
||||
SourcePatcher::patchFile('libaom_posix_implict.patch', $target_path);
|
||||
}
|
||||
}
|
||||
19
src/Package/Artifact/pkg_config.php
Normal file
19
src/Package/Artifact/pkg_config.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Artifact;
|
||||
|
||||
use StaticPHP\Attribute\Artifact\AfterSourceExtract;
|
||||
use StaticPHP\Attribute\PatchDescription;
|
||||
use StaticPHP\Util\SourcePatcher;
|
||||
|
||||
class pkg_config
|
||||
{
|
||||
#[AfterSourceExtract('pkg-config')]
|
||||
#[PatchDescription('Patch pkg-config for GCC 15 compatibility - __builtin_available issue')]
|
||||
public function patch(string $target_path): void
|
||||
{
|
||||
SourcePatcher::patchFile('pkg-config_gcc15.patch', $target_path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user