mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
Add target htop
This commit is contained in:
parent
0b0ecd17c3
commit
9e2a5ce188
10
config/pkg/target/htop.yml
Normal file
10
config/pkg/target/htop.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
htop:
|
||||||
|
type: target
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: ghrel
|
||||||
|
repo: htop-dev/htop
|
||||||
|
match: htop.+\.tar\.xz
|
||||||
|
prefer-stable: true
|
||||||
|
depends:
|
||||||
|
- ncursesw
|
||||||
29
src/Package/Target/htop.php
Normal file
29
src/Package/Target/htop.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Target;
|
||||||
|
|
||||||
|
use StaticPHP\Attribute\Package\BuildFor;
|
||||||
|
use StaticPHP\Attribute\Package\Target;
|
||||||
|
use StaticPHP\Package\TargetPackage;
|
||||||
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
|
use StaticPHP\Toolchain\Interface\ToolchainInterface;
|
||||||
|
|
||||||
|
#[Target('htop')]
|
||||||
|
class htop extends TargetPackage
|
||||||
|
{
|
||||||
|
#[BuildFor('Darwin')]
|
||||||
|
#[BuildFor('Linux')]
|
||||||
|
public function build(ToolchainInterface $toolchain): void
|
||||||
|
{
|
||||||
|
// htop's --enable-static adds -static to CFLAGS/LDFLAGS globally (not just for .a libraries),
|
||||||
|
// which causes zig-cc to fail on glibc targets. Only enable it for truly static (musl) builds.
|
||||||
|
UnixAutoconfExecutor::create($this)
|
||||||
|
->removeConfigureArgs('--disable-shared', '--enable-static')
|
||||||
|
->exec('./autogen.sh')
|
||||||
|
->addConfigureArgs($toolchain->isStatic() ? '--enable-static' : '--disable-static')
|
||||||
|
->configure()
|
||||||
|
->make(with_clean: false);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user