From 935f3fc37c365a0603a0b913c2179eef7af18331 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Thu, 26 Jun 2025 14:29:00 +0700 Subject: [PATCH] cs fix --- src/SPC/store/pkg/GoXcaddy.php | 1 - src/SPC/store/pkg/Zig.php | 40 ++++++++++++++++------------------ 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/SPC/store/pkg/GoXcaddy.php b/src/SPC/store/pkg/GoXcaddy.php index 5c089fc9..c61511a3 100644 --- a/src/SPC/store/pkg/GoXcaddy.php +++ b/src/SPC/store/pkg/GoXcaddy.php @@ -94,5 +94,4 @@ class GoXcaddy extends CustomPackage 'GOPATH' => "{$pkgroot}/go", ]; } - } diff --git a/src/SPC/store/pkg/Zig.php b/src/SPC/store/pkg/Zig.php index 6784361c..8b4be583 100644 --- a/src/SPC/store/pkg/Zig.php +++ b/src/SPC/store/pkg/Zig.php @@ -104,15 +104,32 @@ class Zig extends CustomPackage $filename = DOWNLOAD_PATH . '/' . ($lock[$name]['filename'] ?? $lock[$name]['dirname']); $extract = "{$pkgroot}/{$name}"; - FileSystem::extractPackage($name, $source_type, $filename, $extract); $this->createZigCcScript($zig_bin_dir); } + public static function getEnvironment(): array + { + $arch = arch2gnu(php_uname('m')); + $os = match (PHP_OS_FAMILY) { + 'Linux' => 'linux', + 'Windows' => 'win', + 'Darwin' => 'macos', + 'BSD' => 'freebsd', + default => 'linux', + }; + + $packageName = "zig-{$arch}-{$os}"; + $path = PKG_ROOT_PATH . "/{$packageName}"; + + return [ + 'PATH' => $path, + ]; + } + private function createZigCcScript(string $bin_dir): void { - $script_content = <<<'EOF' #!/usr/bin/env bash @@ -202,23 +219,4 @@ EOF; file_put_contents("{$bin_dir}/zig-c++", $script_content); chmod("{$bin_dir}/zig-c++", 0755); } - - public static function getEnvironment(): array - { - $arch = arch2gnu(php_uname('m')); - $os = match (PHP_OS_FAMILY) { - 'Linux' => 'linux', - 'Windows' => 'win', - 'Darwin' => 'macos', - 'BSD' => 'freebsd', - default => 'linux', - }; - - $packageName = "zig-{$arch}-{$os}"; - $path = PKG_ROOT_PATH . "/{$packageName}"; - - return [ - 'PATH' => $path - ]; - } }