Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
c5efcc0
Fix wrongly using msys2 tar.exe
crazywhalecc Mar 20, 2026
3c9e868
Add spc-debug script on Windows
crazywhalecc Mar 20, 2026
46132ee
Fix doctor lock path on Windows
crazywhalecc Mar 20, 2026
1d2916f
Add brotli
crazywhalecc Mar 20, 2026
0c389d9
Add zlib
crazywhalecc Mar 20, 2026
464ddeb
Fix file copy operation to handle identical source and destination paths
crazywhalecc Mar 20, 2026
b21d571
Add onig
crazywhalecc Mar 20, 2026
9f3e353
Add bzip2
crazywhalecc Mar 20, 2026
03cd7e1
Add brotli libs
crazywhalecc Mar 20, 2026
d7d41f4
Add openssl
crazywhalecc Mar 20, 2026
94c579a
Add libssh2
crazywhalecc Mar 20, 2026
19bfb6b
Add zstd
crazywhalecc Mar 20, 2026
d1ec473
Allow set current working dir
crazywhalecc Mar 20, 2026
1213cb5
Refactor WindowsUtil to cache Visual Studio search results and add CM…
crazywhalecc Mar 20, 2026
eff7037
Add ngtcp2, remove suggested libs
crazywhalecc Mar 20, 2026
893f640
Add nghttp3
crazywhalecc Mar 20, 2026
9286166
Add nghttp2
crazywhalecc Mar 20, 2026
7df8616
Add libxml2
crazywhalecc Mar 20, 2026
f6e00c6
Refactor LibraryPackage to skip pkg-config and static-bin checks on W…
crazywhalecc Mar 20, 2026
deb9794
Add libiconv-win
crazywhalecc Mar 20, 2026
327bb8b
Add curl
crazywhalecc Mar 20, 2026
bd73b4a
phpstan
crazywhalecc Mar 20, 2026
230be2e
Add libpng
crazywhalecc Mar 21, 2026
5ff973e
Add freetype
crazywhalecc Mar 21, 2026
5207676
Add gmssl
crazywhalecc Mar 21, 2026
bf4d227
Add error handling for missing vswhere.exe in WindowsUtil
crazywhalecc Mar 21, 2026
75dd01a
Enhance package download logic to handle binary-only packages and imp…
crazywhalecc Mar 21, 2026
43d8c9d
Add icu (replace old icu-static-win)
crazywhalecc Mar 21, 2026
801d41e
Add libwebp
crazywhalecc Mar 21, 2026
36177e4
Add libjpeg
crazywhalecc Mar 21, 2026
33f3343
Add libavif
crazywhalecc Mar 21, 2026
a950f3d
Add libaom
crazywhalecc Mar 21, 2026
9af132d
Add missing icu license file
crazywhalecc Mar 21, 2026
adff728
Add libffi-win
crazywhalecc Mar 21, 2026
e443464
Add jom to reduce openssl building time
crazywhalecc Mar 21, 2026
08dca42
Add librabbitmq
crazywhalecc Mar 21, 2026
508cfa6
Make openssl build faster
crazywhalecc Mar 21, 2026
af97263
Forward-port #1070
crazywhalecc Mar 22, 2026
141c737
Add libsodium
crazywhalecc Mar 23, 2026
6d91f8b
Add patch description for Windows static linking in libsodium
crazywhalecc Mar 23, 2026
41f5948
Add libyaml
crazywhalecc Mar 23, 2026
1f42f1a
Add libzip
crazywhalecc Mar 24, 2026
2a50015
Add download options for install-pkg command
crazywhalecc Mar 24, 2026
7c3022b
Add postgresql (replace postgresql-win)
crazywhalecc Mar 24, 2026
bf05af7
Add pthreads4w
crazywhalecc Mar 24, 2026
175567f
Add missing postgresql license
crazywhalecc Mar 24, 2026
6c52451
Add qdbm
crazywhalecc Mar 24, 2026
fcd0052
Add sqlite
crazywhalecc Mar 24, 2026
93c099d
Add xz
crazywhalecc Mar 24, 2026
b625d80
Fix tar command for unix
crazywhalecc Mar 24, 2026
590a94a
Fix cli checks caused php testing fail
crazywhalecc Mar 24, 2026
9cd3125
Patch configure script to include liblber for ldap dependency
crazywhalecc Mar 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions bin/spc-debug.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$PHP_Exec = ".\runtime\php.exe"

