getLibraryPackage('openssl')) { $arg .= ' --with-openssl=' . $installer->getLibraryPackage('openssl')->getBuildRootPath(); } return $arg; } #[BeforeStage('php', [php::class, 'makeForWindows'], 'ext-xlswriter')] #[PatchDescription('Fix Windows build: apply win32 patch and add UTF-8 BOM to theme.c')] public function patchBeforeMakeForWindows(): void { // fix windows build with openssl extension duplicate symbol bug SourcePatcher::patchFile('spc_fix_xlswriter_win32.patch', $this->getSourceDir()); $content = file_get_contents($this->getSourceDir() . '/library/libxlsxwriter/src/theme.c'); $bom = pack('CCC', 0xEF, 0xBB, 0xBF); if (!str_starts_with($content, $bom)) { file_put_contents($this->getSourceDir() . '/library/libxlsxwriter/src/theme.c', $bom . $content); } } }