Refactor package stage handling and update class structures for improved flexibility

This commit is contained in:
crazywhalecc
2025-12-09 14:58:11 +08:00
parent e004d10861
commit 808aed2a66
29 changed files with 416 additions and 115 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Package\Library;
use Package\Target\php;
use StaticPHP\Attribute\Package\AfterStage;
use StaticPHP\Attribute\Package\Library;
use StaticPHP\Attribute\PatchDescription;
@@ -13,7 +14,7 @@ use StaticPHP\Util\FileSystem;
#[Library('imap')]
class imap
{
#[AfterStage('php', 'patch-embed-scripts', 'imap')]
#[AfterStage('php', [php::class, 'patchEmbedScripts'], 'imap')]
#[PatchDescription('Fix missing -lcrypt in php-config libs on glibc systems')]
public function afterPatchScripts(): void
{

View File

@@ -14,7 +14,7 @@ use StaticPHP\Util\FileSystem;
#[Library('libedit')]
class libedit extends LibraryPackage
{
#[BeforeStage('libedit', 'build')]
#[BeforeStage(stage: 'build')]
public function patchBeforeBuild(): void
{
FileSystem::replaceFileRegex(

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Package\Library;
use Package\Target\php;
use StaticPHP\Attribute\Package\BeforeStage;
use StaticPHP\Attribute\Package\Library;
use StaticPHP\Attribute\PatchDescription;
@@ -12,7 +13,7 @@ use StaticPHP\Package\TargetPackage;
#[Library('postgresql')]
class postgresql
{
#[BeforeStage('php', 'unix-configure', 'postgresql')]
#[BeforeStage('php', [php::class, 'configureForUnix'], 'postgresql')]
#[PatchDescription('Patch to avoid explicit_bzero detection issues on some systems')]
public function patchBeforePHPConfigure(TargetPackage $package): void
{