if (-not(Test-Path $PHP_Exec)) {
$PHP_Exec = Get-Command php.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Definition
if (-not $PHP_Exec) {
Write-Host "Error: PHP not found, you need to install PHP on your system or use 'bin/setup-runtime'." -ForegroundColor Red
exit 1
}
}

& "$PHP_Exec" -d xdebug.mode=debug -d xdebug.client_host=127.0.0.1 -d xdebug.client_port=9003 -d xdebug.start_with_request=yes ("bin/spc") @args
exit $LASTEXITCODE
4 changes: 4 additions & 0 deletions config/pkg/lib/brotli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ brotli:
- libbrotlicommon
- libbrotlidec
- libbrotlienc
static-libs@windows:
- brotlicommon.lib
- brotlidec.lib
- brotlienc.lib
3 changes: 3 additions & 0 deletions config/pkg/lib/bzip2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ bzip2:
- bzlib.h
static-libs@unix:
- libbz2.a
static-libs@windows:
- libbz2.lib
- libbz2_a.lib
1 change: 1 addition & 0 deletions config/pkg/lib/freetype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ freetype:
depends:
- zlib
suggests:
- libpng
- bzip2
- brotli
headers@unix:
Expand Down
11 changes: 10 additions & 1 deletion config/pkg/lib/icu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ icu:
repo: unicode-org/icu
match: icu4c.+-src\.tgz
prefer-stable: true
binary:
windows-x86_64: { type: url, url: 'https://dl.static-php.dev/static-php-cli/deps/icu-static-windows-x64/icu-static-windows-x64.zip', extract: hosted }
metadata:
license-files: [LICENSE]
license-files: ['@/icu.txt']
license: ICU
headers@windows:
- unicode
lang: cpp
pkg-configs:
- icu-uc
- icu-i18n
- icu-io
static-libs@windows:
- icudt.lib
- icuin.lib
- icuio.lib
- icuuc.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/libaom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ libaom:
lang: cpp
static-libs@unix:
- libaom.a
static-libs@windows:
- aom.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/libavif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ libavif:
- libpng
static-libs@unix:
- libavif.a
static-libs@windows:
- avif.lib
12 changes: 12 additions & 0 deletions config/pkg/lib/libffi-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
libffi-win:
type: library
artifact:
source:
type: git
rev: master
url: 'https://github.com/static-php/libffi-win.git'
metadata:
license-files: [LICENSE]
license: MIT
static-libs@windows:
- libffi.lib
13 changes: 13 additions & 0 deletions config/pkg/lib/libiconv-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
libiconv-win:
type: library
artifact:
source:
type: git
rev: master
url: 'https://github.com/static-php/libiconv-win.git'
metadata:
license-files: [source/COPYING]
license: GPL-3.0-or-later
static-libs@windows:
- libiconv.lib
- libiconv_a.lib
4 changes: 4 additions & 0 deletions config/pkg/lib/libjpeg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ libjpeg:
metadata:
license-files: [LICENSE.md]
license: IJG
suggests@windows:
- zlib
static-libs@unix:
- libjpeg.a
- libturbojpeg.a
static-libs@windows:
- libjpeg_a.lib
3 changes: 3 additions & 0 deletions config/pkg/lib/libpng.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ libpng:
- zlib
static-libs@unix:
- libpng16.a
static-libs@windows:
- libpng16_static.lib
- libpng_a.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/librabbitmq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ librabbitmq:
- openssl
static-libs@unix:
- librabbitmq.a
static-libs@windows:
- rabbitmq.4.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/libsodium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ libsodium:
- libsodium
static-libs@unix:
- libsodium.a
static-libs@windows:
- libsodium.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/libssh2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ libssh2:
- libssh2
static-libs@unix:
- libssh2.a
static-libs@windows:
- libssh2.lib
5 changes: 5 additions & 0 deletions config/pkg/lib/libwebp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ libwebp:
- libwebpdemux
- libwebpmux
- libsharpyuv
static-libs@windows:
- libwebp.lib
- libwebpdecoder.lib
- libwebpdemux.lib
- libsharpyuv.lib
6 changes: 6 additions & 0 deletions config/pkg/lib/libxml2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ libxml2:
- libiconv
- zlib
- xz
depends@windows:
- zlib
- libiconv-win
headers:
- libxml2
pkg-configs:
- libxml-2.0
static-libs@windows:
- libxml2s.lib
- libxml2_a.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/libyaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ libyaml:
- yaml.h
static-libs@unix:
- libyaml.a
static-libs@windows:
- yaml.lib
7 changes: 5 additions & 2 deletions config/pkg/lib/libzip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ libzip:
prefer-stable: true
metadata:
license-files: [LICENSE]
depends@unix:
license: BSD-3-Clause
depends:
- zlib
suggests@unix:
suggests:
- bzip2
- xz
- zstd
Expand All @@ -20,3 +21,5 @@ libzip:
- zipconf.h
static-libs@unix:
- libzip.a
static-libs@windows:
- libzip_a.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/nghttp2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ nghttp2:
- libnghttp2
static-libs@unix:
- libnghttp2.a
static-libs@windows:
- nghttp2.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/nghttp3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ nghttp3:
- libnghttp3
static-libs@unix:
- libnghttp3.a
static-libs@windows:
- nghttp3.lib
5 changes: 2 additions & 3 deletions config/pkg/lib/ngtcp2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ ngtcp2:
license: MIT
depends:
- openssl
suggests:
- nghttp3
- brotli
headers:
- ngtcp2
pkg-configs:
Expand All @@ -22,3 +19,5 @@ ngtcp2:
static-libs@unix:
- libngtcp2.a
- libngtcp2_crypto_ossl.a
static-libs@windows:
- ngtcp2.lib
3 changes: 3 additions & 0 deletions config/pkg/lib/onig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ onig:
- oniguruma.h
static-libs@unix:
- libonig.a
static-libs@windows:
- onig.lib
- onig_a.lib
6 changes: 6 additions & 0 deletions config/pkg/lib/openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ openssl:
license: OpenSSL
depends:
- zlib
depends@windows:
- zlib
- jom
headers:
- openssl
static-libs@unix:
- libssl.a
- libcrypto.a
static-libs@windows:
- libssl.lib
- libcrypto.lib
12 changes: 9 additions & 3 deletions config/pkg/lib/postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ postgresql:
type: ghtagtar
repo: postgres/postgres
match: REL_18_\d+
binary:
windows-x86_64: { type: url, url: 'https://get.enterprisedb.com/postgresql/postgresql-16.8-1-windows-x64-binaries.zip', extract: { lib/libpq.lib: '{build_root_path}/lib/libpq.lib', lib/libpgport.lib: '{build_root_path}/lib/libpgport.lib', lib/libpgcommon.lib: '{build_root_path}/lib/libpgcommon.lib', include/libpq-fe.h: '{build_root_path}/include/libpq-fe.h', include/postgres_ext.h: '{build_root_path}/include/postgres_ext.h', include/pg_config_ext.h: '{build_root_path}/include/pg_config_ext.h', include/libpq/libpq-fs.h: '{build_root_path}/include/libpq/libpq-fs.h' } }
metadata:
license-files: [COPYRIGHT]
license-files: ['@/postgresql.txt']
license: PostgreSQL
depends:
depends@unix:
- libiconv
- libxml2
- openssl
- zlib
- libedit
suggests:
suggests@unix:
- icu
- libxslt
- ldap
- zstd
pkg-configs:
- libpq
static-libs@windows:
- libpq.lib
- libpgport.lib
- libpgcommon.lib
12 changes: 12 additions & 0 deletions config/pkg/lib/pthreads4w.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pthreads4w:
type: library
artifact:
source:
type: git
rev: master
url: 'https://git.code.sf.net/p/pthreads4w/code'
metadata:
license-files: [LICENSE]
license: Apache-2.0
static-libs@windows:
- libpthreadVC3.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/qdbm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ qdbm:
license: 'GPL-2.0-only OR LGPL-2.1-only'
static-libs@unix:
- libqdbm.a
static-libs@windows:
- qdbm_a.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ sqlite:
- sqlite3ext.h
static-libs@unix:
- libsqlite3.a
static-libs@windows:
- libsqlite3_a.lib
6 changes: 6 additions & 0 deletions config/pkg/lib/xz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ xz:
- libiconv
headers@unix:
- lzma
headers@windows:
- lzma
- lzma.h
pkg-configs:
- liblzma
static-libs@unix:
- liblzma.a
static-libs@windows:
- lzma.lib
- liblzma_a.lib
3 changes: 3 additions & 0 deletions config/pkg/lib/zlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ zlib:
- zconf.h
static-libs@unix:
- libz.a
static-libs@windows:
- zlibstatic.lib
- zlib_a.lib
2 changes: 2 additions & 0 deletions config/pkg/lib/zstd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ zstd:
- libzstd
static-libs@unix:
- libzstd.a
static-libs@windows:
- zstd_static.lib
9 changes: 9 additions & 0 deletions config/pkg/target/curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ curl:
depends@unix:
- openssl
- zlib
depends@windows:
- zlib
- libssh2
- nghttp2
suggests@unix:
- libssh2
- brotli
Expand All @@ -23,6 +27,9 @@ curl:
- ldap
- idn2
- krb5
suggests@windows:
- brotli
- zstd
frameworks:
- CoreFoundation
- CoreServices
Expand All @@ -33,3 +40,5 @@ curl:
- curl
static-libs@unix:
- libcurl.a
static-libs@windows:
- libcurl_a.lib
7 changes: 7 additions & 0 deletions config/pkg/target/jom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
jom:
type: target
artifact:
binary:
windows-x86_64: { type: url, url: 'https://download.qt.io/official_releases/jom/jom.zip', extract: '{pkg_root_path}/jom' }
path@windows:
- '{pkg_root_path}\jom'
8 changes: 8 additions & 0 deletions src/Package/Library/brotli.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@
use StaticPHP\Attribute\Package\Library;
use StaticPHP\Package\LibraryPackage;
use StaticPHP\Runtime\Executor\UnixCMakeExecutor;
use StaticPHP\Runtime\Executor\WindowsCMakeExecutor;
use StaticPHP\Util\FileSystem;

