[gimp/wip/Jehan/CI-Windows: 16/18] build, gitlab-ci: add a script to cross-build GIMP with Gitlab CI.



commit 9f65b744aae85d7f60a1f030fc2f6fd704138c7a
Author: Jehan <jehan girinstud io>
Date:   Wed Sep 25 14:27:09 2019 +0200

    build, gitlab-ci: add a script to cross-build GIMP with Gitlab CI.
    
    It looks like Arch does not have mingw64 cross-compilers in core package
    repository. It does have some package in the user repository (AUR), but
    I assume that such a repository cannot be deemed as safe.
    
    Anyway I still tried, but apparently these AUR packages have to be built
    and when I tried, I got this error:
    >  ERROR: Running makepkg as root is not allowed as it can cause
    > permanent, catastrophic damage to your system.
    
    Anyway it's all a big mess. Then I tried to move the cross-CI to Debian
    testing, which is anyway our base compatibility system. Unfortunately I
    encountered like what looked like some glibc++ macro problem on some
    packages (most likely because the pre-built packages I use are Fedora
    ones which likely uses a cross-compiler differently built from the
    Debian one).
    
    So in the end, for simplicity, I use a Fedora image, then I am sure to
    get a good match between the system cross-compiler and the pre-built
    dependencies.

 .gitlab-ci.yml                        | 57 ++++++++++++++++++++++++
 build/windows/crossbuild-gitlab-ci.sh | 84 +++++++++++++++++++++++++++++++++++
 2 files changed, 141 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8e98a6889c..a3ba7a691a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,8 @@ variables:
 cache:
   paths:
   - _pacman_cache
+  - dnf_cache
+  - .cache/crossroad/
 
 .babl-base:
   stage: babl
@@ -217,3 +219,58 @@ build-git-meson:
 #   dependencies:
 #     - babl-min
 #     - gegl-min
+
+.gimp-x86_64-w64-mingw32-base:
+  image: fedora:30
+  stage: gimp
+  artifacts:
+    paths:
+    - "${INSTALL_DIR}"
+  before_script:
+    - dnf install --assumeyes --setopt=cachedir=`pwd`/dnf_cache --verbose
+        automake
+        autoconf
+        meson
+        cmake
+        gettext
+        git
+        gcc
+        gcc-c++
+        gperf
+        intltool
+        libtool
+        libxslt
+        make
+        python2
+        mingw64-gcc
+        mingw64-gcc-c++
+        mingw64-binutils
+        cpio rpm
+        python3-docutils
+        python3-pip
+        python3-setuptools
+        shared-mime-info
+        which
+        libmount-devel
+        gdk-pixbuf2
+        gdk-pixbuf2-devel
+        glib2-devel
+    #- pip3 install wheel
+    #- pip3 install crossroad
+    - git clone git://git.tuxfamily.org/gitroot/crossroad/crossroad.git
+    - cd crossroad
+    - ./setup.py install
+    - cd ..
+
+build-git-x86_64-w64-mingw32-meson:
+  extends: .gimp-x86_64-w64-mingw32-base
+  script:
+    - export SHELL
+    - crossroad w64 gimp --run="build/windows/crossbuild-gitlab-ci.sh"
+  artifacts:
+    name: "app-tests-logs-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
+    when: on_failure
+    expire_in: 1 week
+    paths:
+      - _deps/
+      - _build/
diff --git a/build/windows/crossbuild-gitlab-ci.sh b/build/windows/crossbuild-gitlab-ci.sh
new file mode 100644
index 0000000000..ed9e099685
--- /dev/null
+++ b/build/windows/crossbuild-gitlab-ci.sh
@@ -0,0 +1,84 @@
+mkdir _deps && cd _deps
+
+# babl
+
+crossroad install lcms2 && \
+git clone --depth 1 https://gitlab.gnome.org/GNOME/babl.git && cd babl && \
+crossroad meson _build/ -Denable-gir=false -Dwith-lcms=false && \
+ninja -C _build install || exit 1
+cd ..
+
+# GEGL
+
+crossroad install json-glib && \
+git clone --depth 1 https://gitlab.gnome.org/GNOME/gegl.git && cd gegl && \
+crossroad meson _build/ -Dintrospection=false -Dsdl2=disabled && \
+ninja -C _build install || exit 1
+cd ..
+
+# gexiv2
+
+crossroad install exiv2 && \
+git clone --depth 1 https://gitlab.gnome.org/GNOME/gexiv2.git && cd gexiv2 && \
+crossroad meson _build/ -Dintrospection=false -Dvapi=false && \
+ninja -C _build install || exit 1
+cd ..
+
+# appstream-glib
+
+crossroad install libsoup libarchive gdk-pixbuf && \
+git clone --depth 1 https://github.com/hughsie/appstream-glib.git && cd appstream-glib && \
+crossroad meson _build/ -Dintrospection=false -Drpm=false -Dbuilder=false \
+                        -Dstemmer=false -Dman=false -Ddep11=false && \
+ninja -C _build install || exit 1
+cd ..
+
+# json-c
+
+git clone --depth 1 https://github.com/json-c/json-c.git && \
+mkdir json-c/_build && cd json-c/_build && \
+CFLAGS="-Wno-expansion-to-defined" crossroad ../configure && make install || exit 1
+cd ../..
+
+# libmypaint
+
+git clone --depth 1 --branch libmypaint-v1 https://github.com/mypaint/libmypaint.git && \
+mkdir libmypaint/_build && cd libmypaint/_build && \
+crossroad ../configure --enable-introspection=no && make install || exit 1
+cd ../..
+
+# mypaint-brushes
+
+git clone --depth 1 --branch v1.3.x https://github.com/mypaint/mypaint-brushes.git
+mkdir mypaint-brushes/_build && cd mypaint-brushes/_build
+crossroad ../configure && make install || exit 1
+cd ../..
+
+# poppler-data
+
+git clone --depth 1 https://anongit.freedesktop.org/git/poppler/poppler-data.git && \
+mkdir poppler-data/_build && cd poppler-data/_build && \
+crossroad cmake .. && make install || exit 1
+cd ../..
+
+# Glib (available in crossroad but bumped Pango needs higher version)
+
+git clone --depth 1 https://gitlab.gnome.org/GNOME/glib.git && cd glib && \
+crossroad meson _build && ninja -C _build install || exit 1
+which glib-compile-resources
+rm -fr $CROSSROAD_PREFIX/bin/glib-compile-resources*
+cd ..
+
+# Pango (available in crossroad but too old)
+
+crossroad install harfbuzz && \
+git clone --depth 1 https://gitlab.gnome.org/GNOME/pango.git && cd pango && \
+crossroad meson _build -Dintrospection=false && \
+ninja -C _build install || exit 1
+cd ..
+
+# GIMP
+
+crossroad install atk gtk3 libtiff xz-libs librsvg2 poppler-glib dbus-glib && \
+cd .. && mkdir _build && cd _build && \
+crossroad meson .. -Dwmf=disabled  -Dgtk-doc=false -Dpython=always -Dlua=always -Djavascript=always && ninja 
install


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