Skip to content

Commit 2948663

Browse files
committed
chore: wip
1 parent 9bec7a0 commit 2948663

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

scripts/build-php.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,17 @@ function generateConfigureArgs(config: BuildConfig, installPrefix: string): stri
284284
`--with-openssl=${launchpadPath}/openssl.org/v1.1.1w`,
285285
`--with-sodium=${launchpadPath}/libsodium.org/v1.0.18`,
286286
`--with-xsl=${launchpadPath}/gnome.org/libxslt/v1.1.43`,
287-
`--with-zlib=${launchpadPath}/zlib.net/v1.3.1`
287+
`--with-zlib=${launchpadPath}/zlib.net/v1.3.1`,
288+
`--with-bz2=${launchpadPath}/bzip.org/v1.0.8`
288289
]
289290

290291
// Platform-specific arguments
291292
if (config.platform === 'darwin') {
292293
return [
293294
...baseArgs,
294295
...dependencyArgs,
295-
'--with-iconv', // Re-enable iconv with Launchpad dependencies
296+
'--with-iconv',
296297
'--enable-opcache',
297-
'--with-bz2',
298298
'--with-kerberos',
299299
'--with-libedit',
300300
'--with-zip',
@@ -307,7 +307,6 @@ function generateConfigureArgs(config: BuildConfig, installPrefix: string): stri
307307
...dependencyArgs,
308308
'--with-iconv', // Use system iconv on Linux
309309
'--enable-opcache',
310-
'--with-bz2',
311310
'--with-kerberos',
312311
'--with-readline',
313312
'--with-zip',
@@ -497,7 +496,7 @@ ${essentialExtensions
497496
498497
; Enable additional available extensions (excluding problematic ones)
499498
${extensions
500-
.filter(ext => !essentialExtensions.includes(ext) &&
499+
.filter(ext => !essentialExtensions.includes(ext) &&
501500
!['opcache', 'pdo_firebird', 'snmp', 'pcntl', 'posix'].includes(ext))
502501
.map(ext => `extension=${ext}`)
503502
.join('\n')}
@@ -687,7 +686,7 @@ async function buildPhp(config: BuildConfig): Promise<string> {
687686
let buildEnv = { ...process.env }
688687
const homeDir = process.env.HOME || process.env.USERPROFILE || '/Users/chrisbreuer'
689688
const launchpadRoot = `${homeDir}/.local`
690-
689+
691690
// Add essential Launchpad paths to PATH
692691
const launchpadBinPaths = [
693692
`${launchpadRoot}/gnu.org/autoconf/v2.72.0/bin`,
@@ -696,9 +695,9 @@ async function buildPhp(config: BuildConfig): Promise<string> {
696695
`${launchpadRoot}/gnu.org/automake/v1.18.1/bin`,
697696
`${launchpadRoot}/freedesktop.org/pkg-config/v0.29.2/bin`
698697
]
699-
698+
700699
buildEnv.PATH = `${launchpadBinPaths.join(':')}:${buildEnv.PATH}`
701-
700+
702701
// Set up targeted PKG_CONFIG_PATH for essential libraries
703702
const pkgConfigPaths = [
704703
`${launchpadRoot}/gnu.org/libiconv/v1.18.0/lib/pkgconfig`,
@@ -865,21 +864,21 @@ exec "$@"
865864
// Source the Launchpad environment and run configure in the same shell
866865
const buildEnvScript = `${homeDir}/.local/build-env.sh`
867866
let configureCommand: string
868-
867+
869868
// Check if Launchpad environment script exists, otherwise install dependencies first
870869
if (existsSync(buildEnvScript)) {
871870
configureCommand = `source ${buildEnvScript} && ./configure ${configureArgs.join(' ')}`
872871
} else {
873872
log('⚠️ Launchpad build-env.sh not found, installing PHP dependencies first')
874-
873+
875874
// Install PHP dependencies using Launchpad
876875
try {
877876
execSync('bun ./launchpad install php --deps-only', {
878877
stdio: 'inherit',
879878
cwd: process.cwd()
880879
})
881880
log('✅ Launchpad dependencies installed successfully')
882-
881+
883882
// Now try to source the environment script
884883
if (existsSync(buildEnvScript)) {
885884
configureCommand = `source ${buildEnvScript} && ./configure ${configureArgs.join(' ')}`

0 commit comments

Comments
 (0)