Skip to content

Commit

Permalink
Merge pull request Framstag#1300 from Framstag/minimal_qt6_build
Browse files Browse the repository at this point in the history
Qt6 support: Add a minimal Qt6 based build
  • Loading branch information
Framstag authored Sep 17, 2022
2 parents 241a385 + 0e5219e commit 019ef06
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build_and test_on_ubuntu_22_04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,28 @@ jobs:
env:
QT_QPA_PLATFORM: offscreen
working-directory: build

build_gcc_meson_qt6:
name: gcc and meson with Qt6
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install software-properties-common
run: sudo apt-get install software-properties-common
- name: Install gcc compiler, meson and ninja
run: sudo apt-get -y install gcc-12 g++-12 libtbb-dev ccache libtool pkg-config meson ninja-build
- name: Install libosmscout dependencies
run: "sudo apt-get update && sudo apt-get install -y
qmake6 libqt6svg6-dev libqt6core5compat6-dev qt6-declarative-dev qt6-positioning-dev qt6-tools-dev-tools
qt6-l10n-tools qt6-tools-dev qt6-multimedia-dev
libgl-dev"
- name: Configure build project
run: PATH=/usr/lib/qt6/bin:/usr/lib/qt6/libexec:$PATH meson setup --buildtype debugoptimized --unity on --wrap-mode=nofallback -D qtVersion=6 debug
env:
CXX: g++-12
CC: gcc-12
- name: Build project
run: ninja -C debug
- name: Run tests
run: meson test -C debug --print-errorlogs
2 changes: 1 addition & 1 deletion Tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ if buildMapCairo or buildMapQt or buildMapAgg or buildMapOpenGL
deps = [mathDep, openmpDep]
links = [osmscout, osmscoutmap]

if buildMapCairo and pangocairoDep.found()
if buildMapCairo
includes += osmscoutmapcairoIncDir
deps += pangocairoDep
links += osmscoutmapcairo
Expand Down
1 change: 1 addition & 0 deletions ci/docker/buildAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ set -xe
./debian_bullseye_gcc_meson/build.sh
./ubuntu_20.04_gcc_cmake/build.sh
./ubuntu_22.04_gcc_cmake/build.sh
./ubuntu_22.04_gcc_meson_qt6/build.sh
./ubuntu_22.04_aarch64_gcc_cmake/build.sh
8 changes: 7 additions & 1 deletion ci/docker/runAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ RESULT_ubuntu_20_04_gcc_cmake=$?
./ubuntu_22.04_gcc_cmake/run.sh "$@"
RESULT_ubuntu_22_04_gcc_cmake=$?

./ubuntu_22.04_gcc_meson_qt6/run.sh "$@"
RESULT_ubuntu_22_04_gcc_meson_qt6=$?

./ubuntu_22.04_aarch64_gcc_cmake/run.sh "$@"
RESULT_ubuntu_22_04_aarch64_gcc_cmake=$?

# print results
set +x
echo
echo

echo -ne "archlinux_clang_cmake "
if [ $RESULT_archlinux_clang_cmake -eq 0 ] ; then echo "OK"; else echo "FAILURE"; fi
Expand All @@ -51,5 +54,8 @@ if [ $RESULT_ubuntu_20_04_gcc_cmake -eq 0 ] ; then echo "OK"; else echo "FA
echo -ne "ubuntu_22.04_gcc_cmake "
if [ $RESULT_ubuntu_22_04_gcc_cmake -eq 0 ] ; then echo "OK"; else echo "FAILURE"; fi

echo -ne "ubuntu_22.04_gcc_meson_qt6 "
if [ $RESULT_ubuntu_22_04_gcc_meson_qt6 -eq 0 ] ; then echo "OK"; else echo "FAILURE"; fi

echo -ne "ubuntu_22.04_aarch64_gcc_cmake "
if [ $RESULT_ubuntu_22_04_aarch64_gcc_cmake -eq 0 ] ; then echo "OK"; else echo "FAILURE"; fi
29 changes: 29 additions & 0 deletions ci/docker/ubuntu_22.04_gcc_meson_qt6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM ubuntu:jammy

# disable interactive functions
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y \
git make libtool pkg-config \
qmake6 libqt6svg6-dev libqt6core5compat6-dev qt6-declarative-dev qt6-positioning-dev qt6-tools-dev-tools \
qt6-l10n-tools qt6-tools-dev qt6-multimedia-dev \
libgl-dev \
locales \
&& rm -rf /var/lib/apt/lists/*

RUN locale-gen en_US.UTF-8
ENV LANG en_US.utf8
ENV QT_QPA_PLATFORM offscreen

RUN apt-get update && apt-get install -y \
meson \
g++ \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /work

COPY data/build.sh /work
RUN chmod +x /work/build.sh

WORKDIR /work
CMD ./build.sh
3 changes: 3 additions & 0 deletions ci/docker/ubuntu_22.04_gcc_meson_qt6/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd `dirname $0`
docker build -t libosmscout/ubuntu_22.04_gcc_meson_qt6 .
24 changes: 24 additions & 0 deletions ci/docker/ubuntu_22.04_gcc_meson_qt6/data/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
set -e

if [ $# -ge 1 ] ; then
REPO="$1"
else
REPO="https://github.com/Framstag/libosmscout.git"
fi

if [ $# -ge 2 ] ; then
BRANCH="$2"
else
BRANCH="master"
fi

git clone -b "$BRANCH" "$REPO" libosmscout

export LANG=en_US.utf8
cd libosmscout
mkdir debug
PATH=/usr/lib/qt6/bin:/usr/lib/qt6/libexec:$PATH meson setup --buildtype debugoptimized --unity on --wrap-mode=nofallback -D qtVersion=6 debug
ninja -C debug
meson test -C debug --print-errorlogs

3 changes: 3 additions & 0 deletions ci/docker/ubuntu_22.04_gcc_meson_qt6/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

docker run --rm=true -it libosmscout/ubuntu_22.04_gcc_meson_qt6 ./build.sh "$@"

0 comments on commit 019ef06

Please sign in to comment.