[gimp/wip/Jehan/gtk-mr-1563-windows-ink] gitlab-ci: testing gtk!1563 for Windows Ink support.




commit 04870f061e2883664b322b2891d7070c25fad8f3
Author: Jehan <jehan girinstud io>
Date:   Wed Mar 3 13:23:28 2021 +0100

    gitlab-ci: testing gtk!1563 for Windows Ink support.
    
    Properly this time (hopefully).

 .gitlab-ci.yml                                     |  5 +-
 .../0001-gtk-meson-link-with-ssp-on-Windows.patch  | 43 ++++++++++
 build/windows/crossbuild-gitlab-ci/build-deps.sh   | 14 +++-
 build/windows/crossbuild-gitlab-ci/gtk3.patch      | 96 ++++++++++++++++++++++
 4 files changed, 155 insertions(+), 3 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 061aa25e1f..30908f499c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -190,7 +190,7 @@ deps-win64:
     - apt-cache
   before_script:
     - apt-get update
-    - apt-get install -y --no-install-recommends wine wine64
+    - apt-get install -y --no-install-recommends wine wine64 wget
 
     - git clone --depth=${GIT_DEPTH} git://git.tuxfamily.org/gitroot/crossroad/crossroad.git
     - cd crossroad
@@ -257,6 +257,9 @@ deps-win32:
     - cd ..
     - pip3 install zstandard
   script:
+    - apt-get update
+    - apt-get install -y --no-install-recommends wget
+
     - export PATH="`pwd`/.local/bin:$PATH"
     - crossroad w32 gimp --run="build/windows/crossbuild-gitlab-ci/build-deps.sh"
   artifacts:
