[gimp/wip/Jehan/gitlab-ci-win-32-bit: 1/5] gitlab-ci, build: construct the Windows installer from CI.




commit 5fceedaedd93d7837789649a86663e45d40bebac
Author: Jehan <jehan girinstud io>
Date:   Tue May 11 16:13:51 2021 +0200

    gitlab-ci, build: construct the Windows installer from CI.
    
    Run InnoSetup in the Windows CI to build the installer from both the 32
    and 64-bit builds.
    - Test installer existence at the end for return value (otherwise even
      if installer construction fails, the compile.bat script does not
      forward well the error status).
    
    Current limitations:
    - No installer signature yet.
    - Dependencies will have to be checked more thoroughly.
    - Apart from babl and GEGL, we may want to make custom builds of any
      package which has a patch in build/windows/patches/ (Windows-specific
      patches) and build/patches/ (all platform patches).
    - Plug-in interpreters (Python, Lua…) don't work. This will need to be
      looked at in detail.
    
    Globally this first automated installer build works fine though, as I
    could install it in a Windows 10 VM and GIMP ran fine.

 .gitlab-ci.yml                                  | 32 ++++++++++++++++++-------
 build/windows/gitlab-ci/build-gimp-msys2.sh     | 20 ++++++++++++----
 build/windows/gitlab-ci/installer-gimp-msys2.sh | 13 ++++++----
 build/windows/gitlab-ci/package-gimp-msys2.sh   | 15 ++++++++----
 build/windows/gitlab-ci/test-innosetup-msys2.sh | 10 ++++++++
 build/windows/installer/32on64.list             |  3 +--
 build/windows/installer/files.isi               |  2 ++
 7 files changed, 73 insertions(+), 22 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ec3343ee63..49d8ddfff8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,24 @@ variables:
   INSTALL_PREFIX: "${CI_PROJECT_DIR}/${INSTALL_DIR}"
   APT_CACHE: "${CI_PROJECT_DIR}/apt-cache"
 
+test-innosetup:
+  variables:
+    CHERE_INVOKING: "yes"
+  tags:
+    - win32-ps
+  stage: prepare
+  artifacts:
+    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
+    when: always
+    expire_in: 2 days
+    paths:
+    - build/windows/installer/_Output
+    - is.exe
+    - innosetup.log
+  script:
+    - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
+    - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/test-innosetup-msys2.sh"
+
 ## prepare docker images ##
 
 build-image:
@@ -78,7 +96,6 @@ build-image-win32:
 
     - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination 
$CI_REGISTRY_IMAGE:build-win32-latest --cache=true --cache-ttl=120h
 
-
 ## GNU/Linux 64-bit CIs (Debian testing) ##
 
 deps-debian:
@@ -234,7 +251,8 @@ gimp-win64-native:
     expire_in: 1 day
     paths:
     - _install-w64
-    - _build-w64
+    - build/windows/installer/lang/
+    #- _build-w64
   cache:
     paths:
     - _ccache/
@@ -280,7 +298,7 @@ gimp-win32-native:
     expire_in: 1 day
     paths:
     - _install-w32
-    - _build-w32
+    #- _build-w32
   cache:
     paths:
     - _ccache/
@@ -457,12 +475,10 @@ win-installer-nightly:
     #- gimp-w64
   script:
     - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
-    - set MSYSTEM=MINGW64
-    - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/package-gimp-msys2.sh"
-    - set MSYSTEM=MINGW32
-    - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/package-gimp-msys2.sh"
+    - C:\msys64\usr\bin\bash -lc "MSYSTEM=MINGW64 bash -x ./build/windows/gitlab-ci/package-gimp-msys2.sh"
+    - C:\msys64\usr\bin\bash -lc "MSYSTEM=MINGW32 bash -x ./build/windows/gitlab-ci/package-gimp-msys2.sh"
     - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/installer-gimp-msys2.sh"
-
+    - [ -f "build/windows/installer/_Output/gimp-2.99.6-setup.exe" ]
   needs: ["gimp-win32-native", "gimp-win64-native"]
 
 sources:
diff --git a/build/windows/gitlab-ci/build-gimp-msys2.sh b/build/windows/gitlab-ci/build-gimp-msys2.sh
index 42ae685b08..13998f5808 100644
--- a/build/windows/gitlab-ci/build-gimp-msys2.sh
+++ b/build/windows/gitlab-ci/build-gimp-msys2.sh
@@ -32,11 +32,17 @@ rm -f /c/msys64/mingw64/bin/gdk-pixbuf-pixdata.exe
 rm -f /c/msys64/mingw64/bin/libgdk_pixbuf-2.0-0.dll
 rm -f /c/msys64/mingw64/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.dll
 
