[gimp/wip/Jehan/pygtk-4-distcheck: 4/5] gitlab-ci: fix the GIMP 2.10 CI distcheck.




commit bdc7f912f98fffd60f49607ee9fa837fa00e95a5
Author: Jehan <jehan girinstud io>
Date:   Sun Aug 2 16:59:01 2020 +0200

    gitlab-ci: fix the GIMP 2.10 CI distcheck.
    
    Unfortunately the dist target requires pygtk.
    Note that even adding --disable-python to DISTCHECK_CONFIGURE_FLAGS
    doesn't help as pygtk-codegen-2.0 is needed to generate various .defs
    file added to the DIST.
    Yet pygtk is absent from Debian testing nowadays because it is too old
    and unmaintained. So let's build pygtk ourselves.
    
    Among the few tricks to make pygtk build fine:
    - force Python2 by setting PYTHON env variable (detect Python 3
      otherwise).
    - patch to allow building against latest Pango.

 .gitlab-ci.yml                                     | 33 ++++++++++++++++++
 build/gitlab-ci/deps.sha256sum                     |  3 ++
 ...-the-PangoFont-find_shaper-virtual-method.patch | 39 ++++++++++++++++++++++
 3 files changed, 75 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0976e67a21..8e91cf458f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -119,6 +119,9 @@ deps-debian/testing:
         meson
         mypaint-brushes
         poppler-data
+        python2
+        python-dev
+        wget
         xauth
         xvfb
     - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/pkgconfig:${INSTALL_PREFIX}/share/pkgconfig"
@@ -145,12 +148,42 @@ gimp-debian/testing-autotools:
 gimp-debian/testing-autotools-distcheck:
   extends: .gimp-debian/testing-base
   script:
+    # Building pygtk2 as it is not available in Debian testing anymore.
+    - cd build/gitlab-ci
+    - wget https://cairographics.org/releases/py2cairo-1.10.0.tar.bz2
+    - wget https://download.gnome.org/sources/pygobject/2.28/pygobject-2.28.7.tar.xz
+    - wget https://download.gnome.org/sources/pygtk/2.24/pygtk-2.24.0.tar.gz
+    - sha256sum -c deps.sha256sum
+    - export PYTHON=/usr/bin/python2
+    # py2cairo
+    - tar xjf py2cairo-1.10.0.tar.bz2
+    - cd py2cairo-1.10.0/
+    - libtoolize --force
+    - aclocal
+    - autoheader
+    - automake --force-missing --add-missing --foreign
+    - autoconf
+    - ./configure --prefix="${INSTALL_PREFIX}" && make && make install
+    - cd ..
+    # pygobject
+    - tar xf pygobject-2.28.7.tar.xz
+    - cd pygobject-2.28.7/
+    - ./configure --prefix="${INSTALL_PREFIX}" && make && make install
+    - cd ..
+    # pygtk
+    - tar xzf pygtk-2.24.0.tar.gz
+    - cd pygtk-2.24.0/
+    - patch -p1 < ../pygtk-Drop-the-PangoFont-find_shaper-virtual-method.patch
+    - ./configure --prefix="${INSTALL_PREFIX}" && make && make install
+    - cd ../../..
+    # Actual build.
     - mkdir _build
     - cd _build
     - ../autogen.sh
         --prefix="${INSTALL_PREFIX}"
         --enable-debug
         --disable-python
+        --enable-gtk-doc
     - make -j "$(nproc)"
     - make distcheck
   allow_failure: true
diff --git a/build/gitlab-ci/deps.sha256sum b/build/gitlab-ci/deps.sha256sum
new file mode 100644
index 0000000000..5472c1bdcc
--- /dev/null
+++ b/build/gitlab-ci/deps.sha256sum
@@ -0,0 +1,3 @@
+d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431  py2cairo-1.10.0.tar.bz2
+6e3e54fa6e65a69ac60bd58cb2e60a57f3346ac52efe995f3d10b6c38c972fd8  pygtk-2.24.0.tar.gz
+bb9d25a3442ca7511385a7c01b057492095c263784ef31231ffe589d83a96a5a  pygobject-2.28.7.tar.xz
diff --git a/build/gitlab-ci/pygtk-Drop-the-PangoFont-find_shaper-virtual-method.patch 
b/build/gitlab-ci/pygtk-Drop-the-PangoFont-find_shaper-virtual-method.patch
new file mode 100644
index 0000000000..ba4141e3fa
--- /dev/null
+++ b/build/gitlab-ci/pygtk-Drop-the-PangoFont-find_shaper-virtual-method.patch
@@ -0,0 +1,39 @@
+From 877164b6b70780468a31d8211f29421b6f34b0c8 Mon Sep 17 00:00:00 2001
+From: Mathieu Bridon <bochecha daitauha fr>
+Date: Thu, 24 Oct 2019 22:58:36 +0200
+Subject: [PATCH] Drop the PangoFont find_shaper virtual method
+
+This API has been removed from Pango 1.44.6, because it was completely
+unused by anything.
+
+However, PyGTK tries to bind everything, even unused API.
+
+Removing this from PyGTK means we can build it against the latest Pango
+again.
+---
+ pango.defs | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/pango.defs b/pango.defs
+index 2a79ecc..862667a 100644
+--- a/pango.defs
++++ b/pango.defs
+@@ -1391,15 +1391,6 @@
+   )
+ )
+ 
+-(define-virtual find_shaper
+-  (of-object "PangoFont")
+-  (return-type "PangoEngineShape*")
+-  (parameters
+-    '("PangoLanguage*" "lang")
+-    '("guint32" "ch")
+-  )
+-)
+-
+ (define-virtual get_glyph_extents
+   (of-object "PangoFont")
+   (return-type "none")
+-- 
+2.21.0
+


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