Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7854223
fix version 1.56.4 in vcpkg for tests
MarcelBolten Feb 9, 2026
332b0bf
add missing paths to check in my win dev env
MarcelBolten Feb 9, 2026
c766fca
Revert "fix version 1.56.4 in vcpkg for tests"
MarcelBolten Feb 9, 2026
369adf2
first try
MarcelBolten Feb 10, 2026
ed74eff
run vcpkg from within vcpkg dir
MarcelBolten Feb 10, 2026
1831fc9
fix pathes
MarcelBolten Feb 10, 2026
ed26907
fix run-tests.php -j argument
MarcelBolten Feb 10, 2026
b458f7e
try different step order
MarcelBolten Feb 10, 2026
a92d8ee
change caching strategy
MarcelBolten Feb 10, 2026
b280b2c
try something
MarcelBolten Feb 10, 2026
8778b7c
try individual run steps with cmd shell
MarcelBolten Feb 10, 2026
0418072
cache vcpkg_installed in manifest mode
MarcelBolten Feb 10, 2026
a7ff6fc
remove unused cache location
MarcelBolten Feb 10, 2026
0a3df46
fix depsPath
MarcelBolten Feb 10, 2026
cf2eba1
php -i
MarcelBolten Feb 10, 2026
7c41b42
has to be depth 1
MarcelBolten Feb 10, 2026
6403423
try to find extension dlls
MarcelBolten Feb 10, 2026
897a55a
adjust extension path
MarcelBolten Feb 10, 2026
b2bddb9
find lib
MarcelBolten Feb 10, 2026
ac085d0
update config.w32 to find php_cairo.dll
MarcelBolten Feb 10, 2026
031850b
try to setup fontconfig
MarcelBolten Feb 10, 2026
5c9b856
make test more robust until common font file is used
MarcelBolten Feb 10, 2026
196c08d
tests
MarcelBolten Feb 10, 2026
bbfe2ee
add back vcpkg config entries
MarcelBolten Feb 10, 2026
fde21bb
tests: skip failing tests for now
MarcelBolten Feb 10, 2026
b3a7762
ci: add hash to key for vcpkg cache
MarcelBolten Feb 10, 2026
44a5df6
expand the matrix
MarcelBolten Feb 11, 2026
737f6b5
ci: fix syntax
MarcelBolten Feb 11, 2026
d6558fe
ci: cache
MarcelBolten Feb 11, 2026
0f55233
ci: all php versions >= 8.2
MarcelBolten Feb 11, 2026
54b21c0
CI: add artifact for PIE
MarcelBolten Feb 11, 2026
2191b89
CI: make custom triplet available
MarcelBolten Feb 11, 2026
08b4212
CI: master cannot be used with setup-php-sdk
MarcelBolten Feb 11, 2026
620303a
CI: tweak creation of artifact for PIE
MarcelBolten Feb 11, 2026
e51cd1c
CI: need quotes
MarcelBolten Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 145 additions & 83 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Get the extension matrix
id: extension-matrix
uses: php/php-windows-builder/extension-matrix@v1
with:
extension-url: https://github.com/MarcelBolten/php-pango
php-version-list: '8.5'
arch-list: 'x64'
ts-list: 'nts'
php-version-list: '8.2, 8.3, 8.4, 8.5'
arch-list: 'x64, x86'
ts-list: 'nts, ts'

build:
needs: get-extension-matrix
Expand All @@ -34,36 +35,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: php -i
run: php -i

- name: Restore vcpkg cache
id: restore-vcpkg-cache
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
path: |
C:\vcpkg\installed
C:\vcpkg\buildtrees
key: vcpkg-${{ matrix.arch }}-${{ matrix.php-version }}-${{ github.ref_name }}
${{ github.workspace }}/vcpkg/vcpkg_installed
c:\vcpkg\packages
c:\vcpkg\downloads
key: vcpkg-${{ matrix.arch }}-${{ matrix.php-version }}-${{ github.ref_name }}-${{ hashFiles('vcpkg/**/*.json', '!vcpkg/vcpkg_installed/**/*.json') }}
restore-keys: |
vcpkg-${{ matrix.arch }}-${{ matrix.php-version }}-${{ github.ref_name }}
vcpkg-${{ matrix.arch }}-${{ matrix.php-version }}-
vcpkg-${{ matrix.arch }}-${{ matrix.php-version }}
vcpkg-${{ matrix.arch }}