+# Ok so it seems that the runner is too full. I am still unsure what is
+# the re-usage logics of runners. Are they just re-used as-is between
+# projects? Do we have to remove installed package ourselves?
+# This trick of removing installed packages comes from Archlinux wiki.
+#pacman -D --asdeps $(pacman -Qqe)
+#pacman -Qtdq | pacman -Rns -
+
 # Update everything
 pacman --noconfirm -Suy
 
-# Install the required packages
-pacman --noconfirm -S --needed \
+export PACKAGES=" \
     base-devel \
     mingw-w64-$MSYS2_ARCH-toolchain \
     mingw-w64-$MSYS2_ARCH-ccache \
@@ -71,11 +77,14 @@ pacman --noconfirm -S --needed \
     mingw-w64-$MSYS2_ARCH-pango \
     mingw-w64-$MSYS2_ARCH-poppler \
     mingw-w64-$MSYS2_ARCH-poppler-data \
-    mingw-w64-$MSYS2_ARCH-python3-gobject \
+    mingw-w64-$MSYS2_ARCH-python-gobject \
     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-xpm-nox"
+
+# Install the required packages
+pacman --noconfirm -S --needed ${PACKAGES}
 
 # XXX We've got a weird error when the prefix is in the current dir.
 # Until we figure it out, this trick seems to work, even though it's
@@ -109,3 +118,6 @@ ccache --show-stats
 
 # XXX Moving back the prefix to be used as artifacts.
 mv "${GIMP_PREFIX}" .
+
+# Uninstall the packages to avoid disk space issues in the CI.
+#pacman --noconfirm --remove ${PACKAGES}
diff --git a/build/windows/gitlab-ci/installer-gimp-msys2.sh b/build/windows/gitlab-ci/installer-gimp-msys2.sh
index 6d9663a53e..7f0a3b4d3d 100644
--- a/build/windows/gitlab-ci/installer-gimp-msys2.sh
+++ b/build/windows/gitlab-ci/installer-gimp-msys2.sh
@@ -1,8 +1,13 @@
 wget https://jrsoftware.org/download.php/is.exe
-./is.exe //VERYSILENT //SUPPRESSMSGBOXES //ALLUSERS
-ls "/c/Program Files (x86)/Inno Setup 6/Languages"
-mkdir "/c/Program Files (x86)/Inno Setup 6/Languages/Unofficial"
-cd "/c/Program Files (x86)/Inno Setup 6/Languages/Unofficial"
+#./is.exe //VERYSILENT //SUPPRESSMSGBOXES //ALLUSERS //LOG="innosetup.log"
+./is.exe //SILENT //SUPPRESSMSGBOXES //CURRENTUSER //SP- //LOG="innosetup.log"
+ISCCDIR=`grep "Dest filename:.*ISCC.exe" innosetup.log | sed 's/.*Dest filename: *\|ISCC.exe//g'`
+echo "Inno Setup installed in $ISCCDIR"
+ISCCDIR=`cygpath -u "$ISCCDIR"`
+echo "Inno Setup installed in $ISCCDIR"
+ls "$ISCCDIR"
+mkdir -p "${ISCCDIR}/Languages/Unofficial"
+cd "${ISCCDIR}/Languages/Unofficial"
 wget https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/Basque.isl
 wget https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseSimplified.isl
 wget 
https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseTraditional.isl
diff --git a/build/windows/gitlab-ci/package-gimp-msys2.sh b/build/windows/gitlab-ci/package-gimp-msys2.sh
index 7f11c30913..8bc8364a60 100644
--- a/build/windows/gitlab-ci/package-gimp-msys2.sh
+++ b/build/windows/gitlab-ci/package-gimp-msys2.sh
@@ -2,6 +2,8 @@
 
 set -e
 
+echo "MSYSTEM: '$MSYSTEM'"
+
 if [[ "$MSYSTEM" == "MINGW32" ]]; then
     export ARTIFACTS_SUFFIX="-w32"
     export MSYS2_ARCH="i686"
@@ -35,8 +37,7 @@ rm -f /c/msys64/mingw64/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.dl
 # Update everything
 pacman --noconfirm -Suy
 
