[gimp/wip/Jehan/native-win64-build: 3/4] build: do not build Windows GIMP with ccache.




commit e76d877c904da39924932ad29608eddcdf5a9287
Author: Jehan <jehan girinstud io>
Date:   Mon May 3 20:01:29 2021 +0200

    build: do not build Windows GIMP with ccache.
    
    The build rules were highly inspired by other projects on GNOME's
    Gitlab. All of them used to build with ccache. It worked fine for the
    main build, but completely broke GObject Introspection build on both
    babl and GEGL. And the worse thing is that meson was absolutely not
    displaying the error, just saying it failed (even in verbose mode). A
    lot of time wasted trying to debug.
    
    Therefore let's get rid of ccache.
    
    Other minor changes:
    
    * Build from the build dir, rather than source. The other way around
      works too, but I actually find commands simpler this way.
    * Adding artifacts.

 .gitlab-ci.yml                                     |  6 +++
 build/windows/build-msys2.sh                       | 47 +++++++++++++---------
 build/windows/patches/0001-Add-some-quotes.patch   | 26 ++++++++++++
 .../0001-Introspection-in-verbose-mode.patch       | 25 ++++++++++++
 4 files changed, 84 insertions(+), 20 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 90e7b0584e..a2fb23674d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -196,6 +196,12 @@ gimp-native-win64:
   script:
     - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
     - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/build-msys2.sh"
+  artifacts:
+    name: "GIMP-Win-native-${CI_COMMIT_SHORT_SHA}"
+    when: always
+    expire_in: 2 days
+    paths:
+    - _install
   needs: []
 
 deps-win64:
diff --git a/build/windows/build-msys2.sh b/build/windows/build-msys2.sh
index 68bbe9183e..eba373d825 100644
--- a/build/windows/build-msys2.sh
+++ b/build/windows/build-msys2.sh
@@ -31,7 +31,6 @@ pacman --noconfirm -Suy
 pacman --noconfirm -S --needed \
     base-devel \
     mingw-w64-$MSYS2_ARCH-toolchain \
-    mingw-w64-$MSYS2_ARCH-ccache \
     mingw-w64-$MSYS2_ARCH-pkg-config \
     mingw-w64-$MSYS2_ARCH-meson \
     \
@@ -73,14 +72,12 @@ pacman --noconfirm -S --needed \
     mingw-w64-$MSYS2_ARCH-shared-mime-info \
     mingw-w64-$MSYS2_ARCH-suitesparse \
     mingw-w64-$MSYS2_ARCH-vala \
-    mingw-w64-$MSYS2_ARCH-xpm-nox \
-    mingw-w64-$MSYS2_ARCH-babl \
-    mingw-w64-$MSYS2_ARCH-gegl
+    mingw-w64-$MSYS2_ARCH-xpm-nox
 
-mkdir -p _ccache
-export CCACHE_BASEDIR="$(pwd)"
-export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
-export CC="ccache gcc"
+#mkdir -p _ccache
+#export CCACHE_BASEDIR="$(pwd)"
+#export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
+#export CC="ccache gcc"
 
 export GIT_DEPTH=1
 export GIMP_PREFIX=`realpath ~/_install`
@@ -90,25 +87,35 @@ export PKG_CONFIG_PATH="${GIMP_PREFIX}/share/pkgconfig:$PKG_CONFIG_PATH"
 export LD_LIBRARY_PATH="${GIMP_PREFIX}/lib:${LD_LIBRARY_PATH}"
 export ACLOCAL_FLAGS="-I/c/msys64/mingw64/share/aclocal"
 
+# export XDG_DATA_DIRS="$XDG_DATA_DIRS:${GIMP_PREFIX}/share:/usr/local/share:/usr/share:/mingw64/share/"
+# export XDG_DATA_DIRS="$XDG_DATA_DIRS:${GIMP_PREFIX}/share:/mingw64/share/"
+export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/mingw64/share/"
+#export XDG_DATA_DIRS="/mingw64/share/"
+
 git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git _babl
 git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git _gegl
 
