Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f42e197
windows: Forcing cairo version (1.18.4-1) to get a rayon-compatible v…
Doublonmousse Oct 19, 2025
6fa2378
windows CI : try/catch to pass winget error when inno is already inst…
Doublonmousse Oct 19, 2025
540006b
pre test if inno is installed
Doublonmousse Oct 19, 2025
eaac127
windows: noconfirm for cairo version override
Doublonmousse Oct 19, 2025
1d2e48f
install cairo first, pin the version, then install the rest
Doublonmousse Oct 21, 2025
7d3bda3
compile patched cairo from modified pkgbuild
Doublonmousse Oct 21, 2025
975d3de
Another attempt at a manual cairo build
Doublonmousse Oct 25, 2025
913c4cc
the path was correct all along ?
Doublonmousse Oct 25, 2025
dc48819
typoed path (again)
Doublonmousse Oct 25, 2025
3c99978
Tpyo
Doublonmousse Oct 25, 2025
296cb04
debug cd not working ?
Doublonmousse Oct 25, 2025
796c57c
one line for cd (otherwise it resets)
Doublonmousse Oct 25, 2025
07efa6b
configure git to use LF
Doublonmousse Oct 26, 2025
91d8af1
no git so sed it is
Doublonmousse Oct 26, 2025
803c21b
add build dependencies for cairo custom build
Doublonmousse Oct 26, 2025
d978e41
remove the shasum of the removed patch
Doublonmousse Oct 26, 2025
fefebda
more dependencies ..
Doublonmousse Oct 26, 2025
354f6b2
noconfirm to install the built cairo
Doublonmousse Oct 26, 2025
602573a
pkgconfig issue ?
Doublonmousse Oct 26, 2025
eb24fcd
add local pkg config folder to the pkg config path
Doublonmousse Oct 26, 2025
9d4800d
forgotten &&
Doublonmousse Oct 26, 2025
2f28cb9
remove the leading whitespace ...
Doublonmousse Oct 26, 2025
26ce38e
one liner. Disgusting but at least it won't come with whitespace issu…
Doublonmousse Oct 26, 2025
1148587
copy to the right folder instead of exporting (that doesn't work for …
Doublonmousse Oct 26, 2025
b9bcc9e
recursive cp for folder
Doublonmousse Oct 26, 2025
8e04bdb
copy only the cairo.pc file
Doublonmousse Oct 26, 2025
c00894b
path not found .........
Doublonmousse Oct 26, 2025
ac8f9c7
asdfahdsf
Doublonmousse Oct 26, 2025
6094672
Copy the full folder
Doublonmousse Oct 26, 2025
3d9afde
f that didn't work so revert to copy file by file
Doublonmousse Oct 26, 2025
88b6993
copy the full folder (with -hopefully- the correct syntax this time)
Doublonmousse Oct 26, 2025
6635349
copy the cairo folder from the include
Doublonmousse Oct 26, 2025
a41becb
more manual copy
Doublonmousse Oct 27, 2025
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
12 changes: 8 additions & 4 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ jobs:
id: install_inno
shell: pwsh
run: |
winget install -e --id JRSoftware.InnoSetup -v 6.4.3 --accept-package-agreements --accept-source-agreements `
--disable-interactivity --scope machine
if (Test-Path "C:\Program Files (x86)\Inno Setup 6\") {
echo "inno installed successfully"
echo "inno already installed"
} else {
throw "could not find inno's installation folder"
winget install -e --id JRSoftware.InnoSetup -v 6.4.3 --accept-package-agreements --accept-source-agreements `
--disable-interactivity --scope machine
if (Test-Path "C:\Program Files (x86)\Inno Setup 6\") {
echo "inno installed successfully"
} else {
throw "could not find inno's installation folder"
}
}

- name: Set installer name
Expand Down
11 changes: 11 additions & 0 deletions build-aux/cairo_build/0030-ucrt-clang-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- cairo-1.17.4/src/cairo-compiler-private.h.orig 2021-05-04 17:46:38.073000000 +0200
+++ cairo-1.17.4/src/cairo-compiler-private.h 2021-05-04 17:50:50.920604000 +0200
@@ -203,7 +203,7 @@
#define popen _popen
#define strdup _strdup
#define unlink _unlink
-#if _MSC_VER < 1900
+#if (defined(_MSC_VER) && _MSC_VER < 1900)
#define vsnprintf _vsnprintf
#define snprintf _snprintf
#endif
111 changes: 111 additions & 0 deletions build-aux/cairo_build/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Maintainer: Alexey Pavlov <[email protected]>
# Contributor: Renato Silva <[email protected]>

_realname=cairo
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
_commit='b43e7c6f3cf7855e16170a06d3a9c7234c60ca94'
pkgver=1.18.4
pkgrel=4
pkgdesc="Cairo vector graphics library (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://cairographics.org/"
msys2_references=(
"cpe: cpe:2.3:a:cairographics:cairo"
)
license=('spdx:LGPL-2.1-or-later OR MPL-1.1')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-meson"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-fonttools"
"${MINGW_PACKAGE_PREFIX}-gettext-tools"
)
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs"
"${MINGW_PACKAGE_PREFIX}-freetype"
"${MINGW_PACKAGE_PREFIX}-fontconfig"
"${MINGW_PACKAGE_PREFIX}-gettext-runtime"
"${MINGW_PACKAGE_PREFIX}-glib2"
"${MINGW_PACKAGE_PREFIX}-libpng"
"${MINGW_PACKAGE_PREFIX}-lzo2"
"${MINGW_PACKAGE_PREFIX}-pixman"
"${MINGW_PACKAGE_PREFIX}-zlib")
source=("https://cairographics.org/releases/cairo-${pkgver}.tar.xz"
0030-ucrt-clang-fixes.patch)
sha256sums=('445ed8208a6e4823de1226a74ca319d3600e83f6369f99b14265006599c32ccb'
'86c1af2878a20bd3608fc476e4ba1f2451458a5f6f12e457e37b61082c38db82')

prepare() {
cd "${srcdir}/${_realname}-${pkgver}"

patch -p1 -i "${srcdir}"/0030-ucrt-clang-fixes.patch
}

build() {
local -a _static_flags=(
-DGIO_STATIC_COMPILATION
-DGLIB_STATIC_COMPILATION
-DGMODULE_STATIC_COMPILATION
-DGOBJECT_STATIC_COMPILATION
)

local -a _meson_options
_meson_options=(
--prefix=${MINGW_PREFIX}
--buildtype=plain
--wrap-mode=nofallback
-Dauto_features=enabled
-Dtests=disabled
-Ddwrite=enabled
-Dfontconfig=enabled
-Dfreetype=enabled
-Dpng=enabled
-Dtee=enabled
-Dzlib=enabled
-Dxlib=disabled
-Dxcb=disabled
-Dspectre=disabled
-Dsymbol-lookup=disabled
)

# work around gcc errors
if [[ "${CC}" == "gcc" ]]; then
CFLAGS+=" -Wno-error=incompatible-pointer-types"
CXXFLAGS+=" -Wno-error=incompatible-pointer-types"
fi

# Enables CAIRO_WIN32_STATIC_BUILD, keeps DllMain far away (#17643)
CFLAGS+=" ${_static_flags[@]}" \
CXXFLAGS+=" ${_static_flags[@]}" \
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/meson setup \
"${_meson_options[@]}" \
--default-library=static \
"${_realname}-${pkgver}" \
"build-${MSYSTEM}-static"

meson compile -C "build-${MSYSTEM}-static"

MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/meson setup \
"${_meson_options[@]}" \
--default-library=shared \
"${_realname}-${pkgver}" \
"build-${MSYSTEM}-shared"

meson compile -C "build-${MSYSTEM}-shared"
}

package() {
meson install -C "build-${MSYSTEM}-static" --destdir "${pkgdir}"
meson install -C "build-${MSYSTEM}-shared" --destdir "${pkgdir}"

install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" \
"${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING-LGPL-2.1" \
"${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING-LGPL-2.1"
install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING-MPL-1.1" \
"${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING-MPL-1.1"
}
9 changes: 8 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,15 @@ prerequisites-dev: prerequisites

# in MSYS2 shell
prerequisites-win:
echo "compile cairo without the 0001-DWrite-Get-glyph-bitmap-with-D2D-in-selected-cases.patch patch"
pacman -S --noconfirm \
unzip git mingw-w64-x86_64-xz mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc mingw-w64-x86_64-clang \
mingw-w64-x86_64-freetype mingw-w64-x86_64-fontconfig mingw-w64-x86_64-glib2 mingw-w64-x86_64-libpng \
mingw-w64-x86_64-lzo2 mingw-w64-x86_64-pixman mingw-w64-x86_64-cc mingw-w64-x86_64-meson \
mingw-w64-x86_64-ninja mingw-w64-x86_64-pkgconf mingw-w64-x86_64-python mingw-w64-x86_64-python-fonttools \
mingw-w64-x86_64-gettext-tools patch
cd build-aux && cd cairo_build && sed -i 's/\r$//g' PKGBUILD && sed -i 's/\r$//g' 0030-ucrt-clang-fixes.patch && makepkg -i --noconfirm && cp -r ./pkg/mingw-w64-x86_64-cairo/msys64/mingw64/lib/pkgconfig/. /C/msys64/mingw64/lib/pkgconfig/ && cp -r ./pkg/mingw-w64-x86_64-cairo/msys64/mingw64/include/cairo /C/msys64/mingw64/include/ && cp -r ./pkg/mingw-w64-x86_64-cairo/msys64/mingw64/bin/. /C/msys64/mingw64/bin/ && cp -r ./pkg/mingw-w64-x86_64-cairo/msys64/mingw64/lib/. /C/msys64/mingw64/lib/
pacman -S --noconfirm \
unzip git mingw-w64-x86_64-xz mingw-w64-x86_64-gcc mingw-w64-x86_64-clang \
mingw-w64-x86_64-toolchain mingw-w64-x86_64-autotools mingw-w64-x86_64-make mingw-w64-x86_64-cmake \
mingw-w64-x86_64-meson mingw-w64-x86_64-diffutils mingw-w64-x86_64-desktop-file-utils \
mingw-w64-x86_64-appstream mingw-w64-x86_64-gtk4 mingw-w64-x86_64-libadwaita mingw-w64-x86_64-poppler \
Expand Down