mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 18:35:35 +08:00
Compare commits
146 Commits
db794bf27b
...
fable-v3-w
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d6f334cbb | ||
|
|
e99423c7d1 | ||
|
|
44daaad548 | ||
|
|
4dac0d18b4 | ||
|
|
79db27da04 | ||
|
|
d04d82a1f1 | ||
|
|
dca24585d4 | ||
|
|
7edd8359d5 | ||
|
|
be8f239259 | ||
|
|
6c7a47c9b5 | ||
|
|
859c06a470 | ||
|
|
274706084a | ||
|
|
0bd94b0ebd | ||
|
|
150998723d | ||
|
|
303dca5f59 | ||
|
|
d7902b9931 | ||
|
|
43b2da0511 | ||
|
|
6dc5c5b770 | ||
|
|
f3afd81c81 | ||
|
|
1dce506222 | ||
|
|
323f21a6f2 | ||
|
|
ab30c9dc49 | ||
|
|
996cca12c0 | ||
|
|
5451945972 | ||
|
|
fc1673e37f | ||
|
|
f1722a0f3e | ||
|
|
8034ae37ea | ||
|
|
c9f24b980d | ||
|
|
5ffbf2d5fe | ||
|
|
facc7bc5a7 | ||
|
|
160d7f5537 | ||
|
|
afa5f535e9 | ||
|
|
0dde151632 | ||
|
|
e906edb332 | ||
|
|
83ce54b62b | ||
|
|
7d6c082c86 | ||
|
|
db4f7c6a0c | ||
|
|
ca0167c83e | ||
|
|
5a5c784c4f | ||
|
|
331da67049 | ||
|
|
cc448d463b | ||
|
|
dc55881b78 | ||
|
|
a59473e4ab | ||
|
|
c6a227f4de | ||
|
|
392733b7c3 | ||
|
|
3870269330 | ||
|
|
03f1313eec | ||
|
|
b9def51f86 | ||
|
|
8533702cf6 | ||
|
|
fe3cd15f81 | ||
|
|
dc33b55fd0 | ||
|
|
c9401a0b7a | ||
|
|
fa040bc346 | ||
|
|
ab37b34fb5 | ||
|
|
0b02f62b7e | ||
|
|
924fac137c | ||
|
|
d9c41a73da | ||
|
|
dd1e70a394 | ||
|
|
1bdbdfc08c | ||
|
|
90846ab149 | ||
|
|
8dd7882869 | ||
|
|
7f6be12bf1 | ||
|
|
45b97581d8 | ||
|
|
12a5217f17 | ||
|
|
5913cb07fd | ||
|
|
dd69155539 | ||
|
|
a81dd6d5c9 | ||
|
|
b4ed673261 | ||
|
|
db2d9a909f | ||
|
|
38e01a9b88 | ||
|
|
2b210f9403 | ||
|
|
be329c1d56 | ||
|
|
227b8f0b0a | ||
|
|
c88041b7e0 | ||
|
|
3bb84f3b94 | ||
|
|
c31bf73685 | ||
|
|
c4d7ca819b | ||
|
|
fd8ab71d80 | ||
|
|
2a7966aa4b | ||
|
|
ef83ff074e | ||
|
|
06864fc3f6 | ||
|
|
408d8f755c | ||
|
|
1f291a9036 | ||
|
|
127fb1989f | ||
|
|
af771cf2b5 | ||
|
|
5df65d926c | ||
|
|
bdc7bbe1f1 | ||
|
|
89dca1f0fb | ||
|
|
064a1f05ae | ||
|
|
88cb6749b8 | ||
|
|
0010e35882 | ||
|
|
728c8dd598 | ||
|
|
bf6216e59f | ||
|
|
f66e68754e | ||
|
|
411ad7cc0f | ||
|
|
0761267eb3 | ||
|
|
072a3b5505 | ||
|
|
0e5738b710 | ||
|
|
3ff9426e50 | ||
|
|
6057394641 | ||
|
|
2f4fb9d28f | ||
|
|
96ab2de4b1 | ||
|
|
6c59456c02 | ||
|
|
0e8a806640 | ||
|
|
c641c3b8db | ||
|
|
48d6e9ebc2 | ||
|
|
6cab47db67 | ||
|
|
ec3fd0f4b0 | ||
|
|
e72f9aa623 | ||
|
|
c666cd6cd0 | ||
|
|
b8dd508148 | ||
|
|
37d8b87c3b | ||
|
|
582a88ef60 | ||
|
|
153003b75c | ||
|
|
899555a964 | ||
|
|
891a222c39 | ||
|
|
39beb68024 | ||
|
|
5172580294 | ||
|
|
99e05aa22b | ||
|
|
0807e9e253 | ||
|
|
1a779be028 | ||
|
|
bdfd3eb269 | ||
|
|
7ae5d742c2 | ||
|
|
95be291a84 | ||
|
|
d89add106a | ||
|
|
a36129c6cd | ||
|
|
3f3edd62a1 | ||
|
|
82b77af317 | ||
|
|
df26b93e58 | ||
|
|
d1b4c05381 | ||
|
|
e1658bc0e6 | ||
|
|
5053620b61 | ||
|
|
9366cbacd9 | ||
|
|
b8ce9f7787 | ||
|
|
6772403d81 | ||
|
|
60a91a82e1 | ||
|
|
4a274b69ac | ||
|
|
e4edd0a00f | ||
|
|
ae26ef3bdb | ||
|
|
049ecfe0a5 | ||
|
|
01a4d872ad | ||
|
|
a9e54bb725 | ||
|
|
ad9b9ec69f | ||
|
|
8a37303925 | ||
|
|
52d234f1f4 | ||
|
|
a3c39576df |
24
.gitattributes
vendored
Normal file
24
.gitattributes
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Force LF line endings for all text files.
|
||||||
|
# Prevents git from auto-converting LF -> CRLF on Windows checkouts.
|
||||||
|
* text=auto eol=lf
|
||||||
|
|
||||||
|
# Explicit binary files — git won't touch line endings for these
|
||||||
|
*.phar binary
|
||||||
|
*.png binary
|
||||||
|
*.jpg binary
|
||||||
|
*.jpeg binary
|
||||||
|
*.gif binary
|
||||||
|
*.ico binary
|
||||||
|
*.zip binary
|
||||||
|
*.gz binary
|
||||||
|
*.tgz binary
|
||||||
|
*.txz binary
|
||||||
|
*.xz binary
|
||||||
|
*.bz2 binary
|
||||||
|
*.7z binary
|
||||||
|
*.exe binary
|
||||||
|
*.dll binary
|
||||||
|
*.sfx binary
|
||||||
|
*.so binary
|
||||||
|
*.a binary
|
||||||
|
*.o binary
|
||||||
23
.github/copilot-instructions.md
vendored
Normal file
23
.github/copilot-instructions.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# StaticPHP v3 Copilot Instructions
|
||||||
|
|
||||||
|
> The canonical agent instructions live in [AGENTS.md](./AGENTS.md). This file provides the essential summary for GitHub Copilot; read `AGENTS.md` for the complete project map, working rules, and validation steps.
|
||||||
|
|
||||||
|
StaticPHP is a PHP CLI application for building static PHP binaries, PHP SAPIs, extensions, libraries, and helper tools. Prefer the v3 architecture under `src/StaticPHP`, `src/Package`, `config/pkg`, and `config/artifact`.
|
||||||
|
|
||||||
|
## Skills
|
||||||
|
|
||||||
|
Use the repository skills when the task matches them:
|
||||||
|
|
||||||
|
- `.github/skills/staticphp-package-maintenance`: add, modify, review, or validate package, artifact, extension, library, target, or tool definitions.
|
||||||
|
- `.github/skills/staticphp-build-troubleshooting`: diagnose build, download, doctor, shell, terminal, CI, smoke-test, or log failures.
|
||||||
|
|
||||||
|
## Quick Reference
|
||||||
|
|
||||||
|
- **Entrypoint**: `php bin/spc`
|
||||||
|
- **Config lint**: `php bin/spc dev:lint-config`
|
||||||
|
- **CS fix**: `composer cs-fix`
|
||||||
|
- **Tests**: `composer test`
|
||||||
|
- **Static analysis**: `composer analyse`
|
||||||
|
- **Extension packages**: `config/pkg/ext/ext-*.yml`, prefix with `ext-` in dependencies
|
||||||
|
- **Platform suffixes**: `@unix`, `@linux`, `@macos`, `@windows` — prefer these over runtime conditionals
|
||||||
|
- **Do NOT edit generated dirs**: `buildroot/`, `source/`, `downloads/`, `pkgroot/`
|
||||||
56
.github/skills/staticphp-build-troubleshooting/SKILL.md
vendored
Normal file
56
.github/skills/staticphp-build-troubleshooting/SKILL.md
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
name: staticphp-build-troubleshooting
|
||||||
|
description: Diagnose StaticPHP v3 failures. Use when investigating build, compile, linker, download, doctor, environment, CI, smoke-test, terminal output, spc.output.log, spc.shell.log, config.log, CMake logs, or user-provided error snippets from StaticPHP commands.
|
||||||
|
---
|
||||||
|
|
||||||
|
# StaticPHP Build Troubleshooting
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Use this skill to triage StaticPHP failures from the outside in: command and environment first, SPC module/stage metadata next, shell/config logs last. The goal is to isolate the failing package, stage, command, and root cause before editing code.
|
||||||
|
|
||||||
|
## First Pass
|
||||||
|
|
||||||
|
1. Capture the exact command, OS, architecture, PHP version, extensions/libs/targets, and whether the run used `-v`, `-vv`, or `-vvv`.
|
||||||
|
2. Read the final terminal error first. StaticPHP prints module error info, failed package, failed stage, failed command, log paths, and extra log files when available.
|
||||||
|
3. If log files exist, inspect them in this order:
|
||||||
|
- `log/spc.output.log`: user-facing SPC messages and exception summary.
|
||||||
|
- `log/spc.shell.log`: executed commands, working directories, env, stdout/stderr.
|
||||||
|
- Extra logs named in the exception output: `php-src.config.log`, `lib.<pkg>.console.log`, `lib.<pkg>.cmake-error.log`, `lib.<pkg>.cmake-configure.log`, `lib.<pkg>.cmake-output.log`.
|
||||||
|
4. Read `references/log-triage.md` for pattern matching, likely causes, and next checks.
|
||||||
|
|
||||||
|
## Diagnosis Rules
|
||||||
|
|
||||||
|
- Do not start by changing shared core code. Most failures are package metadata, environment, upstream source, dependency order, or platform flags.
|
||||||
|
- Prefer evidence from the last failing command over earlier warnings.
|
||||||
|
- When logs are long, search backward for `Command exited`, `error:`, `undefined reference`, `not found`, `No package`, `CMake Error`, `configure: error`, `fatal error`, `Failed module`, and `Failed stage`.
|
||||||
|
- Use `config.log` and CMake logs for configure detection failures; use `spc.shell.log` for the actual command and env.
|
||||||
|
- Be careful with rebuild suggestions. `spc reset --with-download --yes` is destructive to caches; ask before clearing caches unless the user explicitly asked.
|
||||||
|
|
||||||
|
## Repro Commands
|
||||||
|
|
||||||
|
Use focused commands when reproducing:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
php bin/spc doctor -vvv
|
||||||
|
php bin/spc download --for-extensions="curl,openssl" --with-php=8.5 --parallel=4 --retry=3 -vvv
|
||||||
|
php bin/spc build:libs "openssl" -vvv
|
||||||
|
php bin/spc build:php "bcmath,openssl,curl" --build-cli -vvv
|
||||||
|
php bin/spc dev:lint-config
|
||||||
|
```
|
||||||
|
|
||||||
|
Choose the smallest command that still reaches the failing package.
|
||||||
|
|
||||||
|
## Fix Direction
|
||||||
|
|
||||||
|
After finding the failing package/stage:
|
||||||
|
|
||||||
|
- Package YAML issue: use `$staticphp-package-maintenance`, then edit `config/pkg/*` or `config/artifact/*`.
|
||||||
|
- Build command or patch issue: inspect the package class under `src/Package/*`.
|
||||||
|
- Environment issue: check `doctor`, toolchain classes, and `config/pkg/tool/*`.
|
||||||
|
- Upstream download issue: check artifact type, regex, GitHub rate limiting, mirror behavior, and `GITHUB_TOKEN`.
|
||||||
|
- Core exception/logging issue: inspect `src/StaticPHP/Exception`, `src/StaticPHP/Runtime/Shell`, or executor classes only after package-level causes are ruled out.
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
- `references/log-triage.md`: log files, failure categories, search patterns, and likely fixes.
|
||||||
4
.github/skills/staticphp-build-troubleshooting/agents/openai.yaml
vendored
Normal file
4
.github/skills/staticphp-build-troubleshooting/agents/openai.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
interface:
|
||||||
|
display_name: "StaticPHP Build Troubleshooting"
|
||||||
|
short_description: "Diagnose StaticPHP build and log failures."
|
||||||
|
default_prompt: "Use $staticphp-build-troubleshooting to investigate a StaticPHP build, download, doctor, or log failure."
|
||||||
209
.github/skills/staticphp-build-troubleshooting/references/log-triage.md
vendored
Normal file
209
.github/skills/staticphp-build-troubleshooting/references/log-triage.md
vendored
Normal file
@@ -0,0 +1,209 @@
|
|||||||
|
# StaticPHP Log Triage
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
- Log files
|
||||||
|
- Terminal summary
|
||||||
|
- Search strategy
|
||||||
|
- Failure categories
|
||||||
|
- Rebuild hygiene
|
||||||
|
- Reporting checklist
|
||||||
|
|
||||||
|
## Log Files
|
||||||
|
|
||||||
|
Default log directory is `log/`, controlled by `SPC_LOGS_DIR`. The important files are:
|
||||||
|
|
||||||
|
- `spc.output.log`: StaticPHP console/logger output and exception summaries.
|
||||||
|
- `spc.shell.log`: command execution log with command, caller, inline env, working directory, stdout, stderr, and exit code.
|
||||||
|
- `php-src.config.log`: copied when PHP source configure fails.
|
||||||
|
- `lib.<pkg>.console.log`: copied Autoconf `config.log` for a library when available.
|
||||||
|
- `lib.<pkg>.cmake-configure.log`: copied CMake 3.26+ configure log.
|
||||||
|
- `lib.<pkg>.cmake-error.log`: copied CMake error log.
|
||||||
|
- `lib.<pkg>.cmake-output.log`: copied CMake output log.
|
||||||
|
|
||||||
|
Logs are created when `SPC_ENABLE_LOG_FILE` is true. Old `*.log` files are cleaned unless `SPC_PRESERVE_LOG` is set to a truthy value. The code in `src/bootstrap.php` reads `SPC_PRESERVE_LOG` (no trailing S).
|
||||||
|
|
||||||
|
## Terminal Summary
|
||||||
|
|
||||||
|
StaticPHP exceptions often print:
|
||||||
|
|
||||||
|
- Exception category: build, download, environment, execution, file system, patch, validation, wrong usage, registry, internal.
|
||||||
|
- Failed module: package name, type, and sometimes class/file/line.
|
||||||
|
- Failed stage: call chain such as `build` or `build -> configure`.
|
||||||
|
- Failed command: the command that returned non-zero.
|
||||||
|
- Command working directory and inline env.
|
||||||
|
- Paths to `spc.output.log`, `spc.shell.log`, and extra logs.
|
||||||
|
|
||||||
|
Use this summary to choose the first files to read. If a package and stage are present, start with that package's YAML and class after reading the relevant log tail.
|
||||||
|
|
||||||
|
## Search Strategy
|
||||||
|
|
||||||
|
For long logs, search from the end first.
|
||||||
|
|
||||||
|
Useful patterns:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Failed module:
|
||||||
|
Failed stage:
|
||||||
|
Failed command:
|
||||||
|
Command exited with non-zero code
|
||||||
|
configure: error
|
||||||
|
CMake Error
|
||||||
|
undefined reference
|
||||||
|
cannot find -l
|
||||||
|
fatal error:
|
||||||
|
No package
|
||||||
|
Package .* not found
|
||||||
|
Could NOT find
|
||||||
|
is not a valid
|
||||||
|
permission denied
|
||||||
|
curl: (
|
||||||
|
HTTP/2 403
|
||||||
|
rate limit
|
||||||
|
```
|
||||||
|
|
||||||
|
In `spc.shell.log`, each command block begins with `>>>>>>>>>>>>>>>>>>>>>>>>>>`, then prints the command, caller, env, and working dir. The last failed block is usually the highest-value evidence.
|
||||||
|
|
||||||
|
## Failure Categories
|
||||||
|
|
||||||
|
### Download Failure
|
||||||
|
|
||||||
|
Signs:
|
||||||
|
|
||||||
|
- `Download failed`
|
||||||
|
- `curl: (56)`, `curl: (22)`, HTTP 403/404/429
|
||||||
|
- GitHub API calls in verbose logs
|
||||||
|
- Asset regex did not match a release asset
|
||||||
|
|
||||||
|
Likely checks:
|
||||||
|
|
||||||
|
- If GitHub rate limited, ask user to set `GITHUB_TOKEN`.
|
||||||
|
- Verify artifact source type and regex in `config/pkg/*` or `config/artifact/*`.
|
||||||
|
- Use `--dl-retry`, `--dl-parallel`, `--ignore-cache`, `--no-alt`, or custom source options only as repro aids.
|
||||||
|
- Prefer fixing stale URLs/regexes over adding workarounds.
|
||||||
|
|
||||||
|
### Doctor or Environment Failure
|
||||||
|
|
||||||
|
Signs:
|
||||||
|
|
||||||
|
- `Environment check failed`
|
||||||
|
- missing `make`, `cmake`, `autoconf`, `pkg-config`, compiler, Perl, Visual Studio, MSYS2, Zig, etc.
|
||||||
|
- `Some check items can not be fixed`
|
||||||
|
|
||||||
|
Likely checks:
|
||||||
|
|
||||||
|
- Run `php bin/spc doctor -vvv`.
|
||||||
|
- Inspect `src/StaticPHP/Doctor/Item/*` for the check and fix behavior.
|
||||||
|
- Inspect `config/pkg/tool/*` for installable helper tools.
|
||||||
|
- On Windows, some dependencies cannot be auto-installed.
|
||||||
|
|
||||||
|
### Configure Failure
|
||||||
|
|
||||||
|
Signs:
|
||||||
|
|
||||||
|
- `configure: error`
|
||||||
|
- Autoconf failure before compilation
|
||||||
|
- extra `config.log` listed
|
||||||
|
|
||||||
|
Likely checks:
|
||||||
|
|
||||||
|
- Read copied `php-src.config.log` or `lib.<pkg>.console.log`.
|
||||||
|
- Look for the first compiler/linker probe that failed.
|
||||||
|
- Check `headers`, `static-libs`, `pkg-configs`, dependency order, and `initializeEnv($pkg)` behavior.
|
||||||
|
- For extensions, check `php-extension.arg-type` and `#[CustomPhpConfigureArg]`.
|
||||||
|
|
||||||
|
### CMake Failure
|
||||||
|
|
||||||
|
Signs:
|
||||||
|
|
||||||
|
- `CMake Error`
|
||||||
|
- `Could NOT find`
|
||||||
|
- missing target, package config, or static library
|
||||||
|
|
||||||
|
Likely checks:
|
||||||
|
|
||||||
|
- Read `lib.<pkg>.cmake-error.log` and `lib.<pkg>.cmake-configure.log`.
|
||||||
|
- Inspect `UnixCMakeExecutor`/`WindowsCMakeExecutor` usage in the package class.
|
||||||
|
- Check CMake options, toolchain root path, `pkg-configs`, and transitive dependency libraries.
|
||||||
|
|
||||||
|
### Compile Failure
|
||||||
|
|
||||||
|
Signs:
|
||||||
|
|
||||||
|
- compiler `fatal error: header.h: No such file or directory`
|
||||||
|
- syntax/type errors from upstream source
|
||||||
|
- incompatible PHP API or platform macros
|
||||||
|
|
||||||
|
Likely checks:
|
||||||
|
|
||||||
|
- Identify the source file and include path from `spc.shell.log`.
|
||||||
|
- Verify dependency headers are installed in `buildroot/include`.
|
||||||
|
- Check PHP version compatibility and existing patches in `src/globals/patch`.
|
||||||
|
- Prefer targeted patches or compile flags in the package class over broad toolchain changes.
|
||||||
|
|
||||||
|
### Link Failure
|
||||||
|
|
||||||
|
Signs:
|
||||||
|
|
||||||
|
- `undefined reference`
|
||||||
|
- `cannot find -lfoo`
|
||||||
|
- duplicate symbols
|
||||||
|
- Windows unresolved external symbol or missing `.lib`
|
||||||
|
|
||||||
|
Likely checks:
|
||||||
|
|
||||||
|
- Verify `static-libs`, dependency order, and `getStaticLibFiles()` usage.
|
||||||
|
- Inspect `SPC_EXTRA_LIBS`, `Libs.private` in `.pc` files, and package-specific pkg-config patching.
|
||||||
|
- On Windows, confirm `.lib` names and required system libraries.
|
||||||
|
- For OpenSSL/curl-like packages, search existing linker flag hooks before adding a new one.
|
||||||
|
|
||||||
|
### Smoke Test or Validation Failure
|
||||||
|
|
||||||
|
Signs:
|
||||||
|
|
||||||
|
- `Validation failed`
|
||||||
|
- `php --ri` failure
|
||||||
|
- extension not loaded after build
|
||||||
|
- micro/embed runtime smoke test fails
|
||||||
|
|
||||||
|
Likely checks:
|
||||||
|
|
||||||
|
- Check extension `display-name`; empty string skips `php --ri`.
|
||||||
|
- Confirm static vs shared build settings.
|
||||||
|
- Confirm the extension is included in the final SAPI target and not only built as a dependency.
|
||||||
|
- Inspect `src/globals/ext-tests/*` and common tests for expected runtime behavior.
|
||||||
|
|
||||||
|
### Registry or Config Failure
|
||||||
|
|
||||||
|
Signs:
|
||||||
|
|
||||||
|
- `Registry error`
|
||||||
|
- unknown package, invalid field, invalid platform suffix, type mismatch
|
||||||
|
- package referenced by attribute but missing config
|
||||||
|
|
||||||
|
Likely checks:
|
||||||
|
|
||||||
|
- Run `php bin/spc dev:lint-config`.
|
||||||
|
- Inspect `ConfigValidator` tests for accepted fields and error expectations.
|
||||||
|
- Confirm attribute type matches YAML `type`.
|
||||||
|
- Confirm hooks reference existing package names and stages for the current platform.
|
||||||
|
|
||||||
|
## Rebuild Hygiene
|
||||||
|
|
||||||
|
Use the smallest cleanup that can invalidate the suspected stale state:
|
||||||
|
|
||||||
|
- Redownload one artifact: `--ignore-cache="artifact-name"`.
|
||||||
|
- Skip downloads to test local source/build logic: `--no-download`.
|
||||||
|
- Prefer source when debugging build logic: `--dl-prefer-source`.
|
||||||
|
- Clear build products only when necessary. `spc reset --with-download --yes` removes caches and should not be suggested casually.
|
||||||
|
|
||||||
|
## Reporting Checklist
|
||||||
|
|
||||||
|
When preparing an issue or PR explanation, include:
|
||||||
|
|
||||||
|
- Exact `php bin/spc ...` command.
|
||||||
|
- OS, architecture, PHP version option, and relevant env vars.
|
||||||
|
- Failed package and stage.
|
||||||
|
- Last failed command and exit code.
|
||||||
|
- Tail of `spc.output.log`, relevant command block from `spc.shell.log`, and any extra config/CMake log.
|
||||||
|
- Whether the failure reproduces after a focused clean or cache refresh.
|
||||||
55
.github/skills/staticphp-package-maintenance/SKILL.md
vendored
Normal file
55
.github/skills/staticphp-package-maintenance/SKILL.md
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
name: staticphp-package-maintenance
|
||||||
|
description: Maintain StaticPHP v3 packages and artifacts. Use when adding, modifying, reviewing, or validating config under config/pkg or config/artifact; package classes under src/Package; extension/library/target/tool dependencies; PHP configure args; build hooks; package metadata; or related tests and docs.
|
||||||
|
---
|
||||||
|
|
||||||
|
# StaticPHP Package Maintenance
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Use this skill to make focused package changes without re-reading the entire repository. StaticPHP v3 separates declarative package/artifact YAML from package-specific PHP build logic; prefer config-only edits unless current patterns require a class.
|
||||||
|
|
||||||
|
## Quick Workflow
|
||||||
|
|
||||||
|
1. Identify the package kind and exact name.
|
||||||
|
- Extension: `config/pkg/ext/ext-name.yml`, class `src/Package/Extension/name.php`.
|
||||||
|
- Library: `config/pkg/lib/name.yml`, class `src/Package/Library/name.php`.
|
||||||
|
- Target or virtual target: `config/pkg/target/name.yml`, class `src/Package/Target/name.php`.
|
||||||
|
- Tool: `config/pkg/tool/name.yml`, class `src/Package/Tool/name.php`.
|
||||||
|
- Shared/custom artifact: `config/artifact/name.yml`, class `src/Package/Artifact/name.php`.
|
||||||
|
|
||||||
|
2. Search for the closest existing package before designing anything new.
|
||||||
|
- Similar build system: `rg "#\\[BuildFor|UnixCMakeExecutor|UnixAutoconfExecutor|WindowsCMakeExecutor" src/Package`.
|
||||||
|
- Similar config fields: `rg "static-libs|pkg-configs|arg-type|depends@" config/pkg`.
|
||||||
|
- Similar download type: `rg "type: ghrel|type: pecl|type: pie|type: git|binary: hosted" config`.
|
||||||
|
|
||||||
|
3. Read `references/package-reference.md` when changing YAML fields, artifact definitions, package naming, dependencies, platform suffixes, or validation expectations.
|
||||||
|
|
||||||
|
4. Read `references/build-class-patterns.md` when PHP build logic, attributes, lifecycle hooks, custom configure args, source patching, or executor usage is needed.
|
||||||
|
|
||||||
|
5. Validate narrowly, then broadly if risk warrants it.
|
||||||
|
- Config lint: `php bin/spc dev:lint-config`
|
||||||
|
- Focused tests: `vendor/bin/phpunit tests/StaticPHP/Config tests/StaticPHP/Registry tests/StaticPHP/Util/DependencyResolverTest.php --no-coverage`
|
||||||
|
- Full project checks: `composer test`, `composer analyse`
|
||||||
|
|
||||||
|
## Editing Rules
|
||||||
|
|
||||||
|
- Treat `config/pkg/*` and `config/artifact/*` as the source of package truth; package classes augment behavior.
|
||||||
|
- Use platform suffix fields for declarative OS differences: `@unix`, `@linux`, `@macos`, `@windows`.
|
||||||
|
- Add a PHP class only for custom build stages, validation, hook behavior, patches, or custom configure arguments.
|
||||||
|
- Keep extension dependencies prefixed with `ext-`; libraries, tools, and targets use their package names.
|
||||||
|
- Prefer existing helpers such as `UnixAutoconfExecutor`, `UnixCMakeExecutor`, `WindowsCMakeExecutor`, `shell()`, `cmd()`, and `FileSystem`.
|
||||||
|
- Do not modify build outputs (`buildroot/`, `source/`, `downloads/`, `pkgroot/`) to fix package definitions.
|
||||||
|
- If upstream metadata changes, update license metadata and smoke-test/display names when relevant.
|
||||||
|
|
||||||
|
## Common Task Paths
|
||||||
|
|
||||||
|
- Add a new PECL extension: define `config/pkg/ext/ext-name.yml` with `type: php-extension`, `artifact.source.type: pecl`, dependencies, and `php-extension.arg-type`; add a class only if configure args, patches, or hooks are non-standard.
|
||||||
|
- Add a library: define `config/pkg/lib/name.yml` with artifact, dependencies, and install verification fields (`headers`, `static-libs`, `pkg-configs`, `static-bins`); add build class methods by OS.
|
||||||
|
- Fix an existing package build: start from the failing package config/class, then inspect dependencies and hooks targeting that package before changing shared core code.
|
||||||
|
- Update a version source: prefer artifact fields that support update checking (`ghrel`, `ghtar`, `ghtagtar`, `git` with regex, `filelist`, `pecl`, `pie`) over hard-coded URLs when upstream supports it.
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
- `references/package-reference.md`: YAML package/artifact model, naming, fields, validation, and commands.
|
||||||
|
- `references/build-class-patterns.md`: PHP package attributes, stages, hooks, executors, and class patterns.
|
||||||
4
.github/skills/staticphp-package-maintenance/agents/openai.yaml
vendored
Normal file
4
.github/skills/staticphp-package-maintenance/agents/openai.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
interface:
|
||||||
|
display_name: "StaticPHP Package Maintenance"
|
||||||
|
short_description: "Add, update, and validate StaticPHP v3 package definitions."
|
||||||
|
default_prompt: "Use $staticphp-package-maintenance to add, modify, or review StaticPHP package and artifact definitions."
|
||||||
143
.github/skills/staticphp-package-maintenance/references/build-class-patterns.md
vendored
Normal file
143
.github/skills/staticphp-package-maintenance/references/build-class-patterns.md
vendored
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
# StaticPHP Build Class Patterns
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
- When a class is needed
|
||||||
|
- Package attributes
|
||||||
|
- Stage and hook behavior
|
||||||
|
- Executor choices
|
||||||
|
- Common patterns
|
||||||
|
- Failure-safe edits
|
||||||
|
|
||||||
|
## When a Class Is Needed
|
||||||
|
|
||||||
|
Do not add a PHP package class for simple metadata. Use YAML alone when StaticPHP can infer the configure args, dependencies, and verification.
|
||||||
|
|
||||||
|
Add or update a class when the package needs:
|
||||||
|
|
||||||
|
- OS-specific build commands.
|
||||||
|
- Custom validation before building.
|
||||||
|
- Custom PHP configure arguments.
|
||||||
|
- Patches or file edits before build.
|
||||||
|
- Hooks into another package's stage.
|
||||||
|
- Custom source/binary download or extraction logic.
|
||||||
|
- Package info shown by dev tooling.
|
||||||
|
|
||||||
|
Package classes live in `src/Package/*` and are discovered through PSR-4 plus attributes. Config must exist first; `PackageLoader` throws if an attribute references an undefined package.
|
||||||
|
|
||||||
|
## Package Attributes
|
||||||
|
|
||||||
|
Class-level package attributes:
|
||||||
|
|
||||||
|
- `#[Extension('curl')]` maps to package `ext-curl` if the prefix is omitted.
|
||||||
|
- `#[Library('openssl')]`
|
||||||
|
- `#[Target('php')]`
|
||||||
|
- `#[Tool('zig')]`
|
||||||
|
|
||||||
|
Method-level attributes:
|
||||||
|
|
||||||
|
- `#[BuildFor('Linux'|'Darwin'|'Windows')]`: registers the `build` stage for that OS.
|
||||||
|
- `#[Stage('name')]`: registers a named stage; defaults to the method name when omitted.
|
||||||
|
- `#[BeforeStage('package', 'stage', 'only-when-package-resolved')]`: hook before a target package stage.
|
||||||
|
- `#[AfterStage('package', 'stage', 'only-when-package-resolved')]`: hook after a target package stage.
|
||||||
|
- `#[PatchBeforeBuild]`: runs once before package build unless `.spc-patched` exists; return `true` to write that marker.
|
||||||
|
- `#[CustomPhpConfigureArg('Linux')]`: supplies custom extension configure args.
|
||||||
|
- `#[Validate]`: validates environment/source assumptions.
|
||||||
|
- `#[Info]`: returns package information for tooling.
|
||||||
|
- `#[InitPackage]`: runs while loading a package class.
|
||||||
|
- `#[ResolveBuild]`: target package callback for resolving build dependencies.
|
||||||
|
- `#[ConditionalOn(SomeClass::class)]`: conditionally enables before/after hooks only when DI has the class.
|
||||||
|
|
||||||
|
## Stage and Hook Behavior
|
||||||
|
|
||||||
|
`PackageBuilder::buildPackage()` does:
|
||||||
|
|
||||||
|
1. Ensure build directories exist.
|
||||||
|
2. Skip if already installed unless forced.
|
||||||
|
3. Ensure source exists for non-virtual packages.
|
||||||
|
4. Emit `PatchBeforeBuild` callbacks.
|
||||||
|
5. Run the `build` stage.
|
||||||
|
6. Install license data.
|
||||||
|
7. Record tool package versions where relevant.
|
||||||
|
|
||||||
|
`Package::runStage()` wraps a stage with:
|
||||||
|
|
||||||
|
1. `BeforeStage` callbacks.
|
||||||
|
2. The stage method itself.
|
||||||
|
3. `AfterStage` callbacks.
|
||||||
|
|
||||||
|
SPC exceptions bind package and stage metadata. Preserve that behavior by throwing existing `SPCException` subclasses instead of raw exceptions when adding new failure paths.
|
||||||
|
|
||||||
|
## Executor Choices
|
||||||
|
|
||||||
|
Use existing executors where possible:
|
||||||
|
|
||||||
|
- `UnixAutoconfExecutor`: for Unix packages using `./configure && make && make install`. It injects default static flags and copies `config.log` into SPC logs on failure.
|
||||||
|
- `UnixCMakeExecutor`: for Unix CMake packages. It writes toolchain settings and copies CMake configure/error/output logs on failure.
|
||||||
|
- `WindowsCMakeExecutor`: for Windows CMake packages.
|
||||||
|
- `shell()->cd(...)->initializeEnv($pkg)`: for custom Unix command chains.
|
||||||
|
- `cmd()->cd(...)`: for Windows command chains.
|
||||||
|
|
||||||
|
Prefer `FileSystem` helpers for file edits and copies so behavior stays consistent.
|
||||||
|
|
||||||
|
## Common Patterns
|
||||||
|
|
||||||
|
Minimal library class:
|
||||||
|
|
||||||
|
```php
|
||||||
|
#[Library('example')]
|
||||||
|
class example
|
||||||
|
{
|
||||||
|
#[BuildFor('Linux')]
|
||||||
|
public function build(LibraryPackage $pkg): void
|
||||||
|
{
|
||||||
|
(new UnixAutoconfExecutor($pkg))
|
||||||
|
->configure()
|
||||||
|
->make();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Extension hook into PHP build:
|
||||||
|
|
||||||
|
```php
|
||||||
|
#[Extension('curl')]
|
||||||
|
class curl
|
||||||
|
{
|
||||||
|
#[BeforeStage('php', [php::class, 'makeForWindows'], 'ext-curl')]
|
||||||
|
public function patchBeforePhpBuild(): void
|
||||||
|
{
|
||||||
|
// Adjust env, generated build files, or linker flags.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
```php
|
||||||
|
#[Validate]
|
||||||
|
public function validate(): void
|
||||||
|
{
|
||||||
|
if (SystemTarget::getTargetOS() === 'Windows' && WindowsUtil::findCommand('perl.exe') === null) {
|
||||||
|
throw new EnvironmentException('You need to install perl first!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Custom configure args should be used when YAML `arg-type` is `custom` or when args need package/install context:
|
||||||
|
|
||||||
|
```php
|
||||||
|
#[CustomPhpConfigureArg('Linux')]
|
||||||
|
public function configureArg(PhpExtensionPackage $ext): string
|
||||||
|
{
|
||||||
|
return '--with-example=' . $ext->getBuildRootPath();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Failure-Safe Edits
|
||||||
|
|
||||||
|
- Make hooks conditional with the third `BeforeStage`/`AfterStage` argument when a dependency must be resolved before the hook should run.
|
||||||
|
- Keep platform-specific code under matching `#[BuildFor]` methods rather than branching heavily inside one method.
|
||||||
|
- If a patch changes upstream source, place patch files in `src/globals/patch/` and describe them with `#[PatchDescription]` where appropriate.
|
||||||
|
- If a class only mutates environment variables for another package, search for existing hooks first to avoid duplicate linker flags.
|
||||||
|
- After adding attributes, run registry/config tests because invalid stages and unknown packages are caught during loading.
|
||||||
157
.github/skills/staticphp-package-maintenance/references/package-reference.md
vendored
Normal file
157
.github/skills/staticphp-package-maintenance/references/package-reference.md
vendored
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
# StaticPHP Package Reference
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
- Package locations
|
||||||
|
- Package types
|
||||||
|
- Artifact model
|
||||||
|
- Common YAML fields
|
||||||
|
- PHP extension fields
|
||||||
|
- Platform suffixes
|
||||||
|
- Validation and tests
|
||||||
|
|
||||||
|
## Package Locations
|
||||||
|
|
||||||
|
StaticPHP v3 keeps package metadata in YAML and behavior in PHP classes.
|
||||||
|
|
||||||
|
| Kind | YAML | PHP class namespace | Typical attribute |
|
||||||
|
|---|---|---|---|
|
||||||
|
| PHP extension | `config/pkg/ext/ext-name.yml` | `Package\Extension` | `#[Extension('name')]` |
|
||||||
|
| Library | `config/pkg/lib/name.yml` | `Package\Library` | `#[Library('name')]` |
|
||||||
|
| Target | `config/pkg/target/name.yml` | `Package\Target` | `#[Target('name')]` |
|
||||||
|
| Virtual target | `config/pkg/target/name.yml` | `Package\Target` | `#[Target('name')]` |
|
||||||
|
| Tool | `config/pkg/tool/name.yml` | `Package\Tool` | `#[Tool('name')]` |
|
||||||
|
| Custom artifact | `config/artifact/name.yml` | `Package\Artifact` | artifact attributes |
|
||||||
|
|
||||||
|
Prefer one package per YAML file unless an existing file groups related definitions. Match nearby naming and ordering.
|
||||||
|
|
||||||
|
## Package Types
|
||||||
|
|
||||||
|
`php-extension` packages describe PHP extensions. Config package names must use the `ext-` prefix. Dependencies on extensions also use `ext-`.
|
||||||
|
|
||||||
|
`library` packages describe buildable dependency libraries. They usually define source artifacts plus verification fields such as headers, static libraries, pkg-config files, or binaries.
|
||||||
|
|
||||||
|
`target` packages represent final build outputs and inherit the library-style fields. StaticPHP automatically exposes build commands for targets.
|
||||||
|
|
||||||
|
`virtual-target` packages are abstract dependency/build scheduling nodes. They may omit `artifact`.
|
||||||
|
|
||||||
|
`tool` packages are helper programs or toolchains installed into `pkgroot/` or used by builds.
|
||||||
|
|
||||||
|
## Artifact Model
|
||||||
|
|
||||||
|
Artifacts define downloadable source archives or prebuilt binaries. Use inline artifacts for simple one-package sources and `config/artifact/*.yml` for shared, complex, or custom artifacts.
|
||||||
|
|
||||||
|
Top-level artifact sections:
|
||||||
|
|
||||||
|
- `source`: source archive, git checkout, PECL/PIE package, local directory, or custom source.
|
||||||
|
- `binary`: prebuilt binary by platform, or aliases such as `hosted`/`custom`.
|
||||||
|
- `metadata`: `license`, `license-files`, and `source-root`.
|
||||||
|
|
||||||
|
Common source types:
|
||||||
|
|
||||||
|
- `url`: fixed URL; supports `filename`, `version`, and `extract`.
|
||||||
|
- `git`: repository source; use `rev` for a fixed branch/tag/commit or `regex` with named `version` capture for update checks.
|
||||||
|
- `ghrel`: GitHub release asset by regex filename match.
|
||||||
|
- `ghtar`: generated GitHub release tarball.
|
||||||
|
- `ghtagtar`: generated GitHub tag tarball.
|
||||||
|
- `filelist`: scrape a download index and extract version/filename with regex.
|
||||||
|
- `pecl`: PECL extension by name.
|
||||||
|
- `pie`: Packagist PIE extension by `vendor/package`.
|
||||||
|
- `php-release`: official PHP source selected by build PHP version.
|
||||||
|
- `local`: local source directory for development/offline use.
|
||||||
|
- `custom`: PHP artifact class handles source or binary logic.
|
||||||
|
|
||||||
|
Use `metadata.source-root` when the actual build directory is inside an extracted subdirectory.
|
||||||
|
|
||||||
|
Use `metadata.license-files` for source licenses. `@/file.txt` points to bundled license files in `src/globals/licenses/`.
|
||||||
|
|
||||||
|
## Common YAML Fields
|
||||||
|
|
||||||
|
Shared fields:
|
||||||
|
|
||||||
|
- `type`: required package type.
|
||||||
|
- `description`: optional human-readable package description.
|
||||||
|
- `license`: package-level license annotation where applicable.
|
||||||
|
- `lang`: implementation language such as `c` or `c++`.
|
||||||
|
- `frameworks`: macOS framework tags.
|
||||||
|
- `artifact`: string reference or inline artifact object. Required for `library` and `target`; optional for built-in extensions and virtual targets.
|
||||||
|
- `depends`: hard dependencies.
|
||||||
|
- `suggests`: optional dependencies.
|
||||||
|
|
||||||
|
Library, target, and tool verification/installation fields:
|
||||||
|
|
||||||
|
- `headers`: expected files/directories under `buildroot/include`.
|
||||||
|
- `static-libs`: expected static libraries under `buildroot/lib`.
|
||||||
|
- `pkg-configs`: expected `.pc` files under `buildroot/lib/pkgconfig`.
|
||||||
|
- `static-bins`: expected executables under `buildroot/bin`.
|
||||||
|
- `path`: directories appended to PATH after install.
|
||||||
|
- `env`: environment variables set after install.
|
||||||
|
- `append-env`: values appended to existing environment variables.
|
||||||
|
|
||||||
|
Path placeholders in `path`, `env`, and `append-env`:
|
||||||
|
|
||||||
|
- `{build_root_path}`: `buildroot/`
|
||||||
|
- `{pkg_root_path}`: `pkgroot/`
|
||||||
|
- `{working_dir}`: repository or working directory
|
||||||
|
- `{download_path}`: `downloads/`
|
||||||
|
- `{source_path}`: `source/`
|
||||||
|
- `{spc_msys2_path}`: MSYS2 root on Windows
|
||||||
|
|
||||||
|
## PHP Extension Fields
|
||||||
|
|
||||||
|
Extension-specific fields live under `php-extension`.
|
||||||
|
|
||||||
|
- `arg-type`: configure argument behavior. Built-ins include `enable`, `enable-path`, `with`, `with-path`, `custom`, and `none`. Full strings are allowed.
|
||||||
|
- `zend-extension`: true for Zend extensions such as opcache/xdebug.
|
||||||
|
- `build-shared`: whether shared builds are allowed.
|
||||||
|
- `build-static`: whether static builds are allowed.
|
||||||
|
- `build-with-php`: true when built inside the PHP source tree.
|
||||||
|
- `display-name`: value used for `php --ri` smoke tests and license display; empty string skips the `--ri` check.
|
||||||
|
- `os`: allowed OS families: `Linux`, `Darwin`, `Windows`.
|
||||||
|
|
||||||
|
Configure string placeholders:
|
||||||
|
|
||||||
|
- `@build_root_path@`: absolute buildroot path.
|
||||||
|
- `@shared_suffix@`: `=shared` in shared builds, empty in static builds.
|
||||||
|
- `@shared_path_suffix@`: `=shared,{buildroot}` in shared builds, `={buildroot}` in static builds.
|
||||||
|
|
||||||
|
## Platform Suffixes
|
||||||
|
|
||||||
|
Many fields support platform suffixes:
|
||||||
|
|
||||||
|
- `@unix`: Linux and macOS.
|
||||||
|
- `@linux`: Linux only.
|
||||||
|
- `@macos`: macOS only.
|
||||||
|
- `@windows`: Windows only.
|
||||||
|
|
||||||
|
For Linux, specific fields override generic fields in this order: `field@linux`, then `field@unix`, then `field`.
|
||||||
|
|
||||||
|
Use suffixes for declarative differences in dependencies, headers, libraries, pkg-configs, extension args, and suggestions.
|
||||||
|
|
||||||
|
## Validation and Tests
|
||||||
|
|
||||||
|
Run config validation for most package edits:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
php bin/spc dev:lint-config
|
||||||
|
```
|
||||||
|
|
||||||
|
Run focused tests after config or registry changes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vendor/bin/phpunit tests/StaticPHP/Config tests/StaticPHP/Registry tests/StaticPHP/Util/DependencyResolverTest.php --no-coverage
|
||||||
|
```
|
||||||
|
|
||||||
|
Run broader checks for framework or class changes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
composer test
|
||||||
|
composer analyse
|
||||||
|
```
|
||||||
|
|
||||||
|
Build commands are expensive. Use them for user-provided repros, package-specific fixes, or when validation cannot prove the behavior:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
php bin/spc build:libs "openssl,curl" -vvv
|
||||||
|
php bin/spc build:php "bcmath,openssl,curl" --build-cli -vvv
|
||||||
|
```
|
||||||
5
.github/workflows/ext-matrix-tests.yml
vendored
5
.github/workflows/ext-matrix-tests.yml
vendored
@@ -2,13 +2,14 @@ name: "Extension Matrix Tests"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
pull_request:
|
||||||
|
types: [opened, synchronize, labeled]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
|
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
if: contains(github.event.head_commit.message, 'extension test') || contains(github.event.head_commit.message, 'test extensions')
|
if: contains(github.event.pull_request.labels.*.name, 'need-full-test')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
48
.github/workflows/post-test-bot-comment.yml
vendored
Normal file
48
.github/workflows/post-test-bot-comment.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
name: Post Test Bot Comment
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["v3 Tests"]
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
actions: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post-comment:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- name: Download bot output
|
||||||
|
id: download
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
name: bot-output
|
||||||
|
run-id: ${{ github.event.workflow_run.id }}
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Post/Update comment
|
||||||
|
if: steps.download.outcome == 'success'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
COMMENT_BODY=$(jq -r '.comment_body' bot-output.json)
|
||||||
|
PR_NUMBER=$(jq -r '.pr_number' bot-output.json)
|
||||||
|
MARKER="<!-- spc-test-bot -->"
|
||||||
|
|
||||||
|
# Find existing bot comment id
|
||||||
|
EXISTING_ID=$(gh api \
|
||||||
|
"repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" \
|
||||||
|
--jq "[.[] | select(.body | startswith(\"${MARKER}\")) | .id] | first // empty")
|
||||||
|
|
||||||
|
if [ -n "$EXISTING_ID" ]; then
|
||||||
|
gh api --method PATCH \
|
||||||
|
"repos/${{ github.repository }}/issues/comments/${EXISTING_ID}" \
|
||||||
|
-f body="$COMMENT_BODY"
|
||||||
|
else
|
||||||
|
gh pr comment "$PR_NUMBER" \
|
||||||
|
--repo "${{ github.repository }}" \
|
||||||
|
--body "$COMMENT_BODY"
|
||||||
|
fi
|
||||||
9
.github/workflows/release-build.yml
vendored
9
.github/workflows/release-build.yml
vendored
@@ -38,6 +38,9 @@ jobs:
|
|||||||
- name: "windows-x64"
|
- name: "windows-x64"
|
||||||
os: "ubuntu-latest"
|
os: "ubuntu-latest"
|
||||||
filename: "spc-windows-x64.exe"
|
filename: "spc-windows-x64.exe"
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v5"
|
uses: "actions/checkout@v5"
|
||||||
@@ -105,6 +108,12 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: "Generate build provenance attestation"
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: "${{ github.workspace }}/${{ matrix.operating-system.name == 'windows-x64' && 'spc.exe' || 'spc' }}"
|
||||||
|
|
||||||
- name: "Copy file"
|
- name: "Copy file"
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ matrix.operating-system.name }}" != "windows-x64" ]; then
|
if [ "${{ matrix.operating-system.name }}" != "windows-x64" ]; then
|
||||||
|
|||||||
31
.github/workflows/tests.yml
vendored
31
.github/workflows/tests.yml
vendored
@@ -131,7 +131,6 @@ jobs:
|
|||||||
if: needs.check-gate.outputs.enabled == 'true'
|
if: needs.check-gate.outputs.enabled == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
|
||||||
contents: read
|
contents: read
|
||||||
outputs:
|
outputs:
|
||||||
need_test: ${{ steps.bot.outputs.need_test }}
|
need_test: ${{ steps.bot.outputs.need_test }}
|
||||||
@@ -168,23 +167,17 @@ jobs:
|
|||||||
echo "php_versions=$(echo "$BOT_JSON" | jq -c '.php_versions')" >> "$GITHUB_OUTPUT"
|
echo "php_versions=$(echo "$BOT_JSON" | jq -c '.php_versions')" >> "$GITHUB_OUTPUT"
|
||||||
echo "tier2=$(echo "$BOT_JSON" | jq -r '.tier2')" >> "$GITHUB_OUTPUT"
|
echo "tier2=$(echo "$BOT_JSON" | jq -r '.tier2')" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
COMMENT_BODY=$(echo "$BOT_JSON" | jq -r '.comment_body')
|
# Save JSON for the comment-posting workflow
|
||||||
MARKER="<!-- spc-test-bot -->"
|
jq -n --argjson bot "$BOT_JSON" \
|
||||||
|
--arg pr '${{ github.event.pull_request.number }}' \
|
||||||
|
'$bot + {pr_number: $pr}' > bot-output.json
|
||||||
|
|
||||||
# Find existing bot comment id
|
- name: Upload bot output
|
||||||
EXISTING_ID=$(gh api \
|
uses: actions/upload-artifact@v4
|
||||||
repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
|
with:
|
||||||
--jq "[.[] | select(.body | startswith(\"$MARKER\")) | .id] | first // empty")
|
name: bot-output
|
||||||
|
path: bot-output.json
|
||||||
if [ -n "$EXISTING_ID" ]; then
|
retention-days: 1
|
||||||
gh api --method PATCH \
|
|
||||||
repos/${{ github.repository }}/issues/comments/"$EXISTING_ID" \
|
|
||||||
-f body="$COMMENT_BODY"
|
|
||||||
else
|
|
||||||
gh pr comment ${{ github.event.pull_request.number }} \
|
|
||||||
--repo ${{ github.repository }} \
|
|
||||||
--body "$COMMENT_BODY"
|
|
||||||
fi
|
|
||||||
|
|
||||||
gen-matrix:
|
gen-matrix:
|
||||||
name: "Generate test matrix"
|
name: "Generate test matrix"
|
||||||
@@ -234,7 +227,7 @@ jobs:
|
|||||||
echo "matrix=$(echo "$FINAL" | jq -c '{"combo": .}')" >> "$GITHUB_OUTPUT"
|
echo "matrix=$(echo "$FINAL" | jq -c '{"combo": .}')" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
ext-test:
|
ext-test:
|
||||||
name: "Ext test: ${{ matrix.combo.extension }} (PHP ${{ matrix.combo.php-version }} · ${{ matrix.combo.os }}-${{ matrix.combo.arch }})"
|
name: "Ext test: ${{ matrix.combo.extension }} [${{ matrix.combo.sapi }}] (PHP ${{ matrix.combo.php-version }} - ${{ matrix.combo.os }}-${{ matrix.combo.arch }})"
|
||||||
needs: gen-matrix
|
needs: gen-matrix
|
||||||
runs-on: ${{ matrix.combo.runner }}
|
runs-on: ${{ matrix.combo.runner }}
|
||||||
timeout-minutes: 120
|
timeout-minutes: 120
|
||||||
@@ -273,5 +266,5 @@ jobs:
|
|||||||
if: always() && hashFiles('log/**') != ''
|
if: always() && hashFiles('log/**') != ''
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: logs-${{ matrix.combo.os }}-${{ matrix.combo.arch }}-${{ matrix.combo.extension }}-php${{ matrix.combo.php-version }}
|
name: logs-${{ matrix.combo.os }}-${{ matrix.combo.arch }}-${{ matrix.combo.sapi }}-${{ matrix.combo.extension }}-php${{ matrix.combo.php-version }}
|
||||||
path: log
|
path: log
|
||||||
|
|||||||
59
AGENTS.md
Normal file
59
AGENTS.md
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# StaticPHP v3 Agent Guide
|
||||||
|
|
||||||
|
StaticPHP is a PHP CLI application for building static PHP binaries, PHP SAPIs, extensions, libraries, helper tools, and project bundles. Prefer the v3 architecture under `src/StaticPHP`, `src/Package`, `config/pkg`, and `config/artifact`.
|
||||||
|
|
||||||
|
This file is the shared entry point for coding agents such as Codex, OpenCode, Claude-compatible agents, and GitHub Copilot agents. GitHub Copilot also has `.github/copilot-instructions.md`.
|
||||||
|
|
||||||
|
## Skills
|
||||||
|
|
||||||
|
Detailed task workflows live in `.github/skills`. Use them when the task matches:
|
||||||
|
|
||||||
|
- `.github/skills/staticphp-package-maintenance`: add, modify, review, or validate package, artifact, extension, library, target, or tool definitions.
|
||||||
|
- `.github/skills/staticphp-build-troubleshooting`: diagnose build, download, doctor, shell, terminal, CI, smoke-test, or log failures.
|
||||||
|
|
||||||
|
If your agent does not automatically discover skills from `.github/skills`, read the matching `SKILL.md` manually before working on that task.
|
||||||
|
|
||||||
|
## Project Map
|
||||||
|
|
||||||
|
- `bin/spc`: primary CLI entrypoint.
|
||||||
|
- `composer.json`: PHP 8.4+, Symfony Console, DI, YAML, logger; useful scripts are `composer test`, `composer analyse`, `composer lint-config`, and `composer cs-fix`.
|
||||||
|
- `spc.registry.yml`: built-in `core` registry.
|
||||||
|
- `config/pkg/ext`: PHP extension package YAML, usually named `ext-*.yml`.
|
||||||
|
- `config/pkg/lib`: library package YAML.
|
||||||
|
- `config/pkg/target`: final build target and virtual target YAML.
|
||||||
|
- `config/pkg/tool`: helper tool package YAML.
|
||||||
|
- `config/artifact`: standalone artifact YAML for shared or complex sources/binaries.
|
||||||
|
- `log/`: build and shell execution logs (`spc.output.log`, `spc.shell.log`, and per-package CMake/config logs); controlled by `SPC_LOGS_DIR` and `SPC_ENABLE_LOG_FILE`.
|
||||||
|
- `src/StaticPHP`: framework core: registry loading, config validation, dependency resolution, package install/build pipeline, doctor, toolchains, runtime shell/executors, exceptions.
|
||||||
|
- `src/Package`: package-specific build logic registered by PHP attributes.
|
||||||
|
- `src/globals`: constants, helper functions, patches, smoke tests, bundled license text.
|
||||||
|
- `tests`: PHPUnit tests for config, registry, artifacts, dependency resolver, DI, commands, and utilities.
|
||||||
|
- `docs/en/develop` and `docs/zh/develop`: developer documentation. Some pages may be TODO; verify against source when behavior matters.
|
||||||
|
|
||||||
|
## Working Rules
|
||||||
|
|
||||||
|
- Keep changes scoped to the requested package, artifact, command, docs, or tests.
|
||||||
|
- Prefer existing package patterns over new abstractions. Search for a similar package first.
|
||||||
|
- Use structured YAML config; do not encode dependency logic in PHP when config fields are enough.
|
||||||
|
- Match package names exactly: extension packages use `ext-` in config and dependencies; `#[Extension('curl')]` expands to `ext-curl`.
|
||||||
|
- Use platform suffixes such as `@unix`, `@linux`, `@macos`, and `@windows` instead of runtime conditionals when the difference is declarative.
|
||||||
|
- Add or update PHP package classes only when build commands, validation, custom configure args, hooks, or source patching are required.
|
||||||
|
- Do not edit generated build directories (`buildroot/`, `source/`, `downloads/`, `pkgroot/`) as a fix.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
For config or package changes, run CS checks first:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bin/spc dev:lint-config
|
||||||
|
composer cs-fix
|
||||||
|
```
|
||||||
|
|
||||||
|
For broader PHP code changes, also run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
composer test
|
||||||
|
composer analyse
|
||||||
|
```
|
||||||
|
|
||||||
|
Use build commands only when needed for the task or when the user provided a repro, because full static builds can be slow and platform-sensitive.
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
||||||
[](https://discord.gg/nrSRbpMJ)
|
[](https://discord.gg/xf6Rd4pEAk)
|
||||||
|
|
||||||
**StaticPHP** 是一个强大的工具,用于构建可移植的可执行文件,包括 PHP、扩展等。
|
**StaticPHP** 是一个强大的工具,用于构建可移植的可执行文件,包括 PHP、扩展等。
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ echo '<?php echo "Hello world!\n";' > a.php
|
|||||||
|
|
||||||
## 直接下载
|
## 直接下载
|
||||||
|
|
||||||
如果你暂时不想构建,或只想先测试,可以从 [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-bulk.yml) 下载示例预编译产物,或从自托管服务器下载。
|
如果你暂时不想构建,或只想先测试,可以从 [Actions](https://github.com/static-php/hosted/actions/workflows/build-php-bulk.yml) 下载示例预编译产物,或从自托管服务器下载。
|
||||||
|
|
||||||
我们为每个 PHP 版本提供 2 种扩展集合:
|
我们为每个 PHP 版本提供 2 种扩展集合:
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
||||||
[](https://discord.gg/nrSRbpMJ)
|
[](https://discord.gg/xf6Rd4pEAk)
|
||||||
|
|
||||||
**StaticPHP** is a powerful tool designed for building portable executables including PHP, extensions, and more.
|
**StaticPHP** is a powerful tool designed for building portable executables including PHP, extensions, and more.
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ see <https://static-php.dev>.
|
|||||||
|
|
||||||
## Direct Download
|
## Direct Download
|
||||||
|
|
||||||
If you do not want to build yet or just want to test first, you can download example pre-compiled artifacts from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-bulk.yml) or from a self-hosted server.
|
If you do not want to build yet or just want to test first, you can download example pre-compiled artifacts from [Actions](https://github.com/static-php/hosted/actions/workflows/build-php-bulk.yml) or from a self-hosted server.
|
||||||
|
|
||||||
We offer 2 types of extension sets for each PHP version:
|
We offer 2 types of extension sets for each PHP version:
|
||||||
|
|
||||||
|
|||||||
1
box.json
1
box.json
@@ -10,7 +10,6 @@
|
|||||||
"config",
|
"config",
|
||||||
"src",
|
"src",
|
||||||
"vendor/psr",
|
"vendor/psr",
|
||||||
"vendor/laravel/prompts",
|
|
||||||
"vendor/symfony",
|
"vendor/symfony",
|
||||||
"vendor/php-di",
|
"vendor/php-di",
|
||||||
"vendor/zhamao"
|
"vendor/zhamao"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"action": "bin/spc dev:lint-config --check",
|
"action": "php bin/spc dev:lint-config --check",
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\InDirectory",
|
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\InDirectory",
|
||||||
|
|||||||
@@ -12,10 +12,8 @@
|
|||||||
"php": ">=8.4",
|
"php": ">=8.4",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-zlib": "*",
|
"ext-zlib": "*",
|
||||||
"laravel/prompts": "~0.1",
|
|
||||||
"php-di/php-di": "^7.1",
|
"php-di/php-di": "^7.1",
|
||||||
"symfony/console": "^5.4 || ^6 || ^7",
|
"symfony/console": "^5.4 || ^6 || ^7",
|
||||||
"symfony/process": "^7.2",
|
|
||||||
"symfony/yaml": "^7.2",
|
"symfony/yaml": "^7.2",
|
||||||
"zhamao/logger": "^1.1.4"
|
"zhamao/logger": "^1.1.4"
|
||||||
},
|
},
|
||||||
|
|||||||
568
composer.lock
generated
568
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -4,5 +4,9 @@ ncurses:
|
|||||||
- COPYING
|
- COPYING
|
||||||
source:
|
source:
|
||||||
type: filelist
|
type: filelist
|
||||||
url: 'https://ftp.gnu.org/pub/gnu/ncurses/'
|
url: 'https://ftp.gnu.org/gnu/ncurses/'
|
||||||
|
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
|
source-mirror:
|
||||||
|
type: filelist
|
||||||
|
url: 'https://ftpmirror.gnu.org/gnu/ncurses/'
|
||||||
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ PHP_BUILD_PROVIDER="StaticPHP ${SPC_VERSION}"
|
|||||||
SPC_ENABLE_LOG_FILE="yes"
|
SPC_ENABLE_LOG_FILE="yes"
|
||||||
; The LOG DIR for spc logs
|
; The LOG DIR for spc logs
|
||||||
SPC_LOGS_DIR="${WORKING_DIR}/log"
|
SPC_LOGS_DIR="${WORKING_DIR}/log"
|
||||||
; Preserve old logs when running new builds
|
; Preserve old logs when running new builds (code checks SPC_PRESERVE_LOG, not SPC_PRESERVE_LOGS)
|
||||||
SPC_PRESERVE_LOGS="no"
|
SPC_PRESERVE_LOG="no"
|
||||||
|
|
||||||
; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
|
; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
|
||||||
; only useful for builds targeting not pure-static linking
|
; only useful for builds targeting not pure-static linking
|
||||||
@@ -68,8 +68,8 @@ SPC_PRESERVE_LOGS="no"
|
|||||||
[windows]
|
[windows]
|
||||||
; build target: win7-static
|
; build target: win7-static
|
||||||
SPC_TARGET=native-windows
|
SPC_TARGET=native-windows
|
||||||
; php-sdk-binary-tools path
|
; MSYS2 root directory (msys64 subfolder), used by the Windows toolchain
|
||||||
PHP_SDK_PATH="${WORKING_DIR}\php-sdk-binary-tools"
|
SPC_MSYS2_PATH="${PKG_ROOT_PATH}\msys2-build-essentials\msys64"
|
||||||
; upx executable path
|
; upx executable path
|
||||||
UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
|
UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
|
||||||
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
||||||
@@ -142,7 +142,7 @@ CXX=${SPC_DEFAULT_CXX}
|
|||||||
AR=${SPC_DEFAULT_AR}
|
AR=${SPC_DEFAULT_AR}
|
||||||
LD=${SPC_DEFAULT_LD}
|
LD=${SPC_DEFAULT_LD}
|
||||||
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
||||||
SPC_DEFAULT_CFLAGS="--target=${MAC_ARCH}-apple-darwin -O3 -fno-plt -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffunction-sections -fdata-sections"
|
SPC_DEFAULT_CFLAGS="--target=${MAC_ARCH}-apple-darwin -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffunction-sections -fdata-sections"
|
||||||
SPC_DEFAULT_CXXFLAGS="${SPC_DEFAULT_CFLAGS}"
|
SPC_DEFAULT_CXXFLAGS="${SPC_DEFAULT_CFLAGS}"
|
||||||
SPC_DEFAULT_LDFLAGS="-Wl,-dead_strip"
|
SPC_DEFAULT_LDFLAGS="-Wl,-dead_strip"
|
||||||
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ ext-password-argon2:
|
|||||||
type: php-extension
|
type: php-extension
|
||||||
depends:
|
depends:
|
||||||
- libargon2
|
- libargon2
|
||||||
|
suggests:
|
||||||
- ext-openssl
|
- ext-openssl
|
||||||
php-extension:
|
php-extension:
|
||||||
os:
|
os:
|
||||||
|
|||||||
20
config/pkg/ext/ext-fastchart.yml
Normal file
20
config/pkg/ext/ext-fastchart.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
ext-fastchart:
|
||||||
|
type: php-extension
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: ghtar
|
||||||
|
repo: iliaal/fastchart
|
||||||
|
extract: php-src/ext/fastchart
|
||||||
|
prefer-stable: true
|
||||||
|
metadata:
|
||||||
|
license-files: [LICENSE]
|
||||||
|
depends:
|
||||||
|
- freetype
|
||||||
|
suggests:
|
||||||
|
- libpng
|
||||||
|
- libjpeg
|
||||||
|
- libwebp
|
||||||
|
php-extension:
|
||||||
|
os:
|
||||||
|
- Linux
|
||||||
|
- Darwin
|
||||||
14
config/pkg/ext/ext-fastjson.yml
Normal file
14
config/pkg/ext/ext-fastjson.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
ext-fastjson:
|
||||||
|
type: php-extension
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: ghtar
|
||||||
|
repo: iliaal/fastjson
|
||||||
|
extract: php-src/ext/fastjson
|
||||||
|
prefer-stable: true
|
||||||
|
metadata:
|
||||||
|
license-files: [LICENSE]
|
||||||
|
php-extension:
|
||||||
|
os:
|
||||||
|
- Linux
|
||||||
|
- Darwin
|
||||||
@@ -10,3 +10,5 @@ ext-gmssl:
|
|||||||
license: PHP-3.01
|
license: PHP-3.01
|
||||||
depends:
|
depends:
|
||||||
- gmssl
|
- gmssl
|
||||||
|
php-extension:
|
||||||
|
arg-type: with-path
|
||||||
|
|||||||
@@ -13,4 +13,5 @@ ext-imagick:
|
|||||||
os:
|
os:
|
||||||
- Linux
|
- Linux
|
||||||
- Darwin
|
- Darwin
|
||||||
|
- Windows
|
||||||
arg-type: custom
|
arg-type: custom
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ ext-zip:
|
|||||||
license: PHP-3.01
|
license: PHP-3.01
|
||||||
depends:
|
depends:
|
||||||
- libzip
|
- libzip
|
||||||
|
depends@windows:
|
||||||
|
- libzip
|
||||||
|
- zlib
|
||||||
|
- xz
|
||||||
|
- bzip2
|
||||||
php-extension:
|
php-extension:
|
||||||
arg-type: custom
|
arg-type: custom
|
||||||
arg-type@windows: enable
|
arg-type@windows: enable
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ gettext-win:
|
|||||||
source:
|
source:
|
||||||
type: git
|
type: git
|
||||||
url: 'https://github.com/winlibs/gettext.git'
|
url: 'https://github.com/winlibs/gettext.git'
|
||||||
rev: master
|
rev: '0.18'
|
||||||
static-libs@windows:
|
static-libs@windows:
|
||||||
- libintl_a.lib
|
- libintl_a.lib
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ gettext:
|
|||||||
artifact:
|
artifact:
|
||||||
source:
|
source:
|
||||||
type: filelist
|
type: filelist
|
||||||
url: 'https://ftp.gnu.org/pub/gnu/gettext/'
|
url: 'https://ftp.gnu.org/gnu/gettext/'
|
||||||
|
regex: '/href="(?<file>gettext-(?<version>[^"]+)\.tar\.xz)"/'
|
||||||
|
source-mirror:
|
||||||
|
type: filelist
|
||||||
|
url: 'https://ftpmirror.gnu.org/gnu/gettext/'
|
||||||
regex: '/href="(?<file>gettext-(?<version>[^"]+)\.tar\.xz)"/'
|
regex: '/href="(?<file>gettext-(?<version>[^"]+)\.tar\.xz)"/'
|
||||||
metadata:
|
metadata:
|
||||||
license-files: [gettext-runtime/intl/COPYING.LIB]
|
license-files: [gettext-runtime/intl/COPYING.LIB]
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ gmp:
|
|||||||
url: 'https://ftp.gnu.org/gnu/gmp/'
|
url: 'https://ftp.gnu.org/gnu/gmp/'
|
||||||
regex: '/href="(?<file>gmp-(?<version>[^"]+)\.tar\.xz)"/'
|
regex: '/href="(?<file>gmp-(?<version>[^"]+)\.tar\.xz)"/'
|
||||||
source-mirror:
|
source-mirror:
|
||||||
type: url
|
type: filelist
|
||||||
url: 'https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz'
|
url: 'https://ftpmirror.gnu.org/gnu/gmp/'
|
||||||
|
regex: '/href="(?<file>gmp-(?<version>[^"]+)\.tar\.xz)"/'
|
||||||
metadata:
|
metadata:
|
||||||
license-files: ['@/gmp.txt']
|
license-files: ['@/gmp.txt']
|
||||||
license: Custom
|
license: Custom
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ idn2:
|
|||||||
type: filelist
|
type: filelist
|
||||||
url: 'https://ftp.gnu.org/gnu/libidn/'
|
url: 'https://ftp.gnu.org/gnu/libidn/'
|
||||||
regex: '/href="(?<file>libidn2-(?<version>[^"]+)\.tar\.gz)"/'
|
regex: '/href="(?<file>libidn2-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
|
source-mirror:
|
||||||
|
type: filelist
|
||||||
|
url: 'https://ftpmirror.gnu.org/gnu/libidn/'
|
||||||
|
regex: '/href="(?<file>libidn2-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
metadata:
|
metadata:
|
||||||
license-files: [COPYING.LESSERv3]
|
license-files: [COPYING.LESSERv3]
|
||||||
license: LGPL-3.0-or-later
|
license: LGPL-3.0-or-later
|
||||||
|
|||||||
@@ -16,13 +16,59 @@ imagemagick:
|
|||||||
- libtiff
|
- libtiff
|
||||||
- libheif
|
- libheif
|
||||||
- bzip2
|
- bzip2
|
||||||
|
depends@windows:
|
||||||
|
- zlib
|
||||||
suggests:
|
suggests:
|
||||||
- zstd
|
- zstd
|
||||||
- xz
|
- xz
|
||||||
- libzip
|
- libzip
|
||||||
- libxml2
|
- libxml2
|
||||||
|
headers@windows:
|
||||||
|
- imagemagick/MagickWand/MagickWand.h
|
||||||
lang: cpp
|
lang: cpp
|
||||||
pkg-configs:
|
pkg-configs:
|
||||||
- Magick++-7.Q16HDRI
|
- Magick++-7.Q16HDRI
|
||||||
- MagickCore-7.Q16HDRI
|
- MagickCore-7.Q16HDRI
|
||||||
- MagickWand-7.Q16HDRI
|
- MagickWand-7.Q16HDRI
|
||||||
|
static-libs@windows:
|
||||||
|
- CORE_RL_MagickWand_.lib
|
||||||
|
- CORE_RL_MagickCore_.lib
|
||||||
|
- CORE_RL_coders_.lib
|
||||||
|
- CORE_RL_filters_.lib
|
||||||
|
- CORE_RL_aom_.lib
|
||||||
|
- CORE_RL_brotli_.lib
|
||||||
|
- CORE_RL_bzip2_.lib
|
||||||
|
- CORE_RL_cairo_.lib
|
||||||
|
- CORE_RL_croco_.lib
|
||||||
|
- CORE_RL_de265_.lib
|
||||||
|
- CORE_RL_exr_.lib
|
||||||
|
- CORE_RL_ffi_.lib
|
||||||
|
- CORE_RL_freetype_.lib
|
||||||
|
- CORE_RL_fribidi_.lib
|
||||||
|
- CORE_RL_gdk-pixbuf_.lib
|
||||||
|
- CORE_RL_glib_.lib
|
||||||
|
- CORE_RL_harfbuzz_.lib
|
||||||
|
- CORE_RL_heif_.lib
|
||||||
|
- CORE_RL_highway_.lib
|
||||||
|
- CORE_RL_imath_.lib
|
||||||
|
- CORE_RL_jpeg-turbo-12_.lib
|
||||||
|
- CORE_RL_jpeg-turbo-16_.lib
|
||||||
|
- CORE_RL_jpeg-turbo_.lib
|
||||||
|
- CORE_RL_jpeg-xl_.lib
|
||||||
|
- CORE_RL_lcms_.lib
|
||||||
|
- CORE_RL_lqr_.lib
|
||||||
|
- CORE_RL_lzma_.lib
|
||||||
|
- CORE_RL_openh264_.lib
|
||||||
|
- CORE_RL_openjpeg_.lib
|
||||||
|
- CORE_RL_openjph_.lib
|
||||||
|
- CORE_RL_pango_.lib
|
||||||
|
- CORE_RL_pixman_.lib
|
||||||
|
- CORE_RL_png_.lib
|
||||||
|
- CORE_RL_raqm_.lib
|
||||||
|
- CORE_RL_raw_.lib
|
||||||
|
- CORE_RL_rsvg_.lib
|
||||||
|
- CORE_RL_tiff_.lib
|
||||||
|
- CORE_RL_webp_.lib
|
||||||
|
- CORE_RL_xml_.lib
|
||||||
|
- CORE_RL_zip_.lib
|
||||||
|
- CORE_RL_zlib_.lib
|
||||||
|
|||||||
@@ -9,5 +9,4 @@ libiconv-win:
|
|||||||
license-files: [source/COPYING]
|
license-files: [source/COPYING]
|
||||||
license: GPL-3.0-or-later
|
license: GPL-3.0-or-later
|
||||||
static-libs@windows:
|
static-libs@windows:
|
||||||
- libiconv.lib
|
|
||||||
- libiconv_a.lib
|
- libiconv_a.lib
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ libiconv:
|
|||||||
type: filelist
|
type: filelist
|
||||||
url: 'https://ftp.gnu.org/gnu/libiconv/'
|
url: 'https://ftp.gnu.org/gnu/libiconv/'
|
||||||
regex: '/href="(?<file>libiconv-(?<version>[^"]+)\.tar\.gz)"/'
|
regex: '/href="(?<file>libiconv-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
|
source-mirror:
|
||||||
|
type: filelist
|
||||||
|
url: 'https://ftpmirror.gnu.org/gnu/libiconv/'
|
||||||
|
regex: '/href="(?<file>libiconv-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
metadata:
|
metadata:
|
||||||
license-files: [COPYING.LIB]
|
license-files: [COPYING.LIB]
|
||||||
license: LGPL-2.0-or-later
|
license: LGPL-2.0-or-later
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ libssh2:
|
|||||||
metadata:
|
metadata:
|
||||||
license-files: [COPYING]
|
license-files: [COPYING]
|
||||||
license: BSD-3-Clause
|
license: BSD-3-Clause
|
||||||
depends:
|
depends@unix:
|
||||||
- openssl
|
- openssl
|
||||||
|
depends@windows:
|
||||||
|
- zlib
|
||||||
headers:
|
headers:
|
||||||
- libssh2.h
|
- libssh2.h
|
||||||
- libssh2_publickey.h
|
- libssh2_publickey.h
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ libunistring:
|
|||||||
type: filelist
|
type: filelist
|
||||||
url: 'https://ftp.gnu.org/gnu/libunistring/'
|
url: 'https://ftp.gnu.org/gnu/libunistring/'
|
||||||
regex: '/href="(?<file>libunistring-(?<version>[^"]+)\.tar\.gz)"/'
|
regex: '/href="(?<file>libunistring-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
|
source-mirror:
|
||||||
|
type: filelist
|
||||||
|
url: 'https://ftpmirror.gnu.org/gnu/libunistring/'
|
||||||
|
regex: '/href="(?<file>libunistring-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
metadata:
|
metadata:
|
||||||
license-files: [COPYING.LIB]
|
license-files: [COPYING.LIB]
|
||||||
license: LGPL-3.0-or-later
|
license: LGPL-3.0-or-later
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ libzip:
|
|||||||
license: BSD-3-Clause
|
license: BSD-3-Clause
|
||||||
depends:
|
depends:
|
||||||
- zlib
|
- zlib
|
||||||
|
depends@windows:
|
||||||
|
- zlib
|
||||||
|
- bzip2
|
||||||
|
- xz
|
||||||
suggests:
|
suggests:
|
||||||
- bzip2
|
- bzip2
|
||||||
- xz
|
- xz
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ openssl:
|
|||||||
- zlib
|
- zlib
|
||||||
depends@windows:
|
depends@windows:
|
||||||
- zlib
|
- zlib
|
||||||
- jom
|
|
||||||
headers:
|
headers:
|
||||||
- openssl
|
- openssl
|
||||||
static-libs@unix:
|
static-libs@unix:
|
||||||
@@ -26,3 +25,7 @@ openssl:
|
|||||||
static-libs@windows:
|
static-libs@windows:
|
||||||
- libssl.lib
|
- libssl.lib
|
||||||
- libcrypto.lib
|
- libcrypto.lib
|
||||||
|
tools@windows:
|
||||||
|
- jom
|
||||||
|
- nasm
|
||||||
|
- strawberry-perl
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ postgresql:
|
|||||||
type: ghtagtar
|
type: ghtagtar
|
||||||
repo: postgres/postgres
|
repo: postgres/postgres
|
||||||
match: REL_18_\d+
|
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:
|
metadata:
|
||||||
license-files: ['@/postgresql.txt']
|
license-files: ['@/postgresql.txt']
|
||||||
license: PostgreSQL
|
license: PostgreSQL
|
||||||
@@ -16,6 +14,9 @@ postgresql:
|
|||||||
- openssl
|
- openssl
|
||||||
- zlib
|
- zlib
|
||||||
- libedit
|
- libedit
|
||||||
|
depends@windows:
|
||||||
|
- openssl
|
||||||
|
- zlib
|
||||||
suggests@unix:
|
suggests@unix:
|
||||||
- icu
|
- icu
|
||||||
- libxslt
|
- libxslt
|
||||||
@@ -27,3 +28,9 @@ postgresql:
|
|||||||
- libpq.lib
|
- libpq.lib
|
||||||
- libpgport.lib
|
- libpgport.lib
|
||||||
- libpgcommon.lib
|
- libpgcommon.lib
|
||||||
|
tools@windows:
|
||||||
|
- python-win
|
||||||
|
- meson
|
||||||
|
- ninja
|
||||||
|
- winflexbison
|
||||||
|
- strawberry-perl
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ readline:
|
|||||||
artifact:
|
artifact:
|
||||||
source:
|
source:
|
||||||
type: filelist
|
type: filelist
|
||||||
url: 'https://ftp.gnu.org/pub/gnu/readline/'
|
url: 'https://ftp.gnu.org/gnu/readline/'
|
||||||
|
regex: '/href="(?<file>readline-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
|
source-mirror:
|
||||||
|
type: filelist
|
||||||
|
url: 'https://ftpmirror.gnu.org/gnu/readline/'
|
||||||
regex: '/href="(?<file>readline-(?<version>[^"]+)\.tar\.gz)"/'
|
regex: '/href="(?<file>readline-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
metadata:
|
metadata:
|
||||||
license-files: [COPYING]
|
license-files: [COPYING]
|
||||||
|
|||||||
@@ -10,10 +10,8 @@ frankenphp:
|
|||||||
license: MIT
|
license: MIT
|
||||||
depends:
|
depends:
|
||||||
- php-embed
|
- php-embed
|
||||||
- go-xcaddy
|
|
||||||
depends@windows:
|
depends@windows:
|
||||||
- php-embed
|
- php-embed
|
||||||
- go-win
|
|
||||||
- pthreads4w
|
- pthreads4w
|
||||||
suggests@unix:
|
suggests@unix:
|
||||||
- brotli
|
- brotli
|
||||||
@@ -24,3 +22,7 @@ frankenphp:
|
|||||||
- frankenphp
|
- frankenphp
|
||||||
static-bins@windows:
|
static-bins@windows:
|
||||||
- frankenphp.exe
|
- frankenphp.exe
|
||||||
|
tools:
|
||||||
|
- go-xcaddy
|
||||||
|
tools@windows:
|
||||||
|
- go-win
|
||||||
|
|||||||
8
config/pkg/target/msys2-build-essentials.yml
Normal file
8
config/pkg/target/msys2-build-essentials.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
msys2-build-essentials:
|
||||||
|
type: target
|
||||||
|
artifact:
|
||||||
|
binary: custom
|
||||||
|
env:
|
||||||
|
SPC_MSYS2_PATH: '{pkg_root_path}/msys2-build-essentials/msys64'
|
||||||
|
path@windows:
|
||||||
|
- '{pkg_root_path}/msys2-build-essentials/msys64/usr/bin'
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
nasm:
|
|
||||||
type: target
|
|
||||||
artifact:
|
|
||||||
binary:
|
|
||||||
windows-x86_64: { type: url, url: 'https://dl.static-php.dev/static-php-cli/deps/nasm/nasm-2.16.01-win64.zip', extract: { nasm.exe: '{php_sdk_path}/bin/nasm.exe', ndisasm.exe: '{php_sdk_path}/bin/ndisasm.exe' } }
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
php-sdk-binary-tools:
|
|
||||||
type: target
|
|
||||||
artifact:
|
|
||||||
binary:
|
|
||||||
windows-x86_64: { type: git, rev: master, url: 'https://github.com/php/php-sdk-binary-tools.git', extract: '{php_sdk_path}' }
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
pkg-config:
|
|
||||||
type: target
|
|
||||||
artifact:
|
|
||||||
source: 'https://dl.static-php.dev/static-php-cli/deps/pkg-config/pkg-config-0.29.2.tar.gz'
|
|
||||||
binary:
|
|
||||||
linux-x86_64: { type: ghrel, repo: static-php/static-php-cli-hosted, match: pkg-config-x86_64-linux-musl-1.2.5.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } }
|
|
||||||
linux-aarch64: { type: ghrel, repo: static-php/static-php-cli-hosted, match: pkg-config-aarch64-linux-musl-1.2.5.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } }
|
|
||||||
macos-x86_64: { type: ghrel, repo: static-php/static-php-cli-hosted, match: pkg-config-x86_64-darwin.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } }
|
|
||||||
macos-aarch64: { type: ghrel, repo: static-php/static-php-cli-hosted, match: pkg-config-aarch64-darwin.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } }
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
zig:
|
|
||||||
type: target
|
|
||||||
artifact:
|
|
||||||
binary: custom
|
|
||||||
9
config/pkg/tool/7za-win.yml
Normal file
9
config/pkg/tool/7za-win.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
7za-win:
|
||||||
|
type: tool
|
||||||
|
artifact:
|
||||||
|
binary:
|
||||||
|
windows-x86_64: { type: url, url: 'https://dl.static-php.dev/v3/tools/7zip/7za.exe', extract: '{pkg_root_path}/bin/7za.exe' }
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- 7za.exe
|
||||||
|
binary-subdir: bin
|
||||||
@@ -1,10 +1,15 @@
|
|||||||
go-win:
|
go-win:
|
||||||
type: target
|
type: tool
|
||||||
artifact:
|
artifact:
|
||||||
binary: custom
|
binary: custom
|
||||||
env:
|
env:
|
||||||
GOROOT: '{pkg_root_path}/go-win'
|
GOROOT: '{pkg_root_path}/go-win'
|
||||||
GOBIN: '{pkg_root_path}/go-win/bin'
|
GOBIN: '{pkg_root_path}/go-win/bin'
|
||||||
GOPATH: '{pkg_root_path}/go-win/go'
|
GOPATH: '{pkg_root_path}/go-win/gopath'
|
||||||
path@windows:
|
path@windows:
|
||||||
- '{pkg_root_path}/go-win/bin'
|
- '{pkg_root_path}/go-win/bin'
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- go.exe
|
||||||
|
- gofmt.exe
|
||||||
|
binary-subdir: go-win/bin
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
go-xcaddy:
|
go-xcaddy:
|
||||||
type: target
|
type: tool
|
||||||
artifact:
|
artifact:
|
||||||
binary: custom
|
binary: custom
|
||||||
env:
|
env:
|
||||||
@@ -8,5 +8,8 @@ go-xcaddy:
|
|||||||
GOPATH: '{pkg_root_path}/go-xcaddy/go'
|
GOPATH: '{pkg_root_path}/go-xcaddy/go'
|
||||||
path@unix:
|
path@unix:
|
||||||
- '{pkg_root_path}/go-xcaddy/bin'
|
- '{pkg_root_path}/go-xcaddy/bin'
|
||||||
static-bins:
|
tool:
|
||||||
- xcaddy
|
provides:
|
||||||
|
- go
|
||||||
|
- gofmt
|
||||||
|
binary-subdir: go-xcaddy/bin
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
jom:
|
jom:
|
||||||
type: target
|
type: tool
|
||||||
artifact:
|
artifact:
|
||||||
binary:
|
binary:
|
||||||
windows-x86_64: { type: url, url: 'https://download.qt.io/official_releases/jom/jom.zip', extract: '{pkg_root_path}/jom' }
|
windows-x86_64: { type: url, url: 'https://download.qt.io/official_releases/jom/jom.zip', extract: '{pkg_root_path}/jom' }
|
||||||
path@windows:
|
path@windows:
|
||||||
- '{pkg_root_path}\jom'
|
- '{pkg_root_path}\jom'
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- jom.exe
|
||||||
|
binary-subdir: jom
|
||||||
11
config/pkg/tool/meson.yml
Normal file
11
config/pkg/tool/meson.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
meson:
|
||||||
|
type: tool
|
||||||
|
artifact:
|
||||||
|
binary:
|
||||||
|
windows-x86_64: { type: url, url: 'https://github.com/mesonbuild/meson/releases/download/1.11.1/meson-1.11.1-py3-none-any.whl', extract: '{pkg_root_path}/meson/meson-1.11.1-py3-none-any.whl' }
|
||||||
|
path@windows:
|
||||||
|
- '{pkg_root_path}\meson'
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- meson.bat
|
||||||
|
binary-subdir: meson
|
||||||
10
config/pkg/tool/nasm.yml
Normal file
10
config/pkg/tool/nasm.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
nasm:
|
||||||
|
type: tool
|
||||||
|
artifact:
|
||||||
|
binary:
|
||||||
|
windows-x86_64: { type: url, url: 'https://dl.static-php.dev/static-php-cli/deps/nasm/nasm-2.16.01-win64.zip', extract: { nasm.exe: '{pkg_root_path}/bin/nasm.exe', ndisasm.exe: '{pkg_root_path}/bin/ndisasm.exe' } }
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- nasm.exe
|
||||||
|
- ndisasm.exe
|
||||||
|
binary-subdir: bin
|
||||||
9
config/pkg/tool/ninja.yml
Normal file
9
config/pkg/tool/ninja.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
ninja:
|
||||||
|
type: tool
|
||||||
|
artifact:
|
||||||
|
binary:
|
||||||
|
windows-x86_64: { type: url, url: 'https://github.com/ninja-build/ninja/releases/download/v1.13.2/ninja-win.zip', extract: { ninja.exe: '{pkg_root_path}/bin/ninja.exe' } }
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- ninja.exe
|
||||||
|
binary-subdir: bin
|
||||||
13
config/pkg/tool/pkg-config.yml
Normal file
13
config/pkg/tool/pkg-config.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
pkg-config:
|
||||||
|
type: tool
|
||||||
|
artifact:
|
||||||
|
source: 'https://dl.static-php.dev/static-php-cli/deps/pkg-config/pkg-config-0.29.2.tar.gz'
|
||||||
|
binary:
|
||||||
|
linux-x86_64: { type: ghrel, repo: static-php/hosted, match: pkg-config-x86_64-linux-musl-1.2.5.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } }
|
||||||
|
linux-aarch64: { type: ghrel, repo: static-php/hosted, match: pkg-config-aarch64-linux-musl-1.2.5.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } }
|
||||||
|
macos-x86_64: { type: ghrel, repo: static-php/hosted, match: pkg-config-x86_64-darwin.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } }
|
||||||
|
macos-aarch64: { type: ghrel, repo: static-php/hosted, match: pkg-config-aarch64-darwin.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } }
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- pkg-config
|
||||||
|
binary-subdir: bin
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
protoc:
|
protoc:
|
||||||
type: target
|
type: tool
|
||||||
artifact:
|
artifact:
|
||||||
binary:
|
binary:
|
||||||
linux-x86_64: { type: ghrel, repo: protocolbuffers/protobuf, match: 'protoc-([0-9.]+)-linux-x86_64\.zip', extract: '{pkg_root_path}/protoc' }
|
linux-x86_64: { type: ghrel, repo: protocolbuffers/protobuf, match: 'protoc-([0-9.]+)-linux-x86_64\.zip', extract: '{pkg_root_path}/protoc' }
|
||||||
linux-aarch64: { type: ghrel, repo: protocolbuffers/protobuf, match: 'protoc-([0-9.]+)-linux-aarch_64\.zip', extract: '{pkg_root_path}/protoc' }
|
linux-aarch64: { type: ghrel, repo: protocolbuffers/protobuf, match: 'protoc-([0-9.]+)-linux-aarch_64\.zip', extract: '{pkg_root_path}/protoc' }
|
||||||
path:
|
path:
|
||||||
- '{pkg_root_path}/protoc/bin'
|
- '{pkg_root_path}/protoc/bin'
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- protoc
|
||||||
|
binary-subdir: protoc/bin
|
||||||
8
config/pkg/tool/python-win.yml
Normal file
8
config/pkg/tool/python-win.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
python-win:
|
||||||
|
type: tool
|
||||||
|
artifact:
|
||||||
|
binary: custom
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- python.exe
|
||||||
|
binary-subdir: python-win/tools
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
strawberry-perl:
|
strawberry-perl:
|
||||||
type: target
|
type: tool
|
||||||
artifact:
|
artifact:
|
||||||
binary:
|
binary:
|
||||||
windows-x86_64: { type: url, url: 'https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_5380_5361/strawberry-perl-5.38.0.1-64bit-portable.zip', extract: '{pkg_root_path}/strawberry-perl' }
|
windows-x86_64: { type: url, url: 'https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_5380_5361/strawberry-perl-5.38.0.1-64bit-portable.zip', extract: '{pkg_root_path}/strawberry-perl' }
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- perl.exe
|
||||||
|
binary-subdir: strawberry-perl/perl/bin
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
upx:
|
upx:
|
||||||
type: target
|
type: tool
|
||||||
artifact:
|
artifact:
|
||||||
binary:
|
binary:
|
||||||
linux-x86_64: { type: ghrel, repo: upx/upx, match: upx.+-amd64_linux\.tar\.xz, extract: { upx: '{pkg_root_path}/bin/upx' } }
|
linux-x86_64: { type: ghrel, repo: upx/upx, match: upx.+-amd64_linux\.tar\.xz, extract: { upx: '{pkg_root_path}/bin/upx' } }
|
||||||
linux-aarch64: { type: ghrel, repo: upx/upx, match: upx.+-arm64_linux\.tar\.xz, extract: { upx: '{pkg_root_path}/bin/upx' } }
|
linux-aarch64: { type: ghrel, repo: upx/upx, match: upx.+-arm64_linux\.tar\.xz, extract: { upx: '{pkg_root_path}/bin/upx' } }
|
||||||
windows-x86_64: { type: ghrel, repo: upx/upx, match: upx.+-win64\.zip, extract: { upx.exe: '{pkg_root_path}/bin/upx.exe' } }
|
windows-x86_64: { type: ghrel, repo: upx/upx, match: upx.+-win64\.zip, extract: { upx.exe: '{pkg_root_path}/bin/upx.exe' } }
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- upx
|
||||||
|
provides@windows:
|
||||||
|
- upx.exe
|
||||||
|
binary-subdir: bin
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
vswhere:
|
vswhere:
|
||||||
type: target
|
type: tool
|
||||||
artifact:
|
artifact:
|
||||||
binary:
|
binary:
|
||||||
windows-x86_64: { type: url, url: 'https://github.com/microsoft/vswhere/releases/download/3.1.7/vswhere.exe', extract: '{pkg_root_path}/bin/vswhere.exe' }
|
windows-x86_64: { type: url, url: 'https://github.com/microsoft/vswhere/releases/download/3.1.7/vswhere.exe', extract: '{pkg_root_path}/bin/vswhere.exe' }
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- vswhere.exe
|
||||||
|
binary-subdir: bin
|
||||||
12
config/pkg/tool/winflexbison.yml
Normal file
12
config/pkg/tool/winflexbison.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
winflexbison:
|
||||||
|
type: tool
|
||||||
|
artifact:
|
||||||
|
binary:
|
||||||
|
windows-x86_64: { type: url, url: 'https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip', extract: '{pkg_root_path}/winflexbison' }
|
||||||
|
path@windows:
|
||||||
|
- '{pkg_root_path}\winflexbison'
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- win_flex.exe
|
||||||
|
- win_bison.exe
|
||||||
|
binary-subdir: winflexbison
|
||||||
14
config/pkg/tool/zig.yml
Normal file
14
config/pkg/tool/zig.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
zig:
|
||||||
|
type: tool
|
||||||
|
artifact:
|
||||||
|
binary: custom
|
||||||
|
tool:
|
||||||
|
provides:
|
||||||
|
- zig
|
||||||
|
- zig-cc
|
||||||
|
- zig-c++
|
||||||
|
- zig-ar
|
||||||
|
- zig-ld.lld
|
||||||
|
- zig-ranlib
|
||||||
|
- zig-objcopy
|
||||||
|
binary-subdir: zig
|
||||||
@@ -229,7 +229,7 @@ The following path placeholders are supported in string values of the `path`, `e
|
|||||||
| `{working_dir}` | Working directory (project root) |
|
| `{working_dir}` | Working directory (project root) |
|
||||||
| `{download_path}` | Download cache directory (`downloads/`) |
|
| `{download_path}` | Download cache directory (`downloads/`) |
|
||||||
| `{source_path}` | Extracted source directory (`source/`) |
|
| `{source_path}` | Extracted source directory (`source/`) |
|
||||||
| `{php_sdk_path}` | Windows PHP SDK directory |
|
| `{spc_msys2_path}` | MSYS2 root directory (`msys64/`) — Windows only |
|
||||||
|
|
||||||
## target Package Type
|
## target Package Type
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Build your CLI with [symfony/console](https://symfony.com/doc/current/components
|
|||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
||||||
Join our [Discord server](https://discord.gg/nrSRbpMJ) to ask questions, share your builds, and connect with other StaticPHP users.
|
Join our [Discord server](https://discord.gg/xf6Rd4pEAk) to ask questions, share your builds, and connect with other StaticPHP users.
|
||||||
|
|
||||||
## Next steps
|
## Next steps
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,13 @@ A single-file hook API for lightweight patches may be provided in a future relea
|
|||||||
|
|
||||||
### Windows-only: `--with-sdk-binary-dir` and `--vs-ver`
|
### Windows-only: `--with-sdk-binary-dir` and `--vs-ver`
|
||||||
|
|
||||||
These options are no longer accepted on the command line. Instead, set the `PHP_SDK_PATH` environment variable to point to your PHP SDK binary tools directory. The Visual Studio version is now managed by the toolchain configuration.
|
These options are no longer accepted on the command line. In v3, the `php-sdk-binary-tools` dependency has been completely removed. v3 now manages its own **MSYS2** environment to support autotools-based library builds on Windows. Run `spc doctor --install` to download and configure MSYS2 automatically.
|
||||||
|
|
||||||
|
If you need to point to a custom MSYS2 installation, set the `SPC_MSYS2_PATH` environment variable to the `msys64` directory (e.g. `C:\msys64`). Visual Studio is now auto-detected by the toolchain — no manual version flag needed.
|
||||||
|
|
||||||
|
::: warning Migrating from v2
|
||||||
|
v2 relied on `php-sdk-binary-tools` and required `--with-sdk-binary-dir` and `--vs-ver` on every build invocation. In v3 these options are gone. Remove them from all CI scripts and run `spc doctor --install` once to set up the Windows build environment.
|
||||||
|
:::
|
||||||
|
|
||||||
## Renamed / Deprecated Options
|
## Renamed / Deprecated Options
|
||||||
|
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ openssl:
|
|||||||
| `{working_dir}` | 工作目录(项目根目录) |
|
| `{working_dir}` | 工作目录(项目根目录) |
|
||||||
| `{download_path}` | 下载缓存目录(`downloads/`) |
|
| `{download_path}` | 下载缓存目录(`downloads/`) |
|
||||||
| `{source_path}` | 解压源码目录(`source/`) |
|
| `{source_path}` | 解压源码目录(`source/`) |
|
||||||
| `{php_sdk_path}` | Windows PHP SDK 目录 |
|
| `{spc_msys2_path}` | MSYS2 根目录(`msys64/`)——仅 Windows |
|
||||||
|
|
||||||
## target 包类型
|
## target 包类型
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ StaticPHP 支持将 FrankenPHP 连同所需扩展一起静态编译,
|
|||||||
|
|
||||||
## 社区
|
## 社区
|
||||||
|
|
||||||
加入我们的 [Discord 服务器](https://discord.gg/nrSRbpMJ),提问、分享构建成果,与其他 StaticPHP 用户交流。
|
加入我们的 [Discord 服务器](https://discord.gg/xf6Rd4pEAk),提问、分享构建成果,与其他 StaticPHP 用户交流。
|
||||||
|
|
||||||
## 接下来
|
## 接下来
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,13 @@ curl -o spc https://dl.static-php.dev/v3/spc-bin/nightly/spc-linux-x86_64
|
|||||||
|
|
||||||
### Windows 专有:`--with-sdk-binary-dir` 和 `--vs-ver`
|
### Windows 专有:`--with-sdk-binary-dir` 和 `--vs-ver`
|
||||||
|
|
||||||
这两个选项已不再被命令行接受。请改为设置 `PHP_SDK_PATH` 环境变量,指向你的 PHP SDK binary tools 目录。Visual Studio 版本现在由工具链配置统一管理。
|
这两个选项已不再被命令行接受。在 v3 中,`php-sdk-binary-tools` 依赖已被完全移除。v3 现在通过管理自己的 **MSYS2** 环境来支持 Windows 上基于 autotools 的库构建。运行 `spc doctor --install` 即可自动下载并配置 MSYS2。
|
||||||
|
|
||||||
|
如需指向自定义 MSYS2 安装目录,请设置 `SPC_MSYS2_PATH` 环境变量,值为 `msys64` 目录路径(例如 `C:\msys64`)。Visual Studio 版本现在由工具链自动检测,无需手动指定版本号。
|
||||||
|
|
||||||
|
::: warning 从 v2 迁移
|
||||||
|
v2 依赖 `php-sdk-binary-tools`,并在每次构建时需要传入 `--with-sdk-binary-dir` 和 `--vs-ver` 参数。在 v3 中这些选项已被移除。请从所有 CI 脚本中删除这些参数,并使用 `spc doctor --install` 一次性完成 Windows 构建环境的配置。
|
||||||
|
:::
|
||||||
|
|
||||||
## 已重命名 / 已弃用的选项
|
## 已重命名 / 已弃用的选项
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
parameters:
|
parameters:
|
||||||
reportUnmatchedIgnoredErrors: false
|
reportUnmatchedIgnoredErrors: false
|
||||||
level: 4
|
level: 5
|
||||||
phpVersion: 80400
|
phpVersion: 80400
|
||||||
paths:
|
paths:
|
||||||
- ./src/
|
- ./src/
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ package:
|
|||||||
- config/pkg/lib/
|
- config/pkg/lib/
|
||||||
- config/pkg/target/
|
- config/pkg/target/
|
||||||
- config/pkg/ext/
|
- config/pkg/ext/
|
||||||
|
- config/pkg/tool/
|
||||||
artifact:
|
artifact:
|
||||||
config:
|
config:
|
||||||
- config/artifact/
|
- config/artifact/
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ class go_win
|
|||||||
])]
|
])]
|
||||||
public function downBinary(ArtifactDownloader $downloader): DownloadResult
|
public function downBinary(ArtifactDownloader $downloader): DownloadResult
|
||||||
{
|
{
|
||||||
$pkgroot = PKG_ROOT_PATH;
|
|
||||||
|
|
||||||
// get version
|
// get version
|
||||||
[$version] = explode("\n", default_shell()->executeCurl('https://go.dev/VERSION?m=text', retries: $downloader->getRetry()) ?: '');
|
[$version] = explode("\n", default_shell()->executeCurl('https://go.dev/VERSION?m=text', retries: $downloader->getRetry()) ?: '');
|
||||||
if ($version === '') {
|
if ($version === '') {
|
||||||
@@ -52,7 +50,7 @@ class go_win
|
|||||||
throw new DownloaderException("Hash mismatch for downloaded go-win binary. Expected {$hash}, got {$file_hash}");
|
throw new DownloaderException("Hash mismatch for downloaded go-win binary. Expected {$hash}, got {$file_hash}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return DownloadResult::archive(basename($path), ['url' => $url, 'version' => $version], extract: "{$pkgroot}/go-win", verified: true, version: $version);
|
return DownloadResult::archive(basename($path), ['url' => $url, 'version' => $version], extract: '{pkg_root_path}/go-win', verified: true, version: $version);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[CustomBinaryCheckUpdate('go-win', ['windows-x86_64'])]
|
#[CustomBinaryCheckUpdate('go-win', ['windows-x86_64'])]
|
||||||
|
|||||||
48
src/Package/Artifact/meson_win.php
Normal file
48
src/Package/Artifact/meson_win.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Artifact;
|
||||||
|
|
||||||
|
use StaticPHP\Attribute\Artifact\AfterBinaryExtract;
|
||||||
|
use StaticPHP\Exception\EnvironmentException;
|
||||||
|
use StaticPHP\Util\FileSystem;
|
||||||
|
|
||||||
|
class meson_win
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Meson 1.11 dropped the Windows MSI, so the artifact is the wheel, installed offline
|
||||||
|
* into a private venv. The venv is not just packaging hygiene: pip generates a real
|
||||||
|
* meson.exe launcher there, and PostgreSQL needs one because its build re-invokes meson
|
||||||
|
* through find_program(), which rejects non-executables like the meson.pyz zipapp.
|
||||||
|
*/
|
||||||
|
#[AfterBinaryExtract('meson', ['windows-x86_64'])]
|
||||||
|
public function afterExtract(string $target_path): void
|
||||||
|
{
|
||||||
|
$dir = dirname($target_path);
|
||||||
|
$venv = "{$dir}\\venv";
|
||||||
|
|
||||||
|
// Prefer the python-win tool package (installed alongside via tools@windows),
|
||||||
|
// fall back to whatever Python the machine already has.
|
||||||
|
$candidates = ['"' . PKG_ROOT_PATH . '\python-win\tools\python.exe"', 'python', 'py -3'];
|
||||||
|
$python = null;
|
||||||
|
foreach ($candidates as $candidate) {
|
||||||
|
[$code] = cmd()->execWithResult("{$candidate} --version", false);
|
||||||
|
if ($code === 0) {
|
||||||
|
$python = $candidate;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($python === null) {
|
||||||
|
throw new EnvironmentException('meson needs Python 3; the python-win tool package did not install and no system Python was found.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_dir($venv)) {
|
||||||
|
FileSystem::removeDir($venv);
|
||||||
|
}
|
||||||
|
cmd()->exec("{$python} -m venv \"{$venv}\"")
|
||||||
|
->exec("\"{$venv}\\Scripts\\python.exe\" -m pip install --no-index --no-deps \"{$target_path}\"");
|
||||||
|
|
||||||
|
FileSystem::writeFile("{$dir}\\meson.bat", "@echo off\r\n\"%~dp0venv\\Scripts\\meson.exe\" %*\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
93
src/Package/Artifact/msys2_build_essentials.php
Normal file
93
src/Package/Artifact/msys2_build_essentials.php
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Artifact;
|
||||||
|
|
||||||
|
use StaticPHP\Artifact\ArtifactDownloader;
|
||||||
|
use StaticPHP\Artifact\Downloader\DownloadResult;
|
||||||
|
use StaticPHP\Attribute\Artifact\AfterBinaryExtract;
|
||||||
|
use StaticPHP\Attribute\Artifact\BinaryExtract;
|
||||||
|
use StaticPHP\Attribute\Artifact\CustomBinary;
|
||||||
|
use StaticPHP\Exception\DownloaderException;
|
||||||
|
use StaticPHP\Util\FileSystem;
|
||||||
|
use StaticPHP\Util\GlobalEnvManager;
|
||||||
|
|
||||||
|
class msys2_build_essentials
|
||||||
|
{
|
||||||
|
// MSYS subsystem packages required for autotools-based builds.
|
||||||
|
private const REQUIRED_PACKAGES = ['make', 'autoconf', 'automake', 'libtool', 'pkgconf', 'perl', 'bison', 're2c'];
|
||||||
|
|
||||||
|
#[CustomBinary('msys2-build-essentials', ['windows-x86_64'])]
|
||||||
|
public function downBinary(ArtifactDownloader $downloader): DownloadResult
|
||||||
|
{
|
||||||
|
// MSYS2 nightly self-extracting archive; running it with `-y -oTARGET` extracts to TARGET\msys64\.
|
||||||
|
$url = 'https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe';
|
||||||
|
$filename = 'msys2-base-x86_64-latest.sfx.exe';
|
||||||
|
$path = DOWNLOAD_PATH . DIRECTORY_SEPARATOR . $filename;
|
||||||
|
|
||||||
|
default_shell()->executeCurlDownload($url, $path, retries: $downloader->getRetry());
|
||||||
|
|
||||||
|
return DownloadResult::file(
|
||||||
|
$filename,
|
||||||
|
['url' => $url, 'version' => 'nightly'],
|
||||||
|
version: 'nightly',
|
||||||
|
extract: '{pkg_root_path}/msys2-build-essentials',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[BinaryExtract('msys2-build-essentials', ['windows-x86_64'])]
|
||||||
|
public function extractBinary(string $source_file, string $target_path): void
|
||||||
|
{
|
||||||
|
$target_path = FileSystem::convertPath($target_path);
|
||||||
|
$source_file = FileSystem::convertPath($source_file);
|
||||||
|
|
||||||
|
// Guard: skip re-extraction if already initialized (marker written at end of this method).
|
||||||
|
$marker = "{$target_path}\\.spc-msys2-initialized";
|
||||||
|
if (file_exists($marker)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_dir($target_path)) {
|
||||||
|
FileSystem::createDir($target_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd()->exec("\"{$source_file}\" -y -o\"{$target_path}\"");
|
||||||
|
|
||||||
|
$msys2_bin = "{$target_path}\\msys64\\usr\\bin";
|
||||||
|
if (!file_exists("{$msys2_bin}\\bash.exe")) {
|
||||||
|
throw new DownloaderException("MSYS2 extraction failed: bash.exe not found at {$msys2_bin}\\bash.exe");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add MSYS2 usr\bin to PATH so pacman.exe can load msys-2.0.dll.
|
||||||
|
GlobalEnvManager::addPathIfNotExists($msys2_bin);
|
||||||
|
GlobalEnvManager::putenv('CHERE_INVOKING=yes');
|
||||||
|
GlobalEnvManager::putenv('MSYSTEM=MSYS');
|
||||||
|
|
||||||
|
// Disable PGP signature checking: pacman-key --init requires a pseudo-TTY which is unavailable
|
||||||
|
// from PHP. Patching pacman.conf is the standard approach for CI pipelines.
|
||||||
|
$pacman_conf = "{$target_path}\\msys64\\etc\\pacman.conf";
|
||||||
|
FileSystem::replaceFileRegex($pacman_conf, '/^SigLevel\s*=.*$/m', 'SigLevel = Never');
|
||||||
|
|
||||||
|
$pacman = "{$target_path}\\msys64\\usr\\bin\\pacman.exe";
|
||||||
|
|
||||||
|
// Two-pass update as recommended by MSYS2 CI docs.
|
||||||
|
cmd()->exec("\"{$pacman}\" --noconfirm -Syuu");
|
||||||
|
cmd()->exec("\"{$pacman}\" --noconfirm -Syuu");
|
||||||
|
|
||||||
|
$pkgs = implode(' ', self::REQUIRED_PACKAGES);
|
||||||
|
cmd()->exec("\"{$pacman}\" --noconfirm -S --needed {$pkgs}");
|
||||||
|
|
||||||
|
FileSystem::writeFile($marker, date('Y-m-d H:i:s'));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[AfterBinaryExtract('msys2-build-essentials', ['windows-x86_64'])]
|
||||||
|
public function afterExtract(string $target_path): void
|
||||||
|
{
|
||||||
|
$target_path = FileSystem::convertPath($target_path);
|
||||||
|
$msys2_root = "{$target_path}\\msys64";
|
||||||
|
|
||||||
|
GlobalEnvManager::putenv("SPC_MSYS2_PATH={$msys2_root}");
|
||||||
|
GlobalEnvManager::addPathIfNotExists("{$msys2_root}\\usr\\bin");
|
||||||
|
}
|
||||||
|
}
|
||||||
66
src/Package/Artifact/python_win.php
Normal file
66
src/Package/Artifact/python_win.php
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Artifact;
|
||||||
|
|
||||||
|
use StaticPHP\Artifact\ArtifactDownloader;
|
||||||
|
use StaticPHP\Artifact\Downloader\DownloadResult;
|
||||||
|
use StaticPHP\Artifact\Downloader\Type\CheckUpdateResult;
|
||||||
|
use StaticPHP\Attribute\Artifact\AfterBinaryExtract;
|
||||||
|
use StaticPHP\Attribute\Artifact\CustomBinary;
|
||||||
|
use StaticPHP\Attribute\Artifact\CustomBinaryCheckUpdate;
|
||||||
|
use StaticPHP\Exception\DownloaderException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Full CPython for Windows from the official python.org nuget package. It is a plain zip
|
||||||
|
* (python.exe plus stdlib under tools/, venv and ensurepip included), so it installs into
|
||||||
|
* the pkgroot without touching the system. Used by the meson tool package.
|
||||||
|
*/
|
||||||
|
class python_win
|
||||||
|
{
|
||||||
|
#[CustomBinary('python-win', [
|
||||||
|
'windows-x86_64',
|
||||||
|
])]
|
||||||
|
public function downBinary(ArtifactDownloader $downloader): DownloadResult
|
||||||
|
{
|
||||||
|
$version = $this->getLatestVersion($downloader->getRetry());
|
||||||
|
|
||||||
|
$url = "https://api.nuget.org/v3-flatcontainer/python/{$version}/python.{$version}.nupkg";
|
||||||
|
// .nupkg is a zip; name the cache file .zip so the extractor treats it as one
|
||||||
|
$path = DOWNLOAD_PATH . DIRECTORY_SEPARATOR . "python-win-{$version}.zip";
|
||||||
|
default_shell()->executeCurlDownload($url, $path, retries: $downloader->getRetry());
|
||||||
|
|
||||||
|
return DownloadResult::archive(basename($path), ['url' => $url, 'version' => $version], extract: '{pkg_root_path}/python-win', version: $version);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[CustomBinaryCheckUpdate('python-win', ['windows-x86_64'])]
|
||||||
|
public function checkUpdateBinary(?string $old_version): CheckUpdateResult
|
||||||
|
{
|
||||||
|
$version = $this->getLatestVersion();
|
||||||
|
return new CheckUpdateResult(
|
||||||
|
old: $old_version,
|
||||||
|
new: $version,
|
||||||
|
needUpdate: $old_version === null || $version !== $old_version,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[AfterBinaryExtract('python-win', ['windows-x86_64'])]
|
||||||
|
public function afterExtract(string $target_path): void
|
||||||
|
{
|
||||||
|
if (!file_exists("{$target_path}\\tools\\python.exe")) {
|
||||||
|
throw new DownloaderException("Python installation appears incomplete: python.exe not found at {$target_path}\\tools\\python.exe");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getLatestVersion(int $retries = 0): string
|
||||||
|
{
|
||||||
|
$index = default_shell()->executeCurl('https://api.nuget.org/v3-flatcontainer/python/index.json', retries: $retries);
|
||||||
|
$versions = $index ? (json_decode($index, true)['versions'] ?? []) : [];
|
||||||
|
$stable = array_filter($versions, fn ($v) => preg_match('/^\d+\.\d+\.\d+$/', $v));
|
||||||
|
if ($stable === []) {
|
||||||
|
throw new DownloaderException('Failed to get Python versions from the nuget index');
|
||||||
|
}
|
||||||
|
return end($stable);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,7 +46,7 @@ class rust
|
|||||||
$download_url = "https://static.rust-lang.org/dist/rust-{$latest_version}-{$arch}-unknown-linux-{$distro}.tar.xz";
|
$download_url = "https://static.rust-lang.org/dist/rust-{$latest_version}-{$arch}-unknown-linux-{$distro}.tar.xz";
|
||||||
$path = DOWNLOAD_PATH . DIRECTORY_SEPARATOR . basename($download_url);
|
$path = DOWNLOAD_PATH . DIRECTORY_SEPARATOR . basename($download_url);
|
||||||
default_shell()->executeCurlDownload($download_url, $path, retries: $downloader->getRetry());
|
default_shell()->executeCurlDownload($download_url, $path, retries: $downloader->getRetry());
|
||||||
return DownloadResult::archive(basename($path), ['url' => $download_url, 'version' => $latest_version], extract: PKG_ROOT_PATH . '/rust-install', verified: false, version: $latest_version);
|
return DownloadResult::archive(basename($path), ['url' => $download_url, 'version' => $latest_version], extract: '{pkg_root_path}/rust-install', verified: false, version: $latest_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[CustomBinaryCheckUpdate('rust', [
|
#[CustomBinaryCheckUpdate('rust', [
|
||||||
|
|||||||
@@ -4,29 +4,14 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Package\Extension;
|
namespace Package\Extension;
|
||||||
|
|
||||||
use Package\Target\php;
|
|
||||||
use StaticPHP\Attribute\Package\BeforeStage;
|
|
||||||
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
||||||
use StaticPHP\Attribute\Package\Extension;
|
use StaticPHP\Attribute\Package\Extension;
|
||||||
use StaticPHP\Attribute\PatchDescription;
|
|
||||||
use StaticPHP\Package\PackageInstaller;
|
use StaticPHP\Package\PackageInstaller;
|
||||||
use StaticPHP\Package\PhpExtensionPackage;
|
use StaticPHP\Package\PhpExtensionPackage;
|
||||||
use StaticPHP\Util\FileSystem;
|
|
||||||
|
|
||||||
#[Extension('clickhouse')]
|
#[Extension('clickhouse')]
|
||||||
class clickhouse extends PhpExtensionPackage
|
class clickhouse extends PhpExtensionPackage
|
||||||
{
|
{
|
||||||
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-clickhouse')]
|
|
||||||
#[PatchDescription('Replace THIS_DIR=`dirname $0` with PHP_EXT_SRCDIR() in config.m4 so include paths resolve to the ext source dir during PHP main configure (dirname $0 returns "." when run from php-src root).')]
|
|
||||||
public function patchBeforeBuildconfUnix(): void
|
|
||||||
{
|
|
||||||
FileSystem::replaceFileRegex(
|
|
||||||
"{$this->getSourceDir()}/config.m4",
|
|
||||||
'/^(\s*)THIS_DIR=.*/m',
|
|
||||||
'$1THIS_DIR=PHP_EXT_SRCDIR()',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[CustomPhpConfigureArg('Darwin')]
|
#[CustomPhpConfigureArg('Darwin')]
|
||||||
#[CustomPhpConfigureArg('Linux')]
|
#[CustomPhpConfigureArg('Linux')]
|
||||||
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
|
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class curl
|
|||||||
// which requires secur32.lib for SSL/TLS functions (SslEncryptPackage, etc.).
|
// which requires secur32.lib for SSL/TLS functions (SslEncryptPackage, etc.).
|
||||||
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
|
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
|
||||||
if (!str_contains($extra_libs, 'secur32.lib')) {
|
if (!str_contains($extra_libs, 'secur32.lib')) {
|
||||||
putenv('SPC_EXTRA_LIBS=' . trim($extra_libs . ' secur32.lib'));
|
putenv('SPC_EXTRA_LIBS=' . trim("{$extra_libs} secur32.lib"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
57
src/Package/Extension/gmssl.php
Normal file
57
src/Package/Extension/gmssl.php
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Extension;
|
||||||
|
|
||||||
|
use Package\Target\php;
|
||||||
|
use StaticPHP\Attribute\Package\BeforeStage;
|
||||||
|
use StaticPHP\Attribute\Package\Extension;
|
||||||
|
use StaticPHP\Attribute\PatchDescription;
|
||||||
|
use StaticPHP\Package\PhpExtensionPackage;
|
||||||
|
use StaticPHP\Util\FileSystem;
|
||||||
|
|
||||||
|
#[Extension('gmssl')]
|
||||||
|
class gmssl extends PhpExtensionPackage
|
||||||
|
{
|
||||||
|
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-gmssl')]
|
||||||
|
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-gmssl')]
|
||||||
|
#[PatchDescription('Fix ext-gmssl v1.1.1 compatibility with GmSSL >= 3.1.0 where SM2_VERIFY_CTX was removed (unified into SM2_SIGN_CTX)')]
|
||||||
|
public function patchSm2VerifyCtx(): void
|
||||||
|
{
|
||||||
|
// See: https://github.com/crazywhalecc/static-php-cli/issues/1182
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
"{$this->getSourceDir()}/gmssl.c",
|
||||||
|
'SM2_VERIFY_CTX',
|
||||||
|
'SM2_SIGN_CTX'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-gmssl')]
|
||||||
|
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-gmssl')]
|
||||||
|
#[PatchDescription('Fix ext-gmssl v1.1.1: pbkdf2_hmac_sm3_genkey was renamed to sm3_pbkdf2 in GmSSL >= 3.2.0')]
|
||||||
|
public function patchPbkdf2Rename(): void
|
||||||
|
{
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
"{$this->getSourceDir()}/gmssl.c",
|
||||||
|
'pbkdf2_hmac_sm3_genkey',
|
||||||
|
'sm3_pbkdf2'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-gmssl')]
|
||||||
|
#[PatchDescription('Add CHECK_LIB to config.w32 for static Windows builds')]
|
||||||
|
public function patchBeforeBuildconfWin(): bool
|
||||||
|
{
|
||||||
|
$configW32 = "{$this->getSourceDir()}/config.w32";
|
||||||
|
if (str_contains(FileSystem::readFile($configW32), 'CHECK_LIB(')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$configW32,
|
||||||
|
'AC_DEFINE(',
|
||||||
|
'CHECK_LIB("gmssl.lib", "gmssl", PHP_GMSSL);' . PHP_EOL . 'AC_DEFINE('
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,12 +4,17 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Package\Extension;
|
namespace Package\Extension;
|
||||||
|
|
||||||
|
use Package\Target\php;
|
||||||
|
use StaticPHP\Attribute\Package\BeforeStage;
|
||||||
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
||||||
use StaticPHP\Attribute\Package\Extension;
|
use StaticPHP\Attribute\Package\Extension;
|
||||||
|
use StaticPHP\Attribute\PatchDescription;
|
||||||
use StaticPHP\Package\PackageBuilder;
|
use StaticPHP\Package\PackageBuilder;
|
||||||
|
use StaticPHP\Package\PhpExtensionPackage;
|
||||||
|
use StaticPHP\Util\FileSystem;
|
||||||
|
|
||||||
#[Extension('imagick')]
|
#[Extension('imagick')]
|
||||||
class imagick
|
class imagick extends PhpExtensionPackage
|
||||||
{
|
{
|
||||||
#[CustomPhpConfigureArg('Darwin')]
|
#[CustomPhpConfigureArg('Darwin')]
|
||||||
#[CustomPhpConfigureArg('Linux')]
|
#[CustomPhpConfigureArg('Linux')]
|
||||||
@@ -18,4 +23,35 @@ class imagick
|
|||||||
$disable_omp = ' ac_cv_func_omp_pause_resource_all=no';
|
$disable_omp = ' ac_cv_func_omp_pause_resource_all=no';
|
||||||
return '--with-imagick=' . ($shared ? 'shared,' : '') . $builder->getBuildRootPath() . $disable_omp;
|
return '--with-imagick=' . ($shared ? 'shared,' : '') . $builder->getBuildRootPath() . $disable_omp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[CustomPhpConfigureArg('Windows')]
|
||||||
|
public function getWindowsConfigureArg(bool $shared): string
|
||||||
|
{
|
||||||
|
// config.w32 uses PHP_IMAGICK as an extra search path for CORE_RL_*.lib; the static
|
||||||
|
// ImageMagick libs are installed flat in buildroot/lib (headers in buildroot/include/imagemagick).
|
||||||
|
return '--with-imagick=' . BUILD_LIB_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-imagick')]
|
||||||
|
#[PatchDescription('Add the Win32 system libraries the static ImageMagick stack needs')]
|
||||||
|
public function patchConfigW32ForWindows(): void
|
||||||
|
{
|
||||||
|
$config = $this->getSourceDir() . '/config.w32';
|
||||||
|
|
||||||
|
// Idempotency guard (the source dir may be patched in place and reused across builds).
|
||||||
|
if (str_contains(FileSystem::readFile($config), 'LIBS_IMAGICK')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The static ImageMagick stack needs several Win32 system libraries (GDI/GDI+, WIC, urlmon, ...)
|
||||||
|
// that aren't already pulled in by the other extensions. (imagick itself builds as plain C:
|
||||||
|
// ImageMagick is built with a 32-bit channel mask, see imagemagick.php buildWin, so the
|
||||||
|
// MagickCore headers don't require a C++ translation unit.)
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$config,
|
||||||
|
"AC_DEFINE('HAVE_IMAGICK', 1);",
|
||||||
|
'ADD_FLAG("LIBS_IMAGICK", "gdi32.lib gdiplus.lib urlmon.lib msimg32.lib oleaut32.lib windowscodecs.lib iphlpapi.lib");' . "\n\t\t" .
|
||||||
|
"AC_DEFINE('HAVE_IMAGICK', 1);"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,14 @@ use StaticPHP\Util\FileSystem;
|
|||||||
#[Extension('mongodb')]
|
#[Extension('mongodb')]
|
||||||
class mongodb extends PhpExtensionPackage
|
class mongodb extends PhpExtensionPackage
|
||||||
{
|
{
|
||||||
|
#[BeforeStage('php', [php::class, 'configureForUnix'], 'ext-mongodb')]
|
||||||
|
#[PatchDescription('Export PHP_VERSION_ID so mongo-php-driver >= 2.3.3 skips its php-config lookup (in-tree builds have no php-config).')]
|
||||||
|
public function exportPhpVersionIdForUnix(): void
|
||||||
|
{
|
||||||
|
$id = php::getPHPVersionID();
|
||||||
|
f_putenv("PHP_VERSION_ID={$id}");
|
||||||
|
}
|
||||||
|
|
||||||
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-mongodb')]
|
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-mongodb')]
|
||||||
#[PatchDescription('Add /utf-8 flag to CFLAGS_MONGODB for Windows build to fix compilation error on non-English Windows.')]
|
#[PatchDescription('Add /utf-8 flag to CFLAGS_MONGODB for Windows build to fix compilation error on non-English Windows.')]
|
||||||
public function patchBeforeBuild(): void
|
public function patchBeforeBuild(): void
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ class opcache extends PhpExtensionPackage
|
|||||||
) {
|
) {
|
||||||
$opcache_jit = ' --disable-opcache-jit';
|
$opcache_jit = ' --disable-opcache-jit';
|
||||||
}
|
}
|
||||||
return '--enable-opcache' . ($shared ? '=shared' : '') . $opcache_jit;
|
// PHP 8.5+ has opcache built-in
|
||||||
|
if ($phpVersionID < 80500) {
|
||||||
|
return '--enable-opcache' . ($shared ? '=shared' : '') . $opcache_jit;
|
||||||
|
}
|
||||||
|
return trim($opcache_jit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class password_argon2 extends PhpExtensionPackage
|
|||||||
#[CustomPhpConfigureArg('Darwin')]
|
#[CustomPhpConfigureArg('Darwin')]
|
||||||
public function getConfigureArg(PackageInstaller $installer, PackageBuilder $builder): string
|
public function getConfigureArg(PackageInstaller $installer, PackageBuilder $builder): string
|
||||||
{
|
{
|
||||||
if ($installer->getLibraryPackage('openssl') !== null) {
|
if ($installer->getPhpExtensionPackage('openssl')?->isBuildStatic()) {
|
||||||
if (php::getPHPVersionID() >= 80500 || (php::getPHPVersionID() >= 80400 && !$builder->getOption('enable-zts'))) {
|
if (php::getPHPVersionID() >= 80500 || (php::getPHPVersionID() >= 80400 && !$builder->getOption('enable-zts'))) {
|
||||||
return '--without-password-argon2'; // use --with-openssl-argon2 in openssl extension instead
|
return '--without-password-argon2'; // use --with-openssl-argon2 in openssl extension instead
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Package\Extension;
|
|
||||||
|
|
||||||
use Package\Target\php;
|
|
||||||
use StaticPHP\Attribute\Package\BeforeStage;
|
|
||||||
use StaticPHP\Attribute\Package\Extension;
|
|
||||||
use StaticPHP\Package\PackageInstaller;
|
|
||||||
use StaticPHP\Util\FileSystem;
|
|
||||||
|
|
||||||
#[Extension('pdo_sqlite')]
|
|
||||||
class pdo_sqlite
|
|
||||||
{
|
|
||||||
#[BeforeStage('php', [php::class, 'configureForUnix'], 'ext-pdo_sqlite')]
|
|
||||||
public function patchBeforeConfigure(PackageInstaller $installer): void
|
|
||||||
{
|
|
||||||
FileSystem::replaceFileRegex(
|
|
||||||
"{$installer->getTargetPackage('php')->getSourceDir()}/configure",
|
|
||||||
'/sqlite3_column_table_name=yes/',
|
|
||||||
'sqlite3_column_table_name=no'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,11 +5,15 @@ declare(strict_types=1);
|
|||||||
namespace Package\Extension;
|
namespace Package\Extension;
|
||||||
|
|
||||||
use Package\Target\php;
|
use Package\Target\php;
|
||||||
|
use StaticPHP\Attribute\Package\BeforeStage;
|
||||||
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
||||||
use StaticPHP\Attribute\Package\Extension;
|
use StaticPHP\Attribute\Package\Extension;
|
||||||
|
use StaticPHP\Attribute\PatchDescription;
|
||||||
use StaticPHP\Package\PackageBuilder;
|
use StaticPHP\Package\PackageBuilder;
|
||||||
use StaticPHP\Package\PackageInstaller;
|
use StaticPHP\Package\PackageInstaller;
|
||||||
use StaticPHP\Package\PhpExtensionPackage;
|
use StaticPHP\Package\PhpExtensionPackage;
|
||||||
|
use StaticPHP\Package\TargetPackage;
|
||||||
|
use StaticPHP\Util\FileSystem;
|
||||||
use StaticPHP\Util\SPCConfigUtil;
|
use StaticPHP\Util\SPCConfigUtil;
|
||||||
|
|
||||||
#[Extension('pgsql')]
|
#[Extension('pgsql')]
|
||||||
@@ -20,7 +24,7 @@ class pgsql extends PhpExtensionPackage
|
|||||||
public function getUnixConfigureArg(bool $shared, PackageBuilder $builder, PackageInstaller $installer): string
|
public function getUnixConfigureArg(bool $shared, PackageBuilder $builder, PackageInstaller $installer): string
|
||||||
{
|
{
|
||||||
if (php::getPHPVersionID() >= 80400) {
|
if (php::getPHPVersionID() >= 80400) {
|
||||||
$libfiles = new SPCConfigUtil(['libs_only_deps' => true, 'absolute_libs' => true])->getPackageDepsConfig('postgresql', array_keys($installer->getResolvedPackages()), $builder->getOption('with-suggests'))['libs'];
|
$libfiles = new SPCConfigUtil(['libs_only_deps' => true, 'absolute_libs' => true])->getPackageDepsConfig('postgresql', array_keys($installer->getResolvedPackages()))['libs'];
|
||||||
$libfiles = str_replace("{$builder->getLibDir()}/lib", '-l', $libfiles);
|
$libfiles = str_replace("{$builder->getLibDir()}/lib", '-l', $libfiles);
|
||||||
$libfiles = str_replace('.a', '', $libfiles);
|
$libfiles = str_replace('.a', '', $libfiles);
|
||||||
return '--with-pgsql' . ($shared ? '=shared' : '') .
|
return '--with-pgsql' . ($shared ? '=shared' : '') .
|
||||||
@@ -39,6 +43,27 @@ class pgsql extends PhpExtensionPackage
|
|||||||
return "--with-pgsql={$builder->getBuildRootPath()}";
|
return "--with-pgsql={$builder->getBuildRootPath()}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-pgsql')]
|
||||||
|
#[PatchDescription('Link the Win32 system libraries the static libpq needs')]
|
||||||
|
public function patchConfigW32ForWindows(TargetPackage $package): void
|
||||||
|
{
|
||||||
|
$config = "{$package->getSourceDir()}\\ext\\pgsql\\config.w32";
|
||||||
|
|
||||||
|
if (str_contains(FileSystem::readFile($config), 'LIBS_PGSQL')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// libpq uses SSPI for Windows auth (secur32) and the static libcrypto behind it
|
||||||
|
// reads the system cert store (crypt32). Nothing else puts these on the link line
|
||||||
|
// when the openssl extension itself is not part of the build.
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$config,
|
||||||
|
'EXTENSION("pgsql", "pgsql.c", PHP_PGSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");',
|
||||||
|
'EXTENSION("pgsql", "pgsql.c", PHP_PGSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");' . "\n\t\t" .
|
||||||
|
'ADD_FLAG("LIBS_PGSQL", "secur32.lib crypt32.lib");'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function getSharedExtensionEnv(): array
|
public function getSharedExtensionEnv(): array
|
||||||
{
|
{
|
||||||
$parent = parent::getSharedExtensionEnv();
|
$parent = parent::getSharedExtensionEnv();
|
||||||
|
|||||||
@@ -50,8 +50,9 @@ class simdjson extends PhpExtensionPackage
|
|||||||
if (!str_contains((string) $extra, '-lstdc++')) {
|
if (!str_contains((string) $extra, '-lstdc++')) {
|
||||||
f_putenv('SPC_COMPILER_EXTRA=' . clean_spaces($extra . ' -lstdc++'));
|
f_putenv('SPC_COMPILER_EXTRA=' . clean_spaces($extra . ' -lstdc++'));
|
||||||
}
|
}
|
||||||
$env['CFLAGS'] .= ' -Xclang -target-feature -Xclang +evex512';
|
|
||||||
$env['CXXFLAGS'] .= ' -Xclang -target-feature -Xclang +evex512';
|
$env['CFLAGS'] .= ' -fno-sanitize=undefined -Xclang -target-feature -Xclang +evex512';
|
||||||
|
$env['CXXFLAGS'] .= ' -fno-sanitize=undefined -Xclang -target-feature -Xclang +evex512';
|
||||||
}
|
}
|
||||||
return $env;
|
return $env;
|
||||||
}
|
}
|
||||||
@@ -63,8 +64,8 @@ class simdjson extends PhpExtensionPackage
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$extra_cflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') ?: '';
|
$extra_cflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') ?: '';
|
||||||
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . trim($extra_cflags . ' -Xclang -target-feature -Xclang +evex512'));
|
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . trim($extra_cflags . ' -fno-sanitize=undefined -Xclang -target-feature -Xclang +evex512'));
|
||||||
$extra_cxxflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CXXFLAGS') ?: '';
|
$extra_cxxflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CXXFLAGS') ?: '';
|
||||||
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CXXFLAGS=' . trim($extra_cxxflags . ' -Xclang -target-feature -Xclang +evex512'));
|
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CXXFLAGS=' . trim($extra_cxxflags . ' -fno-sanitize=undefined -Xclang -target-feature -Xclang +evex512'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,27 @@ namespace Package\Extension;
|
|||||||
|
|
||||||
use Package\Target\php;
|
use Package\Target\php;
|
||||||
use StaticPHP\Attribute\Package\BeforeStage;
|
use StaticPHP\Attribute\Package\BeforeStage;
|
||||||
|
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
||||||
use StaticPHP\Attribute\Package\Extension;
|
use StaticPHP\Attribute\Package\Extension;
|
||||||
use StaticPHP\Attribute\PatchDescription;
|
use StaticPHP\Attribute\PatchDescription;
|
||||||
|
use StaticPHP\Package\PackageInstaller;
|
||||||
use StaticPHP\Package\PhpExtensionPackage;
|
use StaticPHP\Package\PhpExtensionPackage;
|
||||||
use StaticPHP\Util\FileSystem;
|
use StaticPHP\Util\FileSystem;
|
||||||
|
|
||||||
#[Extension('spx')]
|
#[Extension('spx')]
|
||||||
class spx extends PhpExtensionPackage
|
class spx extends PhpExtensionPackage
|
||||||
{
|
{
|
||||||
|
#[CustomPhpConfigureArg('Linux')]
|
||||||
|
#[CustomPhpConfigureArg('Darwin')]
|
||||||
|
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
|
||||||
|
{
|
||||||
|
$arg = '--enable-SPX' . ($shared ? '=shared' : '');
|
||||||
|
if ($installer->getLibraryPackage('zlib') !== null) {
|
||||||
|
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
||||||
|
}
|
||||||
|
return $arg;
|
||||||
|
}
|
||||||
|
|
||||||
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-spx')]
|
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-spx')]
|
||||||
#[PatchDescription('Fix spx extension compile error when building as static')]
|
#[PatchDescription('Fix spx extension compile error when building as static')]
|
||||||
public function patchBeforeBuildconf(): bool
|
public function patchBeforeBuildconf(): bool
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class swoole extends PhpExtensionPackage
|
|||||||
if ($installer->getPhpExtensionPackage('swoole-hook-odbc') && $installer->getPhpExtensionPackage('pdo_odbc')?->isBuildStatic()) {
|
if ($installer->getPhpExtensionPackage('swoole-hook-odbc') && $installer->getPhpExtensionPackage('pdo_odbc')?->isBuildStatic()) {
|
||||||
throw new WrongUsageException('swoole-hook-odbc provides pdo_odbc, if you enable odbc hook for swoole, you must remove pdo_odbc extension.');
|
throw new WrongUsageException('swoole-hook-odbc provides pdo_odbc, if you enable odbc hook for swoole, you must remove pdo_odbc extension.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// swoole-hook-pgsql conflicts with pdo_pgsql
|
// swoole-hook-pgsql conflicts with pdo_pgsql
|
||||||
if ($installer->getPhpExtensionPackage('swoole-hook-pgsql') && $installer->getPhpExtensionPackage('pdo_pgsql')?->isBuildStatic()) {
|
if ($installer->getPhpExtensionPackage('swoole-hook-pgsql') && $installer->getPhpExtensionPackage('pdo_pgsql')?->isBuildStatic()) {
|
||||||
throw new WrongUsageException('swoole-hook-pgsql provides pdo_pgsql, if you enable pgsql hook for swoole, you must remove pdo_pgsql extension.');
|
throw new WrongUsageException('swoole-hook-pgsql provides pdo_pgsql, if you enable pgsql hook for swoole, you must remove pdo_pgsql extension.');
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use StaticPHP\Attribute\Package\Extension;
|
|||||||
use StaticPHP\Attribute\PatchDescription;
|
use StaticPHP\Attribute\PatchDescription;
|
||||||
use StaticPHP\Package\PackageInstaller;
|
use StaticPHP\Package\PackageInstaller;
|
||||||
use StaticPHP\Package\PhpExtensionPackage;
|
use StaticPHP\Package\PhpExtensionPackage;
|
||||||
use StaticPHP\Util\GlobalEnvManager;
|
use StaticPHP\Util\FileSystem;
|
||||||
use StaticPHP\Util\SourcePatcher;
|
use StaticPHP\Util\SourcePatcher;
|
||||||
|
|
||||||
#[Extension('xlswriter')]
|
#[Extension('xlswriter')]
|
||||||
@@ -21,37 +21,38 @@ class xlswriter extends PhpExtensionPackage
|
|||||||
#[CustomPhpConfigureArg('Linux')]
|
#[CustomPhpConfigureArg('Linux')]
|
||||||
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
|
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
|
||||||
{
|
{
|
||||||
$arg = '--with-xlswriter --enable-reader';
|
$shared = $shared ? '=shared' : '';
|
||||||
|
$arg = "--with-xlswriter{$shared} --enable-reader";
|
||||||
if ($installer->getLibraryPackage('openssl')) {
|
if ($installer->getLibraryPackage('openssl')) {
|
||||||
$arg .= ' --with-openssl=' . $installer->getLibraryPackage('openssl')->getBuildRootPath();
|
$arg .= ' --with-openssl=' . $installer->getLibraryPackage('openssl')->getBuildRootPath();
|
||||||
}
|
}
|
||||||
return $arg;
|
return $arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[BeforeStage('php', [php::class, 'makeForUnix'], 'ext-xlswriter')]
|
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-xlswriter')]
|
||||||
#[PatchDescription('Fix Unix build: add -std=gnu17 to CFLAGS to fix build errors on older GCC versions')]
|
#[PatchDescription('Define XML_STATIC so bundled Expat uses plain symbols instead of __declspec(dllimport) in static builds')]
|
||||||
public function patchBeforeUnixMake(): void
|
public function patchConfigForStaticExpat(): void
|
||||||
{
|
{
|
||||||
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -std=gnu17');
|
FileSystem::replaceFileStr(
|
||||||
|
"{$this->getSourceDir()}/config.w32",
|
||||||
|
"' /D USE_SYSTEM_MINIZIP",
|
||||||
|
"' /D XML_STATIC /D USE_SYSTEM_MINIZIP"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[BeforeStage('php', [php::class, 'makeForWindows'], 'ext-xlswriter')]
|
#[BeforeStage('php', [php::class, 'makeForWindows'], 'ext-xlswriter')]
|
||||||
#[PatchDescription('Fix Windows build: apply win32 patch and add UTF-8 BOM to theme.c')]
|
#[PatchDescription('Fix Windows build: apply win32 patch and add UTF-8 BOM to theme.c')]
|
||||||
public function patchBeforeMakeForWindows(): void
|
public function patchBeforeMakeForWindows(): void
|
||||||
{
|
{
|
||||||
|
$source_dir = $this->getSourceDir();
|
||||||
|
$theme_file = "{$source_dir}/library/libxlsx/src/theme.c";
|
||||||
|
|
||||||
// fix windows build with openssl extension duplicate symbol bug
|
// fix windows build with openssl extension duplicate symbol bug
|
||||||
SourcePatcher::patchFile('spc_fix_xlswriter_win32.patch', $this->getSourceDir());
|
SourcePatcher::patchFile('spc_fix_xlswriter_win32.patch', $source_dir);
|
||||||
$content = file_get_contents($this->getSourceDir() . '/library/libxlsxwriter/src/theme.c');
|
$content = file_get_contents($theme_file);
|
||||||
$bom = pack('CCC', 0xEF, 0xBB, 0xBF);
|
$bom = pack('CCC', 0xEF, 0xBB, 0xBF);
|
||||||
if (!str_starts_with($content, $bom)) {
|
if (!str_starts_with($content, $bom)) {
|
||||||
file_put_contents($this->getSourceDir() . '/library/libxlsxwriter/src/theme.c', $bom . $content);
|
file_put_contents($theme_file, $bom . $content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSharedExtensionEnv(): array
|
|
||||||
{
|
|
||||||
$parent = parent::getSharedExtensionEnv();
|
|
||||||
$parent['CFLAGS'] .= ' -std=gnu17';
|
|
||||||
return $parent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class gettext_win
|
|||||||
{
|
{
|
||||||
$ver = WindowsUtil::findVisualStudio();
|
$ver = WindowsUtil::findVisualStudio();
|
||||||
$vs_ver_dir = match ($ver['major_version']) {
|
$vs_ver_dir = match ($ver['major_version']) {
|
||||||
|
'18', // VS 2026 reuses the VS2022 (MSVC17) solution, which msbuild builds via forward compatibility.
|
||||||
'17' => '\MSVC17',
|
'17' => '\MSVC17',
|
||||||
'16' => '\MSVC16',
|
'16' => '\MSVC16',
|
||||||
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported yet!"),
|
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported yet!"),
|
||||||
@@ -44,7 +45,9 @@ class gettext_win
|
|||||||
{
|
{
|
||||||
$vs_ver_dir = ApplicationContext::get('gettext_win_vs_ver_dir');
|
$vs_ver_dir = ApplicationContext::get('gettext_win_vs_ver_dir');
|
||||||
cmd()->cd("{$lib->getSourceDir()}{$vs_ver_dir}\\libintl_static")
|
cmd()->cd("{$lib->getSourceDir()}{$vs_ver_dir}\\libintl_static")
|
||||||
->exec('msbuild libintl_static.vcxproj /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0');
|
// WholeProgramOptimization (/GL) emits LTCG objects that frankenphp's lld-link cannot
|
||||||
|
// read ("is not a native COFF file"); disable it so the .lib stays plain COFF.
|
||||||
|
->exec('msbuild libintl_static.vcxproj /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0 /p:WholeProgramOptimization=false');
|
||||||
FileSystem::createDir($lib->getLibDir());
|
FileSystem::createDir($lib->getLibDir());
|
||||||
FileSystem::createDir($lib->getIncludeDir());
|
FileSystem::createDir($lib->getIncludeDir());
|
||||||
// libintl_a.lib is the static library output; copy as libintl.lib for linker compatibility
|
// libintl_a.lib is the static library output; copy as libintl.lib for linker compatibility
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ class gmssl
|
|||||||
#[BuildFor('Darwin')]
|
#[BuildFor('Darwin')]
|
||||||
public function build(LibraryPackage $lib): void
|
public function build(LibraryPackage $lib): void
|
||||||
{
|
{
|
||||||
UnixCMakeExecutor::create($lib)->build();
|
UnixCMakeExecutor::create($lib)
|
||||||
|
->addConfigureArgs('-DENABLE_SM2_PRIVATE_KEY_EXPORT=ON')
|
||||||
|
->build();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[BuildFor('Windows')]
|
#[BuildFor('Windows')]
|
||||||
@@ -33,6 +35,7 @@ class gmssl
|
|||||||
'-G "NMake Makefiles"',
|
'-G "NMake Makefiles"',
|
||||||
'-DWIN32=ON',
|
'-DWIN32=ON',
|
||||||
'-DBUILD_SHARED_LIBS=OFF',
|
'-DBUILD_SHARED_LIBS=OFF',
|
||||||
|
'-DENABLE_SM2_PRIVATE_KEY_EXPORT=ON',
|
||||||
'-DCMAKE_BUILD_TYPE=Release',
|
'-DCMAKE_BUILD_TYPE=Release',
|
||||||
'-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG"',
|
'-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG"',
|
||||||
'-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG"',
|
'-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG"',
|
||||||
@@ -42,13 +45,13 @@ class gmssl
|
|||||||
->toStep(1)
|
->toStep(1)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
// fix cmake_install.cmake install prefix (GmSSL overrides it internally)
|
cmd()->cd($buildDir)->exec('nmake gmssl XCFLAGS=/MT');
|
||||||
$installCmake = "{$buildDir}\\cmake_install.cmake";
|
|
||||||
FileSystem::writeFile(
|
|
||||||
$installCmake,
|
|
||||||
'set(CMAKE_INSTALL_PREFIX "' . str_replace('\\', '/', $lib->getBuildRootPath()) . '")' . PHP_EOL . FileSystem::readFile($installCmake)
|
|
||||||
);
|
|
||||||
|
|
||||||
cmd()->cd($buildDir)->exec('nmake install XCFLAGS=/MT');
|
$libPath = "{$lib->getBuildRootPath()}/lib";
|
||||||
|
$incPath = "{$lib->getBuildRootPath()}/include/gmssl";
|
||||||
|
FileSystem::createDir($libPath);
|
||||||
|
FileSystem::createDir($incPath);
|
||||||
|
FileSystem::copy("{$buildDir}\\bin\\gmssl.lib", "{$libPath}/gmssl.lib");
|
||||||
|
FileSystem::copyDir("{$lib->getSourceDir()}\\include\\gmssl", $incPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,86 @@ namespace Package\Library;
|
|||||||
|
|
||||||
use StaticPHP\Attribute\Package\BuildFor;
|
use StaticPHP\Attribute\Package\BuildFor;
|
||||||
use StaticPHP\Attribute\Package\Library;
|
use StaticPHP\Attribute\Package\Library;
|
||||||
|
use StaticPHP\Exception\EnvironmentException;
|
||||||
use StaticPHP\Package\LibraryPackage;
|
use StaticPHP\Package\LibraryPackage;
|
||||||
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
use StaticPHP\Runtime\SystemTarget;
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
use StaticPHP\Toolchain\Interface\ToolchainInterface;
|
use StaticPHP\Toolchain\Interface\ToolchainInterface;
|
||||||
use StaticPHP\Util\FileSystem;
|
use StaticPHP\Util\FileSystem;
|
||||||
|
use StaticPHP\Util\System\WindowsUtil;
|
||||||
|
|
||||||
#[Library('imagemagick')]
|
#[Library('imagemagick')]
|
||||||
class imagemagick
|
class imagemagick
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Build a fully static, self-contained ImageMagick 7 (Q16-HDRI, /MT) on Windows using the
|
||||||
|
* official VisualMagick build (the ImageMagick/Windows + Configure + Dependencies repos), which
|
||||||
|
* bundles every delegate. ImageMagick has no autoconf/CMake build on Windows, so this clones the
|
||||||
|
* VisualMagick tree, generates a static x64 solution via the Configure tool, and builds it with
|
||||||
|
* msbuild. The resulting CORE_RL_*.lib static libraries + MagickWand/MagickCore headers are
|
||||||
|
* installed into the build root for ext-imagick to link.
|
||||||
|
*
|
||||||
|
* A short working directory is used (VisualMagick's tree is deeply nested and otherwise exceeds
|
||||||
|
* MAX_PATH); override with SPC_IMAGEMAGICK_BUILD_DIR.
|
||||||
|
*/
|
||||||
|
#[BuildFor('Windows')]
|
||||||
|
public function buildWin(LibraryPackage $lib): void
|
||||||
|
{
|
||||||
|
$work = getenv('SPC_IMAGEMAGICK_BUILD_DIR') ?: 'C:\im';
|
||||||
|
$configure_release = '2026.05.30.2033';
|
||||||
|
$configure_url = "https://github.com/ImageMagick/Configure/releases/download/{$configure_release}/Configure.Release.x64.exe";
|
||||||
|
|
||||||
|
FileSystem::createDir($work);
|
||||||
|
// Clone the VisualMagick repos (ImageMagick source + Configure + Dependencies + all delegates).
|
||||||
|
if (!is_dir("{$work}\\ImageMagick")) {
|
||||||
|
cmd()->cd($work)->exec(SPC_GIT_EXEC . ' clone --depth 1 https://github.com/ImageMagick/Windows.git .');
|
||||||
|
cmd()->cd($work)->exec('bash clone-repositories.sh --imagemagick7');
|
||||||
|
}
|
||||||
|
// Use the prebuilt Configure tool (building it from source needs the MFC components).
|
||||||
|
default_shell()->executeCurlDownload($configure_url, "{$work}\\Configure\\Configure.Release.x64.exe", retries: 2);
|
||||||
|
|
||||||
|
// Generate a static, /MT (linkRuntime), x64, Q16-HDRI solution with the configs embedded
|
||||||
|
// (zeroConfigurationSupport) and OpenMP off (no vcomp runtime dependency).
|
||||||
|
$ver = WindowsUtil::findVisualStudio();
|
||||||
|
$vs_major = is_array($ver) ? $ver['major_version'] : 'unknown';
|
||||||
|
$vs_arg = match ($vs_major) {
|
||||||
|
'18',
|
||||||
|
'17' => '/VS2022',
|
||||||
|
'16' => '/VS2019',
|
||||||
|
default => throw new EnvironmentException("Current VS version {$vs_major} is not supported yet!"),
|
||||||
|
};
|
||||||
|
cmd()->cd("{$work}\\Configure")
|
||||||
|
->exec("Configure.Release.x64.exe /noWizard {$vs_arg} /x64 /static /linkRuntime /noOpenMP /zeroConfigurationSupport");
|
||||||
|
|
||||||
|
// x64 IM7 defaults to a 64-bit channel mask, whose magick-baseconfig.h #errors unless the
|
||||||
|
// consuming translation unit is C++. ext-imagick is plain C, so force a 32-bit channel mask
|
||||||
|
// (ample: 32 channels >> RGBA/CMYK) before building, keeping libs and the installed header in sync.
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
"{$work}\\ImageMagick\\MagickCore\\magick-baseconfig.h",
|
||||||
|
'#define MAGICKCORE_CHANNEL_MASK_DEPTH 64',
|
||||||
|
'#define MAGICKCORE_CHANNEL_MASK_DEPTH 32'
|
||||||
|
);
|
||||||
|
|
||||||
|
cmd()->cd($work)
|
||||||
|
->exec('msbuild IM7.Static.x64.sln /m /t:Rebuild /nologo /p:Configuration=Release /p:Platform=x64');
|
||||||
|
|
||||||
|
$artifacts = "{$work}\\Artifacts\\lib";
|
||||||
|
if (!is_dir($artifacts)) {
|
||||||
|
throw new EnvironmentException('ImageMagick VisualMagick build produced no Artifacts/lib; build failed.');
|
||||||
|
}
|
||||||
|
// Install the static libs (flat, onto the build-root lib path) and the public headers.
|
||||||
|
FileSystem::createDir($lib->getLibDir());
|
||||||
|
foreach (glob("{$artifacts}\\CORE_RL_*.lib") as $f) {
|
||||||
|
FileSystem::copy($f, $lib->getLibDir() . '\\' . basename($f));
|
||||||
|
}
|
||||||
|
foreach (['MagickWand', 'MagickCore'] as $dir) {
|
||||||
|
FileSystem::createDir($lib->getIncludeDir() . "\\imagemagick\\{$dir}");
|
||||||
|
foreach (glob("{$work}\\ImageMagick\\{$dir}\\*.h") as $h) {
|
||||||
|
FileSystem::copy($h, $lib->getIncludeDir() . "\\imagemagick\\{$dir}\\" . basename($h));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[BuildFor('Darwin')]
|
#[BuildFor('Darwin')]
|
||||||
#[BuildFor('Linux')]
|
#[BuildFor('Linux')]
|
||||||
public function buildUnix(LibraryPackage $lib, ToolchainInterface $toolchain): void
|
public function buildUnix(LibraryPackage $lib, ToolchainInterface $toolchain): void
|
||||||
@@ -42,6 +113,9 @@ class imagemagick
|
|||||||
->addConfigureArgs(
|
->addConfigureArgs(
|
||||||
'--disable-openmp',
|
'--disable-openmp',
|
||||||
'--without-x',
|
'--without-x',
|
||||||
|
// implicit --with-gcc-arch
|
||||||
|
// bleeds host cpu features into built binaries
|
||||||
|
'--without-gcc-arch',
|
||||||
);
|
);
|
||||||
|
|
||||||
// special: linux-static target needs `-static`
|
// special: linux-static target needs `-static`
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class libde265 extends LibraryPackage
|
|||||||
->addConfigureArgs(
|
->addConfigureArgs(
|
||||||
'-DENABLE_SDL=OFF',
|
'-DENABLE_SDL=OFF',
|
||||||
'-DENABLE_DECODER=OFF',
|
'-DENABLE_DECODER=OFF',
|
||||||
|
'-DENABLE_SIMD=OFF',
|
||||||
'-DHAVE_NEON=OFF',
|
'-DHAVE_NEON=OFF',
|
||||||
)
|
)
|
||||||
->build();
|
->build();
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class libffi_win
|
|||||||
{
|
{
|
||||||
$ver = WindowsUtil::findVisualStudio();
|
$ver = WindowsUtil::findVisualStudio();
|
||||||
$vs_ver_dir = match ($ver['major_version']) {
|
$vs_ver_dir = match ($ver['major_version']) {
|
||||||
|
'18', // VS 2026 reuses the vs17 solution, which msbuild builds via forward compatibility.
|
||||||
'17' => '\win32\vs17_x64',
|
'17' => '\win32\vs17_x64',
|
||||||
'16' => '\win32\vs16_x64',
|
'16' => '\win32\vs16_x64',
|
||||||
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported!"),
|
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported!"),
|
||||||
@@ -33,7 +34,9 @@ class libffi_win
|
|||||||
{
|
{
|
||||||
$vs_ver_dir = ApplicationContext::get('libffi_win_vs_ver_dir');
|
$vs_ver_dir = ApplicationContext::get('libffi_win_vs_ver_dir');
|
||||||
cmd()->cd("{$lib->getSourceDir()}{$vs_ver_dir}")
|
cmd()->cd("{$lib->getSourceDir()}{$vs_ver_dir}")
|
||||||
->exec('msbuild libffi-msvc.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64');
|
// WholeProgramOptimization (/GL) emits LTCG objects that frankenphp's lld-link cannot
|
||||||
|
// read ("is not a native COFF file"); disable it so the .lib stays plain COFF.
|
||||||
|
->exec('msbuild libffi-msvc.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:WholeProgramOptimization=false');
|
||||||
FileSystem::createDir($lib->getLibDir());
|
FileSystem::createDir($lib->getLibDir());
|
||||||
FileSystem::createDir($lib->getIncludeDir());
|
FileSystem::createDir($lib->getIncludeDir());
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class libiconv_win
|
|||||||
{
|
{
|
||||||
$ver = WindowsUtil::findVisualStudio();
|
$ver = WindowsUtil::findVisualStudio();
|
||||||
$vs_ver_dir = match ($ver['major_version']) {
|
$vs_ver_dir = match ($ver['major_version']) {
|
||||||
|
'18', // VS 2026 reuses the VS2022 (MSVC17) solution, which msbuild builds via forward compatibility.
|
||||||
'17' => '\MSVC17',
|
'17' => '\MSVC17',
|
||||||
'16' => '\MSVC16',
|
'16' => '\MSVC16',
|
||||||
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported yet!"),
|
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported yet!"),
|
||||||
@@ -33,7 +34,9 @@ class libiconv_win
|
|||||||
{
|
{
|
||||||
$vs_ver_dir = ApplicationContext::get('vs_ver_dir');
|
$vs_ver_dir = ApplicationContext::get('vs_ver_dir');
|
||||||
cmd()->cd("{$lib->getSourceDir()}{$vs_ver_dir}")
|
cmd()->cd("{$lib->getSourceDir()}{$vs_ver_dir}")
|
||||||
->exec('msbuild libiconv.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64');
|
// WholeProgramOptimization (/GL) emits LTCG objects that frankenphp's lld-link cannot
|
||||||
|
// read ("is not a native COFF file"); disable it so the .lib stays plain COFF.
|
||||||
|
->exec('msbuild libiconv.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:WholeProgramOptimization=false');
|
||||||
FileSystem::createDir($lib->getLibDir());
|
FileSystem::createDir($lib->getLibDir());
|
||||||
FileSystem::createDir($lib->getIncludeDir());
|
FileSystem::createDir($lib->getIncludeDir());
|
||||||
FileSystem::copy("{$lib->getSourceDir()}{$vs_ver_dir}\\x64\\lib\\libiconv.lib", "{$lib->getLibDir()}\\libiconv.lib");
|
FileSystem::copy("{$lib->getSourceDir()}{$vs_ver_dir}\\x64\\lib\\libiconv.lib", "{$lib->getLibDir()}\\libiconv.lib");
|
||||||
|
|||||||
@@ -42,13 +42,16 @@ class libsodium
|
|||||||
{
|
{
|
||||||
$ver = WindowsUtil::findVisualStudio();
|
$ver = WindowsUtil::findVisualStudio();
|
||||||
$vs_ver_dir = match ($ver['major_version']) {
|
$vs_ver_dir = match ($ver['major_version']) {
|
||||||
|
'18', // VS 2026 reuses the vs2022 solution, which msbuild builds via forward compatibility.
|
||||||
'17' => '\vs2022',
|
'17' => '\vs2022',
|
||||||
'16' => '\vs2019',
|
'16' => '\vs2019',
|
||||||
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported yet!"),
|
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported yet!"),
|
||||||
};
|
};
|
||||||
|
|
||||||
cmd()->cd("{$lib->getSourceDir()}\\builds\\msvc{$vs_ver_dir}")
|
cmd()->cd("{$lib->getSourceDir()}\\builds\\msvc{$vs_ver_dir}")
|
||||||
->exec('msbuild libsodium.sln /t:Rebuild /p:Configuration=StaticRelease /p:Platform=x64 /p:PreprocessorDefinitions="SODIUM_STATIC=1"');
|
// WholeProgramOptimization (/GL) emits LTCG objects that frankenphp's lld-link cannot
|
||||||
|
// read ("is not a native COFF file"); disable it so the .lib stays plain COFF.
|
||||||
|
->exec('msbuild libsodium.sln /t:Rebuild /p:Configuration=StaticRelease /p:Platform=x64 /p:WholeProgramOptimization=false /p:PreprocessorDefinitions="SODIUM_STATIC=1"');
|
||||||
FileSystem::createDir($lib->getLibDir());
|
FileSystem::createDir($lib->getLibDir());
|
||||||
FileSystem::createDir($lib->getIncludeDir());
|
FileSystem::createDir($lib->getIncludeDir());
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class libssh2
|
|||||||
{
|
{
|
||||||
WindowsCMakeExecutor::create($lib)
|
WindowsCMakeExecutor::create($lib)
|
||||||
->addConfigureArgs(
|
->addConfigureArgs(
|
||||||
|
'-DCRYPTO_BACKEND=WinCNG',
|
||||||
'-DENABLE_ZLIB_COMPRESSION=ON',
|
'-DENABLE_ZLIB_COMPRESSION=ON',
|
||||||
'-DBUILD_TESTING=OFF'
|
'-DBUILD_TESTING=OFF'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class mpir
|
|||||||
{
|
{
|
||||||
$ver = WindowsUtil::findVisualStudio();
|
$ver = WindowsUtil::findVisualStudio();
|
||||||
$vs_ver_dir = match ($ver['major_version']) {
|
$vs_ver_dir = match ($ver['major_version']) {
|
||||||
|
'18', // VS 2026 reuses the build.vc17 solution, which msbuild builds via forward compatibility.
|
||||||
'17' => '\build.vc17',
|
'17' => '\build.vc17',
|
||||||
'16' => '\build.vc16',
|
'16' => '\build.vc16',
|
||||||
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported yet!"),
|
default => throw new EnvironmentException("Current VS version {$ver['major_version']} is not supported yet!"),
|
||||||
|
|||||||
@@ -6,43 +6,24 @@ namespace Package\Library;
|
|||||||
|
|
||||||
use StaticPHP\Attribute\Package\BuildFor;
|
use StaticPHP\Attribute\Package\BuildFor;
|
||||||
use StaticPHP\Attribute\Package\Library;
|
use StaticPHP\Attribute\Package\Library;
|
||||||
use StaticPHP\Attribute\Package\Validate;
|
|
||||||
use StaticPHP\DI\ApplicationContext;
|
|
||||||
use StaticPHP\Exception\EnvironmentException;
|
use StaticPHP\Exception\EnvironmentException;
|
||||||
use StaticPHP\Package\LibraryPackage;
|
use StaticPHP\Package\LibraryPackage;
|
||||||
use StaticPHP\Package\PackageBuilder;
|
use StaticPHP\Package\PackageBuilder;
|
||||||
use StaticPHP\Runtime\SystemTarget;
|
use StaticPHP\Package\ToolPackage;
|
||||||
|
use StaticPHP\Registry\PackageLoader;
|
||||||
use StaticPHP\Util\FileSystem;
|
use StaticPHP\Util\FileSystem;
|
||||||
use StaticPHP\Util\System\LinuxUtil;
|
use StaticPHP\Util\System\LinuxUtil;
|
||||||
use StaticPHP\Util\System\WindowsUtil;
|
|
||||||
|
|
||||||
#[Library('openssl')]
|
#[Library('openssl')]
|
||||||
class openssl
|
class openssl
|
||||||
{
|
{
|
||||||
#[Validate]
|
|
||||||
public function validate(): void
|
|
||||||
{
|
|
||||||
if (SystemTarget::getTargetOS() === 'Windows') {
|
|
||||||
global $argv;
|
|
||||||
$perl_path_native = PKG_ROOT_PATH . '\strawberry-perl-' . arch2gnu(php_uname('m')) . '-win\perl\bin\perl.exe';
|
|
||||||
$perl = file_exists($perl_path_native) ? ($perl_path_native) : WindowsUtil::findCommand('perl.exe');
|
|
||||||
if ($perl === null) {
|
|
||||||
throw new EnvironmentException(
|
|
||||||
'You need to install perl first!',
|
|
||||||
"Please run \"{$argv[0]} doctor\" to fix the environment.",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
ApplicationContext::set('perl', $perl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[BuildFor('Windows')]
|
#[BuildFor('Windows')]
|
||||||
public function buildWin(LibraryPackage $lib, PackageBuilder $builder): void
|
public function buildWin(LibraryPackage $lib, PackageBuilder $builder): void
|
||||||
{
|
{
|
||||||
$perl = ApplicationContext::get('perl');
|
$perl = $this->resolveWindowsPerl();
|
||||||
$cmd = cmd()->cd($lib->getSourceDir())
|
$cmd = cmd()->cd($lib->getSourceDir())
|
||||||
->exec(
|
->exec(
|
||||||
"{$perl} Configure zlib VC-WIN64A " .
|
escapeshellarg($perl) . ' Configure zlib VC-WIN64A ' .
|
||||||
'no-shared ' .
|
'no-shared ' .
|
||||||
'--prefix=' . quote($lib->getBuildRootPath()) . ' ' .
|
'--prefix=' . quote($lib->getBuildRootPath()) . ' ' .
|
||||||
'--with-zlib-lib=' . quote($lib->getLibDir()) . ' ' .
|
'--with-zlib-lib=' . quote($lib->getLibDir()) . ' ' .
|
||||||
@@ -145,4 +126,22 @@ class openssl
|
|||||||
FileSystem::replaceFileRegex("{$pkg->getLibDir()}/pkgconfig/libcrypto.pc", '/Libs.private:.*/m', 'Requires.private: zlib');
|
FileSystem::replaceFileRegex("{$pkg->getLibDir()}/pkgconfig/libcrypto.pc", '/Libs.private:.*/m', 'Requires.private: zlib');
|
||||||
FileSystem::replaceFileRegex("{$pkg->getLibDir()}/cmake/OpenSSL/OpenSSLConfig.cmake", '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
FileSystem::replaceFileRegex("{$pkg->getLibDir()}/cmake/OpenSSL/OpenSSLConfig.cmake", '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function resolveWindowsPerl(): string
|
||||||
|
{
|
||||||
|
global $argv;
|
||||||
|
|
||||||
|
$tool = PackageLoader::getPackage('strawberry-perl');
|
||||||
|
if ($tool instanceof ToolPackage) {
|
||||||
|
$perl = $tool->getBinary('perl.exe');
|
||||||
|
if (file_exists($perl)) {
|
||||||
|
return $perl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new EnvironmentException(
|
||||||
|
'OpenSSL requires strawberry-perl, but it is not installed.',
|
||||||
|
"Please run \"{$argv[0]} install-pkg strawberry-perl\" or retry the build with downloads enabled.",
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ class postgresql extends LibraryPackage
|
|||||||
#[PatchDescription('Various patches before building PostgreSQL')]
|
#[PatchDescription('Various patches before building PostgreSQL')]
|
||||||
public function patchBeforeBuild(): bool
|
public function patchBeforeBuild(): bool
|
||||||
{
|
{
|
||||||
|
// These patches target the autoconf/Make build; the Windows build uses Meson (see buildWin).
|
||||||
|
if (SystemTarget::getTargetOS() === 'Windows') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// skip the test on platforms where libpq infrastructure may be provided by statically-linked libraries
|
// skip the test on platforms where libpq infrastructure may be provided by statically-linked libraries
|
||||||
FileSystem::replaceFileStr("{$this->getSourceDir()}/src/interfaces/libpq/Makefile", 'invokes exit\'; exit 1;', 'invokes exit\';');
|
FileSystem::replaceFileStr("{$this->getSourceDir()}/src/interfaces/libpq/Makefile", 'invokes exit\'; exit 1;', 'invokes exit\';');
|
||||||
// disable shared libs build
|
// disable shared libs build
|
||||||
@@ -53,6 +57,73 @@ class postgresql extends LibraryPackage
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[BuildFor('Windows')]
|
||||||
|
public function buildWin(LibraryPackage $lib): void
|
||||||
|
{
|
||||||
|
$src = $lib->getSourceDir();
|
||||||
|
$build_root = $lib->getBuildRootPath();
|
||||||
|
$lib_dir = $lib->getLibDir();
|
||||||
|
$inc_dir = $lib->getIncludeDir();
|
||||||
|
$build = "{$src}\\build";
|
||||||
|
|
||||||
|
// Export the public pg_char_to_encoding()/pg_encoding_to_char() from libpgcommon.a so a
|
||||||
|
// statically-linked libpq.a resolves them (PHP's ext/pgsql relies on them too). This mirrors
|
||||||
|
// the Unix build's -UUSE_PRIVATE_ENCODING_FUNCS patch, but for the Meson build.
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
"{$src}\\src\\common\\meson.build",
|
||||||
|
"'c_args': ['-DUSE_PRIVATE_ENCODING_FUNCS'],",
|
||||||
|
"'c_args': [],"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Fresh Meson build dir (Meson refuses to reuse a dir configured differently).
|
||||||
|
if (is_dir($build)) {
|
||||||
|
FileSystem::removeDir($build);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Meson's OpenSSL detection link-tests CRYPTO_new_ex_data; our static libcrypto needs its
|
||||||
|
// Win32 deps (and zlib, since OpenSSL was built with zlib) on the link line to succeed.
|
||||||
|
$ld = 'ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib secur32.lib zlibstatic.lib';
|
||||||
|
|
||||||
|
$configure = 'meson setup build'
|
||||||
|
. ' --prefix=' . escapeshellarg($build_root)
|
||||||
|
. ' -Ddefault_library=static' // static libpq.a / libpgcommon.a / libpgport.a
|
||||||
|
. ' -Db_vscrt=mt' // /MT static CRT, matching the rest of the build
|
||||||
|
. ' -Dssl=openssl'
|
||||||
|
// Everything libpq doesn't need: keeps deps minimal and avoids server-only detection.
|
||||||
|
. ' -Dzlib=disabled -Dnls=disabled -Dreadline=disabled -Dicu=disabled'
|
||||||
|
. ' -Dlz4=disabled -Dzstd=disabled -Dtap_tests=disabled'
|
||||||
|
. ' -Dplperl=disabled -Dplpython=disabled -Dpltcl=disabled'
|
||||||
|
. ' -Dgssapi=disabled -Dldap=disabled -Dlibxml=disabled -Dlibxslt=disabled'
|
||||||
|
. ' -Dextra_include_dirs=' . escapeshellarg("{$build_root}\\include")
|
||||||
|
. ' -Dextra_lib_dirs=' . escapeshellarg($lib_dir);
|
||||||
|
|
||||||
|
// Build only the three frontend static libs (not the server) — keeps it fast and avoids
|
||||||
|
// needing every backend dependency. meson/ninja/win_bison/win_flex/perl come from the
|
||||||
|
// tool packages declared in the package config (tools@windows).
|
||||||
|
$targets = 'src/interfaces/libpq/libpq.a src/common/libpgcommon.a src/port/libpgport.a';
|
||||||
|
|
||||||
|
cmd()->cd($src)
|
||||||
|
->setEnv([
|
||||||
|
'LIB' => $lib_dir . ';' . (getenv('LIB') ?: ''),
|
||||||
|
'LDFLAGS' => $ld,
|
||||||
|
])
|
||||||
|
->exec($configure)
|
||||||
|
->exec("ninja -C build {$targets}");
|
||||||
|
|
||||||
|
// Install the static libs under the names PHP's ext/pgsql + frankenphp expect (.lib).
|
||||||
|
FileSystem::createDir($lib_dir);
|
||||||
|
FileSystem::createDir($inc_dir);
|
||||||
|
FileSystem::copy("{$build}\\src\\interfaces\\libpq\\libpq.a", "{$lib_dir}\\libpq.lib");
|
||||||
|
FileSystem::copy("{$build}\\src\\common\\libpgcommon.a", "{$lib_dir}\\libpgcommon.lib");
|
||||||
|
FileSystem::copy("{$build}\\src\\port\\libpgport.a", "{$lib_dir}\\libpgport.lib");
|
||||||
|
|
||||||
|
// Install the public libpq headers (PG18 no longer ships pg_config_ext.h).
|
||||||
|
FileSystem::copy("{$src}\\src\\interfaces\\libpq\\libpq-fe.h", "{$inc_dir}\\libpq-fe.h");
|
||||||
|
FileSystem::copy("{$src}\\src\\include\\postgres_ext.h", "{$inc_dir}\\postgres_ext.h");
|
||||||
|
FileSystem::createDir("{$inc_dir}\\libpq");
|
||||||
|
FileSystem::copy("{$src}\\src\\include\\libpq\\libpq-fs.h", "{$inc_dir}\\libpq\\libpq-fs.h");
|
||||||
|
}
|
||||||
|
|
||||||
#[BuildFor('Darwin')]
|
#[BuildFor('Darwin')]
|
||||||
#[BuildFor('Linux')]
|
#[BuildFor('Linux')]
|
||||||
public function buildUnix(PackageInstaller $installer, PackageBuilder $builder): void
|
public function buildUnix(PackageInstaller $installer, PackageBuilder $builder): void
|
||||||
|
|||||||
@@ -19,7 +19,12 @@ class sqlite
|
|||||||
#[BuildFor('Linux')]
|
#[BuildFor('Linux')]
|
||||||
public function buildUnix(LibraryPackage $lib): void
|
public function buildUnix(LibraryPackage $lib): void
|
||||||
{
|
{
|
||||||
UnixAutoconfExecutor::create($lib)->configure()->make();
|
UnixAutoconfExecutor::create($lib)
|
||||||
|
->appendEnv([
|
||||||
|
'CFLAGS' => '-DSQLITE_ENABLE_COLUMN_METADATA=1',
|
||||||
|
])
|
||||||
|
->configure()
|
||||||
|
->make();
|
||||||
$lib->patchPkgconfPrefix(['sqlite3.pc']);
|
$lib->patchPkgconfPrefix(['sqlite3.pc']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user