- name: Setup vcpkg and install dependencies
- name: Install dependencies via vcpkg
id: build-deps
shell: pwsh
working-directory: vcpkg
run: |
# Clone vcpkg if not cached
if (!(Test-Path "C:\vcpkg")) {
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
}
cd C:\vcpkg

# Bootstrap if needed
if (!(Test-Path ".\vcpkg.exe")) {
.\bootstrap-vcpkg.bat
}

# Set architecture
$triplet = "${{ matrix.arch }}-windows-static-md"

Expand All @@ -73,87 +63,159 @@ jobs:
-and [version]"${{ matrix.php-version }}" -le [version]"8.3" `
) {
$triplet = "x86-windows-php"

$tripletContent = @(
"set(VCPKG_TARGET_ARCHITECTURE x86)"
"set(VCPKG_CRT_LINKAGE dynamic)"
"set(VCPKG_LIBRARY_LINKAGE static)"
"set(VCPKG_PLATFORM_TOOLSET v142)"
) -join "`n"

New-Item -Path "C:\vcpkg\triplets\community" -Name "$triplet.cmake" -Value $tripletContent -Force
}

# Install all required packages
$packages = @(
"cairo:$triplet",
"pango:$triplet",
"libpng:$triplet",
"freetype:$triplet",
"fontconfig:$triplet",
"pixman:$triplet",
"libjpeg-turbo:$triplet",
"zlib:$triplet",
"bzip2:$triplet",
"brotli:$triplet",
"expat:$triplet"
)
& .\vcpkg install @packages --overlay-ports=${{ github.workspace }}/vcpkg-overlays

$depsPath = "C:\vcpkg\installed\$triplet"
vcpkg install --triplet=$triplet

$depsPath = "${{ github.workspace }}\vcpkg\vcpkg_installed\$triplet"

# list all file in the current directory for debugging
# Get-ChildItem
# Write-Host "Libraries build:"
# Get-ChildItem $depsPath -Recurse | ForEach-Object { Write-Host $_.FullName }

# Export the path so it can be used in the extension build step
echo "PANGO_DEPS_PATH=$depsPath" >> $env:GITHUB_OUTPUT
echo "pangoDepsPath=$depsPath" >> $env:GITHUB_OUTPUT

- name: Save vcpkg cache
if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
uses: actions/cache/save@v5
with:
path: |
C:\vcpkg\installed
C:\vcpkg\buildtrees
key: vcpkg-${{ matrix.arch }}-${{ matrix.php-version }}-${{ github.ref_name }}

- name: Install cairo via PIE
shell: cmd
run: |
curl -L -o pie.phar https://github.com/php/pie/releases/download/1.3.8/pie.phar
php pie.phar install marcelbolten/php-cairo:^2.0.0alpha2
php --ri cairo

- name: Build the extension
uses: php/php-windows-builder/extension@v1
${{ github.workspace }}/vcpkg/vcpkg_installed
c:\vcpkg\packages
c:\vcpkg\downloads
key: vcpkg-${{ matrix.arch }}-${{ matrix.php-version }}-${{ github.ref_name }}-${{ hashFiles('vcpkg/**/*.json', '!vcpkg/vcpkg_installed/**/*.json') }}

- name: Setup PHP SDK
id: setup-php-sdk
uses: php/setup-php-sdk@v0.12
with:
php-version: ${{ matrix.php-version }}
version: ${{ matrix.php-version }}
arch: ${{ matrix.arch }}
ts: ${{ matrix.ts }}
args: --with-pango=${{ steps.build-deps.outputs.PANGO_DEPS_PATH }}
run-tests: false
cache: true

- name: Find Pango DLL path
id: pango-dll
shell: pwsh
- name: Setup MSVC Build Environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
toolset: ${{ steps.setup-php-sdk.outputs.toolset }}

