diff --git a/config/ext.json b/config/ext.json index 6955c0a8..1df91d3b 100644 --- a/config/ext.json +++ b/config/ext.json @@ -958,7 +958,6 @@ }, "xlswriter": { "support": { - "Windows": "wip", "BSD": "wip" }, "type": "external", diff --git a/src/SPC/builder/extension/xlswriter.php b/src/SPC/builder/extension/xlswriter.php index 6319ce31..bf6f8994 100644 --- a/src/SPC/builder/extension/xlswriter.php +++ b/src/SPC/builder/extension/xlswriter.php @@ -18,4 +18,23 @@ class xlswriter extends Extension } return $arg; } + + public function getWindowsConfigureArg(): string + { + return '--with-xlswriter'; + } + + public function patchBeforeMake(): bool + { + if (PHP_OS_FAMILY === 'Windows') { + $content = file_get_contents($this->source_dir . '/library/libxlsxwriter/src/theme.c'); + $bom = pack('CCC', 0xEF, 0xBB, 0xBF); + if (substr($content, 0, 3) !== $bom) { + file_put_contents($this->source_dir . '/library/libxlsxwriter/src/theme.c', $content); + return true; + } + return false; + } + return false; + } } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 0ff22ab3..0ed31649 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -13,23 +13,23 @@ declare(strict_types=1); // test php version (8.1 ~ 8.4 available, multiple for matrix) $test_php_version = [ - // '8.1', - // '8.2', - // '8.3', + '8.1', + '8.2', + '8.3', '8.4', ]; // test os (macos-13, macos-14, macos-15, ubuntu-latest, windows-latest are available) $test_os = [ // 'macos-13', - 'macos-14', - 'macos-15', + // 'macos-14', + // 'macos-15', // 'ubuntu-latest', // 'ubuntu-22.04', // 'ubuntu-24.04', // 'ubuntu-22.04-arm', // 'ubuntu-24.04-arm', - // 'windows-latest', + 'windows-latest', ]; // whether enable thread safe @@ -46,7 +46,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', - 'Windows' => 'ev', + 'Windows' => 'xlswriter', }; // If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).