Skip to content

Commit a9de439

Browse files
PeteBishwhipPete Bishop
andauthored
Implement PHP library inclusion (#161)
Co-authored-by: Pete Bishop <[email protected]>
1 parent 54b9e1d commit a9de439

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.github/workflows/build-php.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ jobs:
128128
echo "PHP_EXTENSIONS=$EXTENSIONS" >> $GITHUB_ENV
129129
echo "PHP_EXT_HASH=$EXT_HASH" >> $GITHUB_ENV
130130
131+
- name: Read PHP libraries from file
132+
id: read-libs
133+
shell: bash
134+
run: |
135+
LIBRARIES=$(php -r "echo trim(file_get_contents('php-libraries.txt'));")
136+
LIBRARIES_HASH=$(php -r "echo md5(getenv('LIBRARIES'));")
137+
echo "PHP_LIBS=$LIBRARIES" >> $GITHUB_ENV
138+
131139
# Cache downloaded source
132140
- id: cache-spc-downloads
133141
uses: actions/cache@v4
@@ -145,7 +153,7 @@ jobs:
145153
- name: Build PHP
146154
run: |
147155
cd ../static-php-cli
148-
./bin/${{ env.SPC_BINARY }} build --build-cli "${{ env.PHP_EXTENSIONS }}"
156+
./bin/${{ env.SPC_BINARY }} build --build-cli "${{ env.PHP_EXTENSIONS }}" --with-libs="${{ env.PHP_LIBS }}"
149157
cd ../php-bin
150158
151159
- name: Get built PHP version

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.DS_Store
2+
.idea
3+
vendor

php-libraries.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
libjpeg,freetype,libwebp

0 commit comments

Comments
 (0)