Merge pull request #723 from crazywhalecc/fix/xslt

fix libxslt build when trying to create a PIE executable using it
This commit is contained in:
Marc 2025-05-07 10:50:04 +07:00 committed by GitHub
commit e884f97621
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 15 deletions

View File

@ -25,12 +25,14 @@ trait libxslt
}
}
shell()->cd($this->source_dir)
->exec(
'CFLAGS="-I' . BUILD_INCLUDE_PATH . '" ' .
->setEnv([
'CFLAGS' => trim($this->getLibExtraCFlags() . ' -I' . BUILD_INCLUDE_PATH),
'LDFLAGS' => trim($this->getLibExtraLdFlags() . ' -L' . BUILD_LIB_PATH),
'LIBS' => trim($this->getLibExtraLibs() . "{$required_libs} -lstdc++"),
])
->execWithEnv(
"{$this->builder->getOption('library_path')} " .
"{$this->builder->getOption('ld_library_path')} " .
'LDFLAGS="-L' . BUILD_LIB_PATH . '" ' .
"LIBS='{$required_libs} -lstdc++' " .
'./configure ' .
'--enable-static --disable-shared ' .
'--without-python ' .
@ -41,9 +43,9 @@ trait libxslt
'--with-libxml-prefix=' . escapeshellarg(BUILD_ROOT_PATH) . ' ' .
'--prefix='
)
->exec('make clean')
->exec("make -j{$this->builder->concurrency}")
->exec('make install DESTDIR=' . escapeshellarg(BUILD_ROOT_PATH));
->execWithEnv('make clean')
->execWithEnv("make -j{$this->builder->concurrency}")
->execWithEnv('make install DESTDIR=' . escapeshellarg(BUILD_ROOT_PATH));
$this->patchPkgconfPrefix(['libexslt.pc']);
}
}

View File

@ -21,15 +21,15 @@ $test_php_version = [
// test os (macos-13, macos-14, macos-15, ubuntu-latest, windows-latest are available)
$test_os = [
// 'macos-13',
'macos-13',
// 'macos-14',
// 'macos-15',
// 'ubuntu-latest',
// 'ubuntu-22.04',
'macos-15',
'ubuntu-latest',
'ubuntu-22.04',
// 'ubuntu-24.04',
// 'ubuntu-22.04-arm',
// 'ubuntu-24.04-arm',
'windows-latest',
'ubuntu-22.04-arm',
'ubuntu-24.04-arm',
// 'windows-latest',
];
// whether enable thread safe
@ -45,7 +45,7 @@ $prefer_pre_built = false;
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'pgsql',
'Linux', 'Darwin' => 'xsl,simplexml,xlswriter',
'Windows' => 'xlswriter,openssl',
};