Exit 1
}
-.debian-build:
+.unix-host-build:
stage: build
- image: "debian:bullseye-slim"
cache:
key: ${CI_JOB_NAME}
paths:
- chown -R user .
- runuser -u user ./tools/ci-build.sh
+.debian-build:
+ extends: .unix-host-build
+ image: "debian:bullseye-slim"
+
debian autotools production:
extends: .debian-build
variables:
variables:
ci_suite: "buster"
+.suse-build:
+ extends: .unix-host-build
+ image: "opensuse/leap:15"
+ variables:
+ ci_distro: "opensuse"
+
+opensuse cmake:
+ extends: .suse-build
+ variables:
+ ci_buildsys: "cmake"
+ ci_local_packages: "no"
+
+opensuse mingw32 cmake:
+ extends: .suse-build
+ when: manual
+ variables:
+ ci_buildsys: "cmake"
+ ci_host: "i686-w64-mingw32"
+ ci_local_packages: "no"
+
+opensuse mingw64 cmake debug:
+ extends: .suse-build
+ variables:
+ ci_buildsys: "cmake"
+ ci_host: "x86_64-w64-mingw32"
+ ci_local_packages: "no"
+ ci_variant: "debug"
+
.win-build:
image: $WINDOWS_IMAGE
stage: build
(cmake|cmake-dist)
cmdwrapper=
+ cmake=cmake
case "$ci_host" in
(*-w64-mingw32)
# CFLAGS and CXXFLAGS does do work, checked with cmake 3.15
export LDFLAGS="-${ci_runtime}-libgcc"
# enable tests if supported
if [ "$ci_test" = yes ]; then
+ # choose correct wine architecture
+ if [ "${ci_distro}" = opensuse ]; then
+ if [ "${ci_host%%-*}" = x86_64 ]; then
+ export WINEARCH=win64
+ cmake=mingw64-cmake
+ else
+ cmake=mingw32-cmake
+ fi
+ fi
libgcc_path=
if [ "$ci_runtime" = "shared" ]; then
libgcc_path=$(dirname "$("${ci_host}-gcc" -print-libgcc-file-name)")
cmdwrapper="xvfb-run -a"
fi
set _ "$@"
- set "$@" -D CMAKE_TOOLCHAIN_FILE="${srcdir}/cmake/${ci_host}.cmake"
+ if [ "$ci_distro" != "opensuse" ]; then
+ set "$@" -D CMAKE_TOOLCHAIN_FILE="${srcdir}/cmake/${ci_host}.cmake"
+ fi
set "$@" -D CMAKE_PREFIX_PATH="${dep_prefix}"
if [ "$ci_local_packages" = yes ]; then
set "$@" -D CMAKE_INCLUDE_PATH="${dep_prefix}/include"
;;
esac
- cmake "$@" -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_WERROR=ON ..
+ $cmake "$@" -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_WERROR=ON ..
${make}
# The test coverage for OOM-safety is too verbose to be useful on
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopasswd
chmod 0440 /etc/sudoers.d/nopasswd
fi
+ ;;
+
+ (opensuse)
+ zypper="/usr/bin/zypper --non-interactive"
+ # system
+ packages=(
+ sudo
+ )
+
+ # build system
+ packages=(
+ "${packages[@]}"
+ autoconf
+ autoconf-archive
+ automake
+ cmake
+ libtool
+ )
+
+ # docs
+ packages=(
+ "${packages[@]}"
+ docbook_4
+ docbook-xsl-stylesheets
+ doxygen
+ libqt5-qttools
+ libxslt-tools
+ yelp-tools
+ )
+
+ # dbus (autogen.sh)
+ packages=(
+ "${packages[@]}"
+ which
+ )
+
+ case "$ci_host" in
+ (*-w64-mingw32)
+ # cross
+ packages=(
+ "${packages[@]}"
+ wine
+ xvfb-run
+ )
+
+ # choose distribution
+ id=$(. /etc/os-release; echo ${ID} | sed 's, ,_,g')
+ case "$id" in
+ (opensuse-leap)
+ version=$(. /etc/os-release; echo ${VERSION_ID} | sed 's, ,_,g')
+ repo="openSUSE_Leap_$version"
+ ;;
+ (opensuse-tumbleweed)
+ repo="openSUSE_Tumbleweed"
+ ;;
+ (*)
+ echo "ci_suite not specified, please choose one from 'leap' or 'tumbleweed'"
+ exit 1
+ ;;
+ esac
+
+ # add required repos
+ if [ "${ci_host%%-*}" = x86_64 ]; then
+ bits="64"
+ else
+ bits="32"
+ fi
+ (
+ p=$(zypper lr | grep "windows_mingw_win${bits}" || true)
+ if [ -z "$p" ]; then
+ $zypper ar --refresh --no-gpgcheck \
+ "https://download.opensuse.org/repositories/windows:/mingw:/win${bits}/$repo/windows:mingw:win${bits}.repo"
+ fi
+ )
+ packages=(
+ "${packages[@]}"
+ mingw${bits}-cross-gcc-c++
+ mingw${bits}-libexpat-devel
+ mingw${bits}-glib2-devel
+ )
+ ;;
+
+ (*)
+ packages=(
+ "${packages[@]}"
+ gcc-c++
+ libexpat-devel
+ glib2-devel
+ libX11-devel
+ systemd-devel
+ )
+ ;;
+ esac
+ $zypper install "${packages[@]}"
+
+ if [ "$ci_in_docker" = yes ]; then
+ # Add the user that we will use to do the build inside the
+ # Docker container, and let them use sudo
+ useradd -m user
+ passwd -ud user
+ echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopasswd
+ chmod 0440 /etc/sudoers.d/nopasswd
+ fi
+ ;;
+esac
+
+#
+# manual package setup
+#
+case "$ci_distro" in
+ (debian|ubuntu)
# Make sure we have a messagebus user, even if the dbus package
# isn't installed
--disabled-password --group messagebus
;;
+ (opensuse)
+ # test-bus depends on group 'bin'
+ $sudo getent group bin >/dev/null || /usr/sbin/groupadd -r bin
+ ;;
+
(*)
echo "Don't know how to set up ${ci_distro}" >&2
exit 1