execWithResult(quote($path) . ' -v')[1]), 'MSWin32')) { return CheckResult::fail($path . ' is not built for msvc.', 'install-perl'); } return CheckResult::ok(); } #[AsFixItem('install-php-sdk')] public function installPhpSdk(): bool { try { FileSystem::removeDir(PHP_SDK_PATH); cmd(true)->exec('git.exe clone --depth 1 https://github.com/php/php-sdk-binary-tools.git ' . PHP_SDK_PATH); } catch (RuntimeException) { return false; } return true; } #[AsFixItem('install-nasm')] public function installNasm(): bool { // The hardcoded version here is to be consistent with the version compiled by `musl-cross-toolchain`. $nasm_ver = '2.16.01'; $nasm_dist = "nasm-{$nasm_ver}"; $source = [ 'type' => 'url', 'url' => "https://www.nasm.us/pub/nasm/releasebuilds/{$nasm_ver}/win64/{$nasm_dist}-win64.zip", ]; logger()->info('Downloading ' . $source['url']); Downloader::downloadSource('nasm', $source); FileSystem::extractSource('nasm', DOWNLOAD_PATH . "\\{$nasm_dist}-win64.zip"); copy(SOURCE_PATH . "\\nasm\\{$nasm_dist}\\nasm.exe", PHP_SDK_PATH . '\bin\nasm.exe'); copy(SOURCE_PATH . "\\nasm\\{$nasm_dist}\\ndisasm.exe", PHP_SDK_PATH . '\bin\ndisasm.exe'); return true; } #[AsFixItem('install-perl')] public function installPerl(): bool { $url = 'https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_5380_5361/strawberry-perl-5.38.0.1-64bit-portable.zip'; $source = [ 'type' => 'url', 'url' => $url, ]; logger()->info("Downloading {$url}"); Downloader::downloadSource('strawberry-perl', $source); FileSystem::extractSource('strawberry-perl', DOWNLOAD_PATH . '\strawberry-perl-5.38.0.1-64bit-portable.zip', '../buildroot/perl'); return true; } }