#[Library('brotli')]
class brotli
{
#[BuildFor('Windows')]
public function buildWin(LibraryPackage $package): void
{
WindowsCMakeExecutor::create($package)->build();
// FileSystem::copy("{$package->getLibDir()}\\onig.lib", "{$package->getLibDir()}\\onig_a.lib");
}

#[BuildFor('Linux')]
#[BuildFor('Darwin')]
public function build(LibraryPackage $lib): void
Expand Down
11 changes: 11 additions & 0 deletions src/Package/Library/bzip2.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ public function patchBeforeBuild(LibraryPackage $lib): void
FileSystem::replaceFileStr($lib->getSourceDir() . '/Makefile', 'CFLAGS=-Wall', 'CFLAGS=-fPIC -Wall');
}

#[BuildFor('Windows')]
public function buildWin(LibraryPackage $package): void
{
cmd()->cd($package->getSourceDir())
->exec('nmake /nologo /f Makefile.msc CFLAGS="-DWIN32 -MT -Ox -D_FILE_OFFSET_BITS=64 -nologo" clean')
->exec('nmake /nologo /f Makefile.msc CFLAGS="-DWIN32 -MT -Ox -D_FILE_OFFSET_BITS=64 -nologo" lib');
FileSystem::copy("{$package->getSourceDir()}\\libbz2.lib", "{$package->getLibDir()}\\libbz2.lib");
FileSystem::copy("{$package->getSourceDir()}\\libbz2.lib", "{$package->getLibDir()}\\libbz2_a.lib");
FileSystem::copy("{$package->getSourceDir()}\\bzlib.h", "{$package->getIncludeDir()}\\bzlib.h");
}

#[BuildFor('Linux')]
#[BuildFor('Darwin')]
public function build(LibraryPackage $lib, PackageBuilder $builder): void
Expand Down
Loading