-# Install the required packages
-pacman --noconfirm -S --needed \
+export PACKAGES=" \
     base-devel \
     mingw-w64-$MSYS2_ARCH-binutils \
     mingw-w64-$MSYS2_ARCH-toolchain \
@@ -72,11 +73,14 @@ pacman --noconfirm -S --needed \
     mingw-w64-$MSYS2_ARCH-pango \
     mingw-w64-$MSYS2_ARCH-poppler \
     mingw-w64-$MSYS2_ARCH-poppler-data \
-    mingw-w64-$MSYS2_ARCH-python3-gobject \
+    mingw-w64-$MSYS2_ARCH-python-gobject \
     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-xpm-nox"
+
+# Install the required packages
+pacman --noconfirm -S --needed ${PACKAGES}
 
 export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}"
 export PATH="$GIMP_PREFIX/bin:$PATH"
@@ -215,3 +219,6 @@ for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/plug-ins/*/*.exe; do
   python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
   python3 build/windows/gitlab-ci/dll_link.py $dll ${MSYS_PREFIX}/ ${GIMP_DISTRIB};
 done
+
+# Uninstall the packages to avoid disk space issues in the CI.
+#pacman --noconfirm --remove ${PACKAGES}
diff --git a/build/windows/gitlab-ci/test-innosetup-msys2.sh b/build/windows/gitlab-ci/test-innosetup-msys2.sh
new file mode 100644
index 0000000000..ac69060034
--- /dev/null
+++ b/build/windows/gitlab-ci/test-innosetup-msys2.sh
@@ -0,0 +1,10 @@
+wget https://jrsoftware.org/download.php/is.exe
+./is.exe //SILENT //SUPPRESSMSGBOXES //CURRENTUSER //SP- //LOG="innosetup.log"
+ISCCDIR=`grep "Dest filename:.*ISCC.exe" innosetup.log | sed 's/.*Dest filename: *\|ISCC.exe//g'`
+echo "Inno Setup installed in $ISCCDIR"
+ISCCDIR=`cygpath -u "$ISCCDIR"`
+echo "Inno Setup installed in $ISCCDIR"
+mkdir -p "${ISCCDIR}/Languages/Unofficial"
+cd "${ISCCDIR}/Languages/Unofficial"
+#cd build/windows/installer
+#./compile.bat 2.99.6 ../../.. gimp-w32 gimp-w64 ../../.. gimp-w32 gimp-w64
diff --git a/build/windows/installer/32on64.list b/build/windows/installer/32on64.list
index 5b421447b2..115a476569 100644
--- a/build/windows/installer/32on64.list
+++ b/build/windows/installer/32on64.list
@@ -1,9 +1,8 @@
 #list of 32bit files to install on x64
 !GTK
 etc\fonts\
-lib\gtk-2.0\2.10.0\engines\*.dll
 #lib\gtk-2.0\2.10.0\loaders\*.dll
-lib\gtk-2.0\modules\*.dll
+#lib\gtk-2.0\modules\*.dll
 lib\gdk-pixbuf-2.0\2.10.0\loaders\*.dll
 lib\gdk-pixbuf-2.0\2.10.0\loaders.cache
 lib\babl-0.1\*.dll
diff --git a/build/windows/installer/files.isi b/build/windows/installer/files.isi
index 71706cda06..7ae8c5e5ed 100644
--- a/build/windows/installer/files.isi
+++ b/build/windows/installer/files.isi
@@ -18,7 +18,9 @@ Source: "{#GIMP_DIR}\{#DIR}\*.exe"; DestDir: "{app}"; Excludes: "\lib\gimp\{#DIR
 Source: "{#GIMP_DIR}\{#DIR}\*.debug"; DestDir: "{app}"; Components: gimp{#PLATFORM} and debug; Flags: 
recursesubdirs restartreplace uninsrestartdelete ignoreversion
 #endif
 Source: "{#GIMP_DIR}\{#DIR}\lib\gimp\{#DIR_VER}\extensions\*.*"; Excludes: "*.debug"; DestDir: 
"{app}\lib\gimp\{#DIR_VER}\extensions"; Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete
+#ifdef DEBUG_SYMBOLS
 Source: "{#GIMP_DIR}\{#DIR}\lib\gimp\{#DIR_VER}\extensions\*.debug"; DestDir: 
"{app}\lib\gimp\{#DIR_VER}\extensions"; Components: debug; Flags: recursesubdirs restartreplace ignoreversion 
uninsrestartdelete
+#endif
 
 Source: "{#GIMP_DIR}\{#DIR}\lib\gimp\{#DIR_VER}\plug-ins\file-ps\file-ps.exe"; DestDir: 
"{app}\lib\gimp\{#DIR_VER}\plug-ins\file-ps"; Components: gs and gimp{#PLATFORM}; Flags: restartreplace 
ignoreversion uninsrestartdelete
 


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