mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
sockets doesn't install header?!
This commit is contained in:
parent
05e9129a66
commit
c1e91e1ccb
@ -423,4 +423,14 @@ class Extension
|
|||||||
|
|
||||||
return $deps;
|
return $deps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before shared extension ./configure
|
||||||
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
|
*/
|
||||||
|
public function patchBeforeSharedBuild(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
21
src/SPC/builder/extension/sockets.php
Normal file
21
src/SPC/builder/extension/sockets.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('sockets')]
|
||||||
|
class sockets extends Extension
|
||||||
|
{
|
||||||
|
public function patchBeforeConfigure(): bool
|
||||||
|
{
|
||||||
|
if (file_exists(BUILD_INCLUDE_PATH . 'php/ext/sockets/php_sockets.h')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
copy(SOURCE_PATH . '/php-src/ext/sockets/php_sockets.h', BUILD_INCLUDE_PATH . 'php/ext/sockets/php_sockets.h');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -23,7 +23,7 @@ trait gmp
|
|||||||
])
|
])
|
||||||
->execWithEnv(
|
->execWithEnv(
|
||||||
'./configure ' .
|
'./configure ' .
|
||||||
'--enable-static --disable-shared ' .
|
'--enable-static --disable-shared --with-pic ' .
|
||||||
'--prefix='
|
'--prefix='
|
||||||
)
|
)
|
||||||
->execWithEnv('make clean')
|
->execWithEnv('make clean')
|
||||||
|
|||||||
@ -208,7 +208,9 @@ class BuildPHPCommand extends BuildCommand
|
|||||||
SourcePatcher::patchSPCVersionToPHP($this->getApplication()->getVersion());
|
SourcePatcher::patchSPCVersionToPHP($this->getApplication()->getVersion());
|
||||||
|
|
||||||
// start to build
|
// start to build
|
||||||
$builder->buildPHP($rule);
|
// $builder->buildPHP($rule);
|
||||||
|
|
||||||
|
SourcePatcher::patchBeforeSharedBuild($builder);
|
||||||
|
|
||||||
// build dynamic extensions if needed
|
// build dynamic extensions if needed
|
||||||
if (!empty($shared_extensions)) {
|
if (!empty($shared_extensions)) {
|
||||||
|
|||||||
@ -78,6 +78,15 @@ class SourcePatcher
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function patchBeforeSharedBuild(BuilderBase $builder): void
|
||||||
|
{
|
||||||
|
foreach ($builder->getExts() as $ext) {
|
||||||
|
if ($ext->patchBeforeSharedBuild() === true) {
|
||||||
|
logger()->info('Extension [' . $ext->getName() . '] patched before shared build');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Source patcher runner before configure
|
* Source patcher runner before configure
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user