-cd _babl
-meson -Dprefix="${GIMP_PREFIX}" -Dwith-docs=false _build
-ninja -v -C _build
-ninja -C _build install
-cd ../_gegl
-meson -Dprefix="${GIMP_PREFIX}" -Ddocs=false _build
-ninja -C _build
-ninja -C _build install
-cd ..
+mkdir _babl/_build
+cd _babl/_build
+git apply ../../build/windows/patches/0001-Introspection-in-verbose-mode.patch
+git apply ../../build/windows/patches/0001-Add-some-quotes.patch
+meson -Dprefix="${GIMP_PREFIX}" -Dwith-docs=false ..
+ninja
+ninja install
+
+mkdir ../../_gegl/_build
+cd ../../_gegl/_build
+meson -Dprefix="${GIMP_PREFIX}" -Ddocs=false ..
+ninja
+ninja install
+cd ../..
 
 # Build
-ccache --zero-stats
-ccache --show-stats
+#ccache --zero-stats
+#ccache --show-stats
 
 ./autogen.sh --prefix="${GIMP_PREFIX}"
 make -j4
 make install
 
-ccache --show-stats
+#ccache --show-stats
diff --git a/build/windows/patches/0001-Add-some-quotes.patch 
b/build/windows/patches/0001-Add-some-quotes.patch
new file mode 100644
index 0000000000..c75794f276
--- /dev/null
+++ b/build/windows/patches/0001-Add-some-quotes.patch
@@ -0,0 +1,26 @@
+From fe9271fc70c360034d5e60ddd810092a6fc3c365 Mon Sep 17 00:00:00 2001
+From: Jehan <jehan girinstud io>
+Date: Tue, 4 May 2021 01:46:00 +0200
+Subject: [PATCH] Add some quotes.
+
+Could it be it? So hard to know without any output!
+---
+ babl/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/babl/meson.build b/babl/meson.build
+index c0f0e76..0213c33 100644
+--- a/babl/meson.build
++++ b/babl/meson.build
+@@ -142,7 +142,7 @@ if build_gir
+     sources: babl_headers,
+     extra_args: [
+       '--verbose',
+-      '--identifier-filter-cmd=@0@ @1@'.format(python.path(), 
++      '--identifier-filter-cmd="@0@ @1@"'.format(python.path(),
+         meson.current_source_dir() / 'identfilter.py'),
+       '-DBABL_IS_BEING_COMPILED',
+     ],
+-- 
+2.30.2
+
diff --git a/build/windows/patches/0001-Introspection-in-verbose-mode.patch 
b/build/windows/patches/0001-Introspection-in-verbose-mode.patch
new file mode 100644
index 0000000000..60fd5bcae8
--- /dev/null
+++ b/build/windows/patches/0001-Introspection-in-verbose-mode.patch
@@ -0,0 +1,25 @@
+From eadf7d61294002e49566a5cad207a0418d5d5e51 Mon Sep 17 00:00:00 2001
+From: Jehan <jehan girinstud io>
+Date: Mon, 3 May 2021 19:57:54 +0200
+Subject: [PATCH] Introspection in verbose mode.
+
+DO NOT PUSH!
+---
+ babl/meson.build | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/babl/meson.build b/babl/meson.build
+index d19210a..c0f0e76 100644
+--- a/babl/meson.build
++++ b/babl/meson.build
+@@ -141,6 +141,7 @@ if build_gir
+   babl_gir = gnome.generate_gir(babl,
+     sources: babl_headers,
+     extra_args: [
++      '--verbose',
+       '--identifier-filter-cmd=@0@ @1@'.format(python.path(), 
+         meson.current_source_dir() / 'identfilter.py'),
+       '-DBABL_IS_BEING_COMPILED',
+-- 
+2.30.2
+


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