1
0
mirror of https://github.com/php/pie.git synced 2026-03-23 23:12:17 +01:00

Added barebones structure of building with Static PHP

This commit is contained in:
James Titcumb
2025-11-25 17:32:54 +00:00
parent be5f1429ad
commit d98e5b9b7f
4 changed files with 46 additions and 0 deletions

8
spc/.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
buildroot
downloads
log
pkgroot
source
pie.elf
pie.phar
spc

22
spc/build.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -xeuo pipefail
SPC_ROOT=$(dirname "$0")
# First up, build the regular pie.phar
cd "$SPC_ROOT/.."
php box.phar compile
mv pie.phar "$SPC_ROOT/pie.phar"
cd $SPC_ROOT
# Build the static PHP micro.sfx
./spc craft
# Combine pie.phar with the micro.sfx
./spc micro:combine pie.phar --output=pie.elf
# Docker build & run the test with it
docker build --file spc.Dockerfile --tag pie-spc-test .
docker run --rm -ti pie-spc-test

5
spc/craft.yml Normal file
View File

@@ -0,0 +1,5 @@
php-version: 8.4
extensions: "curl,filter,iconv,openssl,phar,zlib"
sapi: micro
download-options:
prefer-pre-built: true

11
spc/spc.Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
# docker build --file spc.Dockerfile --tag pie-spc-test .
# docker run --rm -ti pie-spc-test
FROM php:7.4-cli
# need
RUN apt-get update && \
apt-get install -y git
COPY pie.elf /usr/bin/pie
CMD ["pie", "install", "asgrim/example-pie-extension"]