From 02de62b4dfc32e5f62a3e5e84c2283f7237757ef Mon Sep 17 00:00:00 2001 From: Pete Bishop Date: Wed, 19 Feb 2025 10:19:26 +0000 Subject: [PATCH] Implement PHP library inclusion --- .github/workflows/build-php.yml | 10 +++++++++- .gitignore | 2 ++ php-libraries.txt | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 php-libraries.txt diff --git a/.github/workflows/build-php.yml b/.github/workflows/build-php.yml index dd11a611..d7bdeb29 100644 --- a/.github/workflows/build-php.yml +++ b/.github/workflows/build-php.yml @@ -128,6 +128,14 @@ jobs: echo "PHP_EXTENSIONS=$EXTENSIONS" >> $GITHUB_ENV echo "PHP_EXT_HASH=$EXT_HASH" >> $GITHUB_ENV + - name: Read PHP libraries from file + id: read-libs + shell: bash + run: | + LIBRARIES=$(php -r "echo trim(file_get_contents('php-libraries.txt'));") + LIBRARIES_HASH=$(php -r "echo md5(getenv('LIBRARIES'));") + echo "PHP_LIBS=$LIBRARIES" >> $GITHUB_ENV + # Cache downloaded source - id: cache-spc-downloads uses: actions/cache@v4 @@ -145,7 +153,7 @@ jobs: - name: Build PHP run: | cd ../static-php-cli - ./bin/${{ env.SPC_BINARY }} build --build-cli "${{ env.PHP_EXTENSIONS }}" + ./bin/${{ env.SPC_BINARY }} build --build-cli "${{ env.PHP_EXTENSIONS }}" --with-libs="${{ env.PHP_LIBS }}" cd ../php-bin - name: Get built PHP version diff --git a/.gitignore b/.gitignore index e43b0f98..2991df03 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .DS_Store +.idea +vendor diff --git a/php-libraries.txt b/php-libraries.txt new file mode 100644 index 00000000..4dc08953 --- /dev/null +++ b/php-libraries.txt @@ -0,0 +1 @@ +libjpeg,freetype,libwebp \ No newline at end of file