zig toolchain stuff

This commit is contained in:
DubbleClick
2025-07-01 14:01:48 +07:00
parent 5370af4a84
commit 0a33fba23e
10 changed files with 149 additions and 38 deletions

View File

@@ -11,6 +11,27 @@ use SPC\store\LockFile;
class Zig extends CustomPackage
{
private static function getPath(): string
{
$arch = arch2gnu(php_uname('m'));
$os = match (PHP_OS_FAMILY) {
'Linux' => 'linux',
'Windows' => 'win',
'Darwin' => 'macos',
'BSD' => 'freebsd',
default => 'linux',
};
$packageName = "zig-{$arch}-{$os}";
return PKG_ROOT_PATH . "/{$packageName}";
}
public static function isInstalled(): bool
{
$path = self::getPath();
return file_exists("$path/zig") && file_exists("$path/zig-cc") && file_exists("$path/zig-c++");
}
public function getSupportName(): array
{
return [