mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Separate package config
This commit is contained in:
@@ -27,9 +27,9 @@ class openssl
|
||||
spc_skip_if(!file_exists("{$target_path}/openssl/test/v3ext.c"), 'v3ext.c not found, skipping patch.');
|
||||
|
||||
FileSystem::replaceFileStr(
|
||||
SOURCE_PATH . '/openssl/test/v3ext.c',
|
||||
"{$target_path}/openssl/test/v3ext.c",
|
||||
'#include <stdio.h>',
|
||||
'#include <stdio.h>' . PHP_EOL . '#include <string.h>'
|
||||
"#include <stdio.h>\n#include <string.h>"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
25
src/Package/Library/gmp.php
Normal file
25
src/Package/Library/gmp.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Library;
|
||||
|
||||
use StaticPHP\Attribute\Package\BuildFor;
|
||||
use StaticPHP\Attribute\Package\Library;
|
||||
use StaticPHP\Package\LibraryPackage;
|
||||
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||
|
||||
#[Library('gmp')]
|
||||
class gmp
|
||||
{
|
||||
#[BuildFor('Linux')]
|
||||
#[BuildFor('Darwin')]
|
||||
public function build(LibraryPackage $lib): void
|
||||
{
|
||||
UnixAutoconfExecutor::create($lib)
|
||||
->appendEnv(['CFLAGS' => '-std=c17'])
|
||||
->configure('--enable-fat')
|
||||
->make();
|
||||
$lib->patchPkgconfPrefix(['gmp.pc']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user