diff --git a/build/windows/crossbuild-gitlab-ci/0001-gtk-meson-link-with-ssp-on-Windows.patch 
b/build/windows/crossbuild-gitlab-ci/0001-gtk-meson-link-with-ssp-on-Windows.patch
new file mode 100644
index 0000000000..150581e3fc
--- /dev/null
+++ b/build/windows/crossbuild-gitlab-ci/0001-gtk-meson-link-with-ssp-on-Windows.patch
@@ -0,0 +1,43 @@
+From b6b16c011def5c9e59ee8317715b4be05e088b9f Mon Sep 17 00:00:00 2001
+From: Jehan <jehan girinstud io>
+Date: Wed, 3 Mar 2021 17:04:16 +0100
+Subject: [PATCH] meson: link with ssp on Windows.
+
+Maybe not necessary for all Windows builds, but for the ones with
+mingw-w64 at least, since recent versions, -lssp is necessary for
+fortified functions access.
+---
+ gtk/meson.build | 2 +-
+ meson.build     | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/gtk/meson.build b/gtk/meson.build
+index 43a6e2bfef..41c7e2ee3b 100644
+--- a/gtk/meson.build
++++ b/gtk/meson.build
+@@ -1092,7 +1092,7 @@ gtk_update_icon_cache = executable(
+   'updateiconcache.c',
+   extra_update_icon_cache_objs,
+   c_args: gtk_cargs,
+-  dependencies: libgtk_dep,
++  dependencies: [ libgtk_dep, ssp ],
+   install: true
+ )
+ 
+diff --git a/meson.build b/meson.build
+index 7ea2f4c7dd..c8638a331b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -801,6 +801,9 @@ if os_win32
+   '''
+   result = cc.links(getdevprop_code, args: ['-lsetupapi'], name: 'has SetupDiGetDevicePropertyW')
+   cdata.set('HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W', result ? 1 : false)
++
++  # Necessary with _FORTIFY_SOURCE on mingw-w64.
++  ssp = cc.find_library('ssp')
+ endif
+ 
+ have_gio_unix = false
+-- 
+2.29.2
+
diff --git a/build/windows/crossbuild-gitlab-ci/build-deps.sh 
b/build/windows/crossbuild-gitlab-ci/build-deps.sh
index 35fef20485..a558f3a2c0 100644
--- a/build/windows/crossbuild-gitlab-ci/build-deps.sh
+++ b/build/windows/crossbuild-gitlab-ci/build-deps.sh
@@ -17,6 +17,18 @@ crossroad meson _build/ -Dintrospection=false -Dsdl2=disabled -Dlibdir=lib && \
 ninja -C _build install || exit 1
 cd ..
 
+#GTK
+
+crossroad install atk glib2 headers-git && \
+git clone --depth 1 -b gtk-3-24 https://gitlab.gnome.org/GNOME/gtk.git && cd gtk && \
+git apply ../../build/windows/crossbuild-gitlab-ci/gtk3.patch && \
+wget https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1563.patch && \
+git apply 1563.patch && \
+crossroad meson _build/ -Dtests=false -Ddemos=false -Dexamples=false \
+                        -Dbuiltin_immodules=yes -Dintrospection=false -Dlibdir=lib && \
+ninja -C _build install || exit 1
+cd ..
+
 # preparing GIMP
 
 LIBMNG=
@@ -27,10 +39,8 @@ if [ "x$CROSSROAD_PLATFORM" = "xw64" ]; then
 fi
 
 crossroad install appstream-glib              \
-                  atk                         \
                   drmingw                     \
                   gexiv2                      \
-                  glib2                       \
                   json-c                      \
                   ghostscript                 \
                   iso-codes                   \
diff --git a/build/windows/crossbuild-gitlab-ci/gtk3.patch b/build/windows/crossbuild-gitlab-ci/gtk3.patch
new file mode 100644
index 0000000000..f0fbb7ed06
--- /dev/null
+++ b/build/windows/crossbuild-gitlab-ci/gtk3.patch
@@ -0,0 +1,96 @@
+From dac52dfa9acd0e070baab1c826860131a09dae2b Mon Sep 17 00:00:00 2001
+From: Jehan <jehan girinstud io>
+Date: Wed, 3 Mar 2021 17:04:16 +0100
+Subject: [PATCH 1/2] meson: link with ssp on Windows.
+
+Maybe not necessary for all Windows builds, but for the ones with
+mingw-w64 at least, since recent versions, -lssp is necessary for
+fortified functions access.
+---
+ gtk/meson.build | 2 +-
+ meson.build     | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/gtk/meson.build b/gtk/meson.build
+index 43a6e2bfef..41c7e2ee3b 100644
+--- a/gtk/meson.build
++++ b/gtk/meson.build
+@@ -1092,7 +1092,7 @@ gtk_update_icon_cache = executable(
+   'updateiconcache.c',
+   extra_update_icon_cache_objs,
+   c_args: gtk_cargs,
+-  dependencies: libgtk_dep,
++  dependencies: [ libgtk_dep, ssp ],
+   install: true
+ )
+ 
+diff --git a/meson.build b/meson.build
+index 7ea2f4c7dd..c8638a331b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -801,6 +801,9 @@ if os_win32
+   '''
+   result = cc.links(getdevprop_code, args: ['-lsetupapi'], name: 'has SetupDiGetDevicePropertyW')
+   cdata.set('HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W', result ? 1 : false)
++
++  # Necessary with _FORTIFY_SOURCE on mingw-w64.
++  ssp = cc.find_library('ssp')
+ endif
+ 
+ have_gio_unix = false
+-- 
+2.29.2
+
+
+From 1d3d131ca89532d9eb1b057f7b44afc87576f8c9 Mon Sep 17 00:00:00 2001
+From: Jehan <jehan girinstud io>
+Date: Wed, 3 Mar 2021 23:52:02 +0100
+Subject: [PATCH 2/2] gdk: WM_DWMCOMPOSITIONCHANGED is declared in winuser.h.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes:
+> error: ‘WM_DWMCOMPOSITIONCHANGED’ undeclared (first use in this function)
+---
+ gdk/win32/gdkevents-win32.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
+index 67df5026ec..be11feba7c 100644
+--- a/gdk/win32/gdkevents-win32.c
++++ b/gdk/win32/gdkevents-win32.c
+@@ -39,6 +39,22 @@
+  * not have TrackMouseEvent at all (?) --hb
+  */
+ 
++#if defined (_WIN32_WINNT) && WIN32_WINNT < 0x0601
++#  undef _WIN32_WINNT
++
++#  define _WIN32_WINNT 0x0601
++#  ifdef WINVER
++#    undef WINVER
++#  endif
++#  define WINVER _WIN32_WINNT
++#elif !defined (_WIN32_WINNT)
++#  define _WIN32_WINNT 0x0601
++#  ifdef WINVER
++#    undef WINVER
++#  endif
++#  define WINVER _WIN32_WINNT
++#endif
++
+ #include "config.h"
+ 
+ #include "gdkprivate-win32.h"
+@@ -61,6 +77,7 @@
+ #include "gdkdndprivate.h"
+ 
+ #include <windowsx.h>
++#include <winuser.h>
+ 
+ #ifdef G_WITH_CYGWIN
+ #include <fcntl.h>
+-- 
+2.29.2
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]