# See ci-install.sh
: "${ci_host:=native}"
+# ci_local_packages:
+# prefer local packages instead of distribution
+# See ci-install.sh
+: "${ci_local_packages:=yes}"
+
# ci_parallel:
# A number of parallel jobs, passed to make -j
: "${ci_parallel:=1}"
#
case "$ci_host" in
(*-w64-mingw32)
- if [ "${ci_host%%-*}" = i686 ]; then
- mingw="$(pwd)/mingw32"
+ if [ "$ci_local_packages" = yes ]; then
+ dep_prefix=$(pwd)/${ci_host}-prefix
else
- mingw="$(pwd)/mingw64"
+ # assume the compiler was configured with a sysroot (e.g. openSUSE)
+ sysroot=$("${ci_host}-gcc" --print-sysroot)
+ # check if the prefix is a subdir of sysroot (e.g. openSUSE)
+ if [ -d "${sysroot}/${ci_host}" ]; then
+ dep_prefix="${sysroot}/${ci_host}"
+ else
+ # fallback: assume the dependency libraries were built with --prefix=/${ci_host}
+ dep_prefix="/${ci_host}"
+ export PKG_CONFIG_SYSROOT_DIR="${sysroot}"
+ fi
fi
- export PKG_CONFIG_LIBDIR="${mingw}/lib/pkgconfig"
+
+ export PKG_CONFIG_LIBDIR="${dep_prefix}/lib/pkgconfig"
export PKG_CONFIG_PATH=
- export PKG_CONFIG="pkg-config --define-variable=prefix=${mingw}"
+ export PKG_CONFIG="pkg-config --define-variable=prefix=${dep_prefix}"
unset CC
unset CXX
export TMPDIR=/tmp
(*-w64-mingw32)
set _ "$@"
set "$@" -D CMAKE_TOOLCHAIN_FILE="${srcdir}/cmake/${ci_host}.cmake"
- set "$@" -D CMAKE_PREFIX_PATH="${mingw}"
- set "$@" -D CMAKE_INCLUDE_PATH="${mingw}/include"
- set "$@" -D CMAKE_LIBRARY_PATH="${mingw}/lib"
- set "$@" -D EXPAT_LIBRARY="${mingw}/lib/libexpat.dll.a"
- set "$@" -D GLIB2_LIBRARIES="${mingw}/lib/libglib-2.0.dll.a"
- set "$@" -D GOBJECT_LIBRARIES="${mingw}/lib/libgobject-2.0.dll.a"
- set "$@" -D GIO_LIBRARIES="${mingw}/lib/libgio-2.0.dll.a"
+ set "$@" -D CMAKE_PREFIX_PATH="${dep_prefix}"
+ if [ "$ci_local_packages" = yes ]; then
+ set "$@" -D CMAKE_INCLUDE_PATH="${dep_prefix}/include"
+ set "$@" -D CMAKE_LIBRARY_PATH="${dep_prefix}/lib"
+ set "$@" -D EXPAT_LIBRARY="${dep_prefix}/lib/libexpat.dll.a"
+ set "$@" -D GLIB2_LIBRARIES="${dep_prefix}/lib/libglib-2.0.dll.a"
+ set "$@" -D GOBJECT_LIBRARIES="${dep_prefix}/lib/libgobject-2.0.dll.a"
+ set "$@" -D GIO_LIBRARIES="${dep_prefix}/lib/libgio-2.0.dll.a"
+ fi
shift
# don't run tests yet, Wine needs Xvfb and more
# msys2 libraries
# (ci_docker is empty in this case).
: "${ci_in_docker:=no}"
+# ci_local_packages:
+# prefer local packages instead of distribution
+: "${ci_local_packages:=yes}"
+
# ci_suite:
# OS suite (release, branch) in which we are testing.
# Typical values for ci_distro=debian: sid, jessie
;;
esac
- case "$ci_host" in
- (*-w64-mingw32)
- mirror=http://repo.msys2.org/mingw/${ci_host%%-*}
- if [ "${ci_host%%-*}" = i686 ]; then
- mingw="$(pwd)/mingw32"
- else
- mingw="$(pwd)/mingw64"
- fi
- install -d "${mingw}"
- for pkg in \
- bzip2-1.0.8-1 \
- expat-2.2.9-1 \
- gcc-libs-9.3.0-2 \
- gettext-0.19.8.1-8 \
- glib2-2.64.2-1 \
- iconv-1.16-1 \
- libffi-3.3-1 \
- libiconv-1.16-1 \
- libwinpthread-git-8.0.0.5814.9dbf4cc1-1 \
- pcre-8.44-1 \
- zlib-1.2.11-7 \
- ; do
- wget ${mirror}/mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.xz
- tar -xvf mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.xz
- done
-
- # limit access rights
- if [ "$ci_in_docker" = yes ]; then
- chown -R user "${mingw}"
- fi
- ;;
- esac
-
# Make sure we have a messagebus user, even if the dbus package
# isn't installed
$sudo adduser --system --quiet --home /nonexistent --no-create-home \
;;
esac
+if [ "$ci_local_packages" = yes ]; then
+ case "$ci_host" in
+ (*-w64-mingw32)
+ mirror=http://repo.msys2.org/mingw/${ci_host%%-*}
+ dep_prefix=$(pwd)/${ci_host}-prefix
+ install -d "${dep_prefix}"
+ for pkg in \
+ bzip2-1.0.8-1 \
+ expat-2.2.9-1 \
+ gcc-libs-9.3.0-2 \
+ gettext-0.19.8.1-8 \
+ glib2-2.64.2-1 \
+ iconv-1.16-1 \
+ libffi-3.3-1 \
+ libiconv-1.16-1 \
+ libwinpthread-git-8.0.0.5814.9dbf4cc1-1 \
+ pcre-8.44-1 \
+ zlib-1.2.11-7 \
+ ; do
+ wget ${mirror}/mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.xz
+ tar -C ${dep_prefix} --strip-components=1 -xvf mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.xz
+ done
+
+ # limit access rights
+ if [ "$ci_in_docker" = yes ]; then
+ chown -R user "${dep_prefix}"
+ fi
+ ;;
+ esac
+fi
+
# vim:set sw=4 sts=4 et: