diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 49658cfad5..4080929010 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -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 diff --git a/build-aux/cairo_build/0030-ucrt-clang-fixes.patch b/build-aux/cairo_build/0030-ucrt-clang-fixes.patch new file mode 100644 index 0000000000..421a850ec5 --- /dev/null +++ b/build-aux/cairo_build/0030-ucrt-clang-fixes.patch @@ -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 diff --git a/build-aux/cairo_build/PKGBUILD b/build-aux/cairo_build/PKGBUILD new file mode 100644 index 0000000000..b9df6f3d9a --- /dev/null +++ b/build-aux/cairo_build/PKGBUILD @@ -0,0 +1,111 @@ +# Maintainer: Alexey Pavlov +# Contributor: Renato Silva + +_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" +} \ No newline at end of file diff --git a/justfile b/justfile index bbdd808718..c450185c47 100644 --- a/justfile +++ b/justfile @@ -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 \