Skip to content

Commit

Permalink
aqtinstall docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
zjeffer committed Dec 27, 2023
1 parent 84b3a4c commit 351b696
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 49 deletions.
56 changes: 7 additions & 49 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,43 +204,22 @@ jobs:
appimage-aqtinstall:
name: AppImage (${{ matrix.build-type }}, Qt ${{ matrix.qt-version }}, ${{ matrix.container != '' && matrix.container || matrix.os }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
container: ubuntu:20.04
- os: ubuntu-22.04
build-type: release
qt-version: 5.15.2

- os: ubuntu-20.04
container: ubuntu:20.04
image: zjeffer/notes:ubuntu-aqtinstall-5.15.2

- os: ubuntu-22.04
build-type: release
qt-version: 6.4.3
image: zjeffer/notes:ubuntu-aqtinstall-6.4.3
steps:
- name: Install other dependencies in docker container
# - appstream: Used to validate the AppStream metadata file.
# - cmake: Used to help build the application.
# - curl: Used to download the linuxdeploy AppImage tool.
# - desktop-file-utils: Used to validate the desktop file.
# - git: To clone this repository.
# - libfontconfig1: Used as dependency of the resulting AppImage.
# - libxcb-cursor0: Used as dependency of the resulting AppImage.
# - libxkbcommon-x11-0: Used as dependency of the resulting AppImage.
# - python3/python3-pip: Used by aqtinstall.
# - sudo: Used by most GitHub actions to install things.
if: matrix.container != ''
run: |
# Configure the timezone, otherwise 'install-qt-action' gets stuck at 'configuring tzdata'.
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
echo UTC > /etc/timezone
# install packages
apt update
apt install -y appstream cmake curl desktop-file-utils git libfontconfig1 libxcb-cursor0 libxkbcommon-x11-0 python3 python3-pip sudo
# Upgrade to the latest setuptools, as Ubuntu's python3-setuptools package has compatibility issues with aqtinstall.
python3 -m pip install --upgrade setuptools
- name: Checkout code
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -272,21 +251,6 @@ jobs:
echo "artifact_name=${artifact_name}" >> "${GITHUB_OUTPUT}"
echo "file_name=${file_name}" >> "${GITHUB_OUTPUT}"
- name: Install Qt ${{ matrix.qt-version }} (aqtinstall)
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt-version }}
# Prevents the installation of a custom Python build, potentially linked against an unsupported version of glibc.
setup-python: false
cache: true

- name: Install Qt 6 system dependencies
# 'libmysqlclient21' is actually only needed by linuxdeploy for Qt 6 builds. I'm including it here just for convenience.
if: startsWith(matrix.qt-version, '6.')
run: |
sudo apt update
sudo apt install -y libxkbcommon-dev libmysqlclient21
# TODO: Figure out why this error only occurs on the Linux container when building with -DGIT_REVISION=ON
# The error: fatal: detected dubious ownership in repository
- name: Prevent git's dubious ownership message
Expand Down Expand Up @@ -327,12 +291,6 @@ jobs:
curl -fLO --retry 10 https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
- name: Install useless dependencies to make linuxdeploy happy
# We won't use any of these sql drivers, but install them anyway so linuxdeploy doesn't fail.
run: |
sudo apt update
sudo apt install -y libpq5 libodbc1
- name: Deploy (${{ matrix.build-type }})
env:
APPIMAGE_EXTRACT_AND_RUN: 1
Expand Down
14 changes: 14 additions & 0 deletions Dockerfiles/ubuntu-aqtinstall-5.15.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:22.04

# this image can also be used for appimage builds
# Configure the timezone, otherwise 'install-qt-action' gets stuck at 'configuring tzdata'.
RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime \
&& echo UTC > /etc/timezone

# install packages
RUN apt update && \
apt install -y appstream cmake curl desktop-file-utils git libfontconfig1 libxcb-cursor0 libxkbcommon-x11-0 python3 python3-pip sudo
RUN python3 -m pip install --upgrade pip setuptools aqtinstall

# use aqtinstall to install Qt
RUN aqt install 5.15.2
32 changes: 32 additions & 0 deletions Dockerfiles/ubuntu-aqtinstall-6.4.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:22.04

ENV QT_VERSION=6.4.3

# this image can also be used for appimage builds
# Configure the timezone, otherwise 'install-qt-action' gets stuck at 'configuring tzdata'.
RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime \
&& echo UTC > /etc/timezone

# install packages
# - appstream: Used to validate the AppStream metadata file.
# - cmake: Used to help build the application.
# - curl: Used to download the linuxdeploy AppImage tool.
# - desktop-file-utils: Used to validate the desktop file.
# - git: To clone this repository.
# - libfontconfig1: Used as dependency of the resulting AppImage.
# - libxcb-cursor0: Used as dependency of the resulting AppImage.
# - libxkbcommon-x11-0: Used as dependency of the resulting AppImage.
# - python3/python3-pip: Used by aqtinstall.
# - sudo: Used by most GitHub actions to install things.
# - libpq5: Useless, but needed to keep linuxdeploy happy
# - libodbc1: Useless, but needed to keep linuxdeploy happy
RUN apt update && \
apt install -y appstream cmake curl desktop-file-utils git libfontconfig1 libxcb-cursor0 libxkbcommon-x11-0 python3 python3-pip sudo \
libpq5 libodbc1
RUN python3 -m pip install --upgrade pip setuptools aqtinstall

# qt6 dependencies
RUN apt install -y libxkbcommon-dev libmysqlclient21

# use aqtinstall to install qt
RUN aqt install $QT_VERSION linux desktop

0 comments on commit 351b696

Please sign in to comment.