- name: Clone cairo extension
shell: cmd
working-directory: ./..
run: |
$pangoDll = Get-ChildItem -Path "D:\a\php-pango\php-pango\build\" -Filter "php_pango.dll" -Recurse | Select-Object -First 1
if ($pangoDll) {
$dllPath = $pangoDll.FullName
Write-Host "Pango DLL found at: $dllPath"
echo "path=$dllPath" >> $env:GITHUB_OUTPUT
} else {
Write-Error "Pango DLL not found"
exit 1
}
md php-cairo
git clone --depth 1 https://github.com/marcelbolten/php-cairo.git php-cairo
- run: phpize
shell: cmd
working-directory: ../php-cairo
- name: Run configure for cairo extension
shell: cmd
working-directory: ../php-cairo
run: configure --with-cairo=${{ steps.build-deps.outputs.pangoDepsPath }} --with-prefix=${{ steps.setup-php-sdk.outputs.prefix }}
- run: nmake
shell: cmd
working-directory: ../php-cairo
- run: nmake install
shell: cmd
working-directory: ../php-cairo
# - name: List installed files for debugging
# shell: pwsh
# run: |
# get-childitem ${{ steps.setup-php-sdk.outputs.prefix }}\..\php* -Recurse
- name: Verify cairo extension
shell: cmd
working-directory: ../php-cairo
run: |
${{ steps.setup-php-sdk.outputs.prefix }}\php -d extension=${{ steps.setup-php-sdk.outputs.prefix }}\ext\php_cairo.dll --ri cairo

- name: Build pango extension
shell: cmd
run: phpize
- name: Run configure for pango extension
run: configure --with-pango=${{ steps.build-deps.outputs.pangoDepsPath }} --with-prefix=${{ steps.setup-php-sdk.outputs.prefix }}
shell: cmd
- run: nmake
shell: cmd
- run: nmake install
shell: cmd
- name: Verify pango extension
run: ${{ steps.setup-php-sdk.outputs.prefix }}\php -d extension=${{ steps.setup-php-sdk.outputs.prefix }}\ext\php_cairo.dll -d extension=${{ steps.setup-php-sdk.outputs.prefix }}\ext\php_pango.dll --ri pango
shell: cmd

- name: "php -i"
- name: Run tests
shell: cmd
run: php -d extension=${{ steps.pango-dll.outputs.path }} --ri pango
run: |
set FONTCONFIG_FILE=${{ steps.build-deps.outputs.pangoDepsPath }}\etc\fonts\fonts.conf
set FONTCONFIG_PATH=${{ steps.build-deps.outputs.pangoDepsPath }}\etc\fonts
${{ steps.setup-php-sdk.outputs.prefix }}\php run-tests.php -d extension=${{ steps.setup-php-sdk.outputs.prefix }}\ext\php_cairo.dll -d extension=${{ steps.setup-php-sdk.outputs.prefix }}\ext\php_pango.dll -q -j8 --show-diff

- name: "Upload test outputs"
- name: Upload test outputs
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: pango-test-${{ matrix.php-version }}-${{ matrix.arch }}-${{ matrix.ts }}
path: tests/**/*.log

- name: Package extension for PIE
id: package-pie
shell: pwsh
run: |
# Determine compiler version
$compiler = "vs17"
if ([version]"${{ matrix.php-version }}" -le [version]"8.3") {
$compiler = "vs16"
}

# Normalize architecture for PIE
$pieArch = "${{ matrix.arch }}"
if ("${{ matrix.arch }}" -eq "x64") {
$pieArch = "x86_64"
}

# Get version tag (you may want to customize this based on your versioning)
$tag = "${{ github.ref_name }}"
if ($tag -eq "main" -or $tag -eq "master") {
$tag = "dev-${{ github.sha }}".Substring(0, 15)
}

# Create base filename
$baseName = "php_pango-${tag}-${{ matrix.php-version }}-${{ matrix.ts }}-${compiler}-${pieArch}"

# Create temporary directory for packaging
$tempDir = "$env:RUNNER_TEMP\pie-package"
New-Item -ItemType Directory -Force -Path $tempDir

# Copy DLL with PIE-compliant name
Copy-Item "${{ steps.setup-php-sdk.outputs.prefix }}\ext\php_pango.dll" "$tempDir\${baseName}.dll"

