mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
Add ext-rar
This commit is contained in:
parent
067749ab1b
commit
a288533fc3
12
config/pkg/ext/ext-rar.yml
Normal file
12
config/pkg/ext/ext-rar.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
ext-rar:
|
||||||
|
type: php-extension
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: git
|
||||||
|
url: 'https://github.com/static-php/php-rar.git'
|
||||||
|
rev: issue-php82
|
||||||
|
extract: php-src/ext/rar
|
||||||
|
metadata:
|
||||||
|
license-files: [LICENSE]
|
||||||
|
license: PHP-3.01
|
||||||
|
lang: cpp
|
||||||
27
src/Package/Extension/rar.php
Normal file
27
src/Package/Extension/rar.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Extension;
|
||||||
|
|
||||||
|
use Package\Target\php;
|
||||||
|
use StaticPHP\Attribute\Package\BeforeStage;
|
||||||
|
use StaticPHP\Attribute\Package\Extension;
|
||||||
|
use StaticPHP\Attribute\PatchDescription;
|
||||||
|
use StaticPHP\Package\PhpExtensionPackage;
|
||||||
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
|
use StaticPHP\Util\FileSystem;
|
||||||
|
|
||||||
|
#[Extension('rar')]
|
||||||
|
class rar extends PhpExtensionPackage
|
||||||
|
{
|
||||||
|
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-rar')]
|
||||||
|
#[PatchDescription('rar extension workaround for newer Xcode clang (>= 15.0)')]
|
||||||
|
public function patchBeforeBuildconf(): void
|
||||||
|
{
|
||||||
|
// workaround for newer Xcode clang (>= 15.0)
|
||||||
|
if (SystemTarget::getTargetOS() === 'Darwin') {
|
||||||
|
FileSystem::replaceFileStr("{$this->getSourceDir()}/config.m4", '-Wall -fvisibility=hidden', '-Wall -Wno-incompatible-function-pointer-types -fvisibility=hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user