Skip to content

Commit

Permalink
Merge pull request #413 from tucksaun/fix/macos-static-build
Browse files Browse the repository at this point in the history
fix: fix macos static builds
  • Loading branch information
joelwurtz authored Apr 16, 2024
2 parents 3dde2c7 + 48f4e96 commit 95c1eb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Console/Command/CompileCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->buildPHP(
$spcBinaryPath,
$phpExtensions,
$os = $input->getOption('os'),
('macos' === $os && 'aarch64' === $arch) ? 'arm64' : $arch,
$spcBinaryDir,
$io,
Expand Down Expand Up @@ -173,7 +174,7 @@ private function downloadPHPSourceDeps(string $spcBinaryPath, mixed $phpExtensio
$downloadProcess->mustRun(fn ($type, $buffer) => print $buffer);
}

private function buildPHP(string $spcBinaryPath, mixed $phpExtensions, mixed $arch, string $spcBinaryDir, SymfonyStyle $io, bool $debug = false): void
private function buildPHP(string $spcBinaryPath, mixed $phpExtensions, mixed $os, mixed $arch, string $spcBinaryDir, SymfonyStyle $io, bool $debug = false): void
{
$command = [
$spcBinaryPath, 'build', $phpExtensions,
Expand All @@ -189,10 +190,10 @@ private function buildPHP(string $spcBinaryPath, mixed $phpExtensions, mixed $ar
$buildProcess = new Process(
command: $command,
cwd: $spcBinaryDir,
env: [
env: ('linux' === $os) ? [
'OPENSSL_LIBS' => '-l:libssl.a -l:libcrypto.a -ldl -lpthread',
'OPENSSL_CFLAGS' => sprintf('-I%s/source/openssl/include', $spcBinaryDir),
],
] : [],
timeout: null,
);
$io->text('Running command: ' . $buildProcess->getCommandLine());
Expand Down

0 comments on commit 95c1eb1

Please sign in to comment.