# Copy PDB if it exists (debug symbols)
$pdbPath = "${{ steps.setup-php-sdk.outputs.prefix }}\ext\php_pango.pdb"
if (Test-Path $pdbPath) {
Copy-Item $pdbPath "$tempDir\${baseName}.pdb"
}

# Copy php_pango.h
Copy-Item "php_pango.h" $tempDir

# Copy .lib
$libPath = "${{ steps.setup-php-sdk.outputs.prefix }}\..\php-dev\lib\php_pango.lib"
if (Test-Path $libPath) {
Copy-Item $libPath "$tempDir\php_pango.lib"
}

# Copy license/readme
Copy-Item "LICENSE" $tempDir
Copy-Item "README.md" $tempDir

# Output for use in upload step
echo "pie-baseName=$baseName" >> $env:GITHUB_OUTPUT
echo "pie-tempDir=$tempDir" >> $env:GITHUB_OUTPUT

- name: Upload PIE package
uses: actions/upload-artifact@v6
with:
name: ${{ steps.package-pie.outputs.pie-baseName }}
path: ${{ steps.package-pie.outputs.pie-tempDir }}
4 changes: 2 additions & 2 deletions config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ if (PHP_PANGO != "no") {
&& CHECK_HEADER_ADD_INCLUDE("fontconfig\\fontconfig.h", "CFLAGS_PANGO", PHP_PANGO + "\\include;" + PHP_PHP_BUILD + "\\include")

&& CHECK_HEADER_ADD_INCLUDE("cairo.h", "CFLAGS_PANGO", PHP_PANGO + "\\include\\cairo;" + PHP_PHP_BUILD + "\\include\\cairo")
&& CHECK_HEADER_ADD_INCLUDE("php_cairo_internal.h", "CFLAGS_PANGO", PHP_PANGO + "\\include;" + PHP_PHP_BUILD + "\\include\\cairo\\src;" + configure_module_dirname + "\\..\\extras\\cairo;" + "C:\\tools\\php\\extras\\cairo")
&& CHECK_HEADER_ADD_INCLUDE("php_cairo_internal.h", "CFLAGS_PANGO", PHP_PANGO + "\\include;" + PHP_PHP_BUILD + "\\include\\cairo\\src;" + configure_module_dirname + "\\..\\php-cairo\\src")

&& CHECK_LIB("pango-1.0.lib", "pango", PHP_PANGO + "\\lib")
&& CHECK_LIB("pangocairo-1.0.lib", "pango", PHP_PANGO + "\\lib")
&& CHECK_LIB("pangowin32-1.0.lib", "pango", PHP_PANGO + "\\lib")
&& CHECK_LIB("pangoft2-1.0.lib", "pango", PHP_PANGO + "\\lib")

&& CHECK_LIB("cairo.lib", "pango", PHP_PANGO + "\\lib")
&& CHECK_LIB("php_cairo.lib", "pango", PHP_PANGO + "\\lib;C:\\tools\\php\\extras\\cairo")
&& CHECK_LIB("php_cairo.lib", "pango", PHP_PANGO + "\\lib;C:\\php\\SDK\\lib;" + PHP_PREFIX + "\\SDK\\lib;" + PHP_PREFIX + "\\..\\php-dev\\lib")

&& CHECK_LIB("gobject-2.0.lib", "pango", PHP_PANGO + "\\lib")
&& CHECK_LIB("glib-2.0.lib", "pango", PHP_PANGO + "\\lib")
Expand Down
92 changes: 92 additions & 0 deletions tests/Pango/FontFace/NotoColorEmoji.LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
This Font Software is licensed under the SIL Open Font License,
Version 1.1.

This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font
creation efforts of academic and linguistic communities, and to
provide a free and open framework in which fonts may be shared and
improved in partnership with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply to
any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software
components as distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to,
deleting, or substituting -- in part or in whole -- any of the
components of the Original Version, by changing formats or by porting
the Font Software to a new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed,
modify, redistribute, and sell modified and unmodified copies of the
Font Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components, in
Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the
corresponding Copyright Holder. This restriction only applies to the
primary font name as presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created using
the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added tests/Pango/FontFace/NotoColorEmoji.ttf
Binary file not shown.
Loading
Loading