diff --git a/src/Package/Extension/xlswriter.php b/src/Package/Extension/xlswriter.php index 9af2d6db..bcb9cafd 100644 --- a/src/Package/Extension/xlswriter.php +++ b/src/Package/Extension/xlswriter.php @@ -11,6 +11,7 @@ use StaticPHP\Attribute\Package\Extension; use StaticPHP\Attribute\PatchDescription; use StaticPHP\Package\PackageInstaller; use StaticPHP\Package\PhpExtensionPackage; +use StaticPHP\Util\FileSystem; use StaticPHP\Util\SourcePatcher; #[Extension('xlswriter')] @@ -28,6 +29,17 @@ class xlswriter extends PhpExtensionPackage return $arg; } + #[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-xlswriter')] + #[PatchDescription('Define XML_STATIC so bundled Expat uses plain symbols instead of __declspec(dllimport) in static builds')] + public function patchConfigForStaticExpat(): void + { + FileSystem::replaceFileStr( + "{$this->getSourceDir()}/config.w32", + "' /D USE_SYSTEM_MINIZIP", + "' /D XML_STATIC /D USE_SYSTEM_MINIZIP" + ); + } + #[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