mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Install Qt6 in CI runners and dev environments
Upgrade from Qt5 to Qt6 in our CI runners and dev environments, since the latest PySide6 versions do not support Qt5. This leaves only our Debian / Fedora packages relying on Qt5, since there's no PySide6 package for them yet. There are some caveats to the Qt6 upgrade: 1. Debian Bullseye has a missing dependency to `libgl1`, so we need to install it separately. 2. Ubuntu Jammy has a missing dependency to `libxkbcommon-x11-0`, which we have to install separately. 3. Ubuntu Focal does not have Qt6, but surprisingly PySide6 works with Qt5. 4. All Debian-based distros require `libxcb-cursor0`. As a side effect, we have to make our `env.py` a bit more complicated, to cater to these exceptions. Refs #482
This commit is contained in:
parent
77b380e7df
commit
26cf3db4b4
5 changed files with 34 additions and 18 deletions
|
@ -140,7 +140,7 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: Install test dependencies
|
name: Install test dependencies
|
||||||
command: |
|
command: |
|
||||||
sudo apt-get install -y libqt5gui5 --no-install-recommends
|
sudo apt-get install -y libqt5gui5 libxcb-cursor0 --no-install-recommends
|
||||||
- run:
|
- run:
|
||||||
name: Prepare cache directory
|
name: Prepare cache directory
|
||||||
command: |
|
command: |
|
||||||
|
|
6
BUILD.md
6
BUILD.md
|
@ -5,7 +5,7 @@
|
||||||
Install dependencies:
|
Install dependencies:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo apt install -y podman dh-python build-essential fakeroot make libqt5gui5 \
|
sudo apt install -y podman dh-python build-essential fakeroot make libqt6gui6 \
|
||||||
pipx python3 python3-dev python3-stdeb python3-all
|
pipx python3 python3-dev python3-stdeb python3-all
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ Create a .deb:
|
||||||
Install dependencies:
|
Install dependencies:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo dnf install -y rpm-build podman python3 pipx qt5-qtbase-gui
|
sudo dnf install -y rpm-build podman python3 pipx qt6-qtbase-gui
|
||||||
```
|
```
|
||||||
|
|
||||||
Install Poetry using `pipx`:
|
Install Poetry using `pipx`:
|
||||||
|
@ -174,7 +174,7 @@ specified qubes.
|
||||||
1. Install dependencies:
|
1. Install dependencies:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo dnf install -y rpm-build pipx qt5-qtbase-gui libreoffice python3-magic \
|
sudo dnf install -y rpm-build pipx qt6-qtbase-gui libreoffice python3-magic \
|
||||||
tesseract*
|
tesseract*
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ since 0.4.1, and this project adheres to [Semantic Versioning](https://semver.or
|
||||||
- Platform support: Ubuntu 23.04 (Lunar Lobster)
|
- Platform support: Ubuntu 23.04 (Lunar Lobster)
|
||||||
- Inform about new updates on MacOS/Windows platforms, by periodically checking
|
- Inform about new updates on MacOS/Windows platforms, by periodically checking
|
||||||
our GitHub releases page ([issue #189](https://github.com/freedomofpress/dangerzone/issues/189))
|
our GitHub releases page ([issue #189](https://github.com/freedomofpress/dangerzone/issues/189))
|
||||||
|
- Development: Use Qt6 in our CI runners and dev environments ([issue #482](https://github.com/freedomofpress/dangerzone/issues/482))
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|
|
@ -64,9 +64,9 @@ RUN apt-get update \
|
||||||
&& apt-get install -y python-all curl wget gnupg2 \
|
&& apt-get install -y python-all curl wget gnupg2 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
RUN . /etc/os-release \
|
RUN . /etc/os-release \
|
||||||
&& sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' \
|
&& sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$VERSION_ID/ /' \
|
||||||
> /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" \
|
> /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" \
|
||||||
&& wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- \
|
&& wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_$VERSION_ID/Release.key -O- \
|
||||||
| apt-key add -
|
| apt-key add -
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ RUN apt-get update \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends dh-python make build-essential \
|
&& apt-get install -y --no-install-recommends dh-python make build-essential \
|
||||||
fakeroot libqt5gui5 pipx python3 python3-dev python3-venv python3-stdeb \
|
fakeroot {qt_deps} pipx python3 python3-dev python3-venv python3-stdeb \
|
||||||
python3-all \
|
python3-all \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
# NOTE: `pipx install poetry` fails on Ubuntu Focal, when installed through APT. By
|
# NOTE: `pipx install poetry` fails on Ubuntu Focal, when installed through APT. By
|
||||||
|
@ -108,7 +108,7 @@ RUN apt-get update \
|
||||||
|
|
||||||
# FIXME: Install Poetry on Fedora via package manager.
|
# FIXME: Install Poetry on Fedora via package manager.
|
||||||
DOCKERFILE_BUILD_DEV_FEDORA_DEPS = r"""
|
DOCKERFILE_BUILD_DEV_FEDORA_DEPS = r"""
|
||||||
RUN dnf install -y rpm-build podman python3 python3-setuptools pipx make qt5-qtbase-gui \
|
RUN dnf install -y rpm-build podman python3 python3-setuptools pipx make qt6-qtbase-gui \
|
||||||
&& dnf clean all
|
&& dnf clean all
|
||||||
|
|
||||||
# FIXME: Drop this fix after it's resolved upstream.
|
# FIXME: Drop this fix after it's resolved upstream.
|
||||||
|
@ -407,16 +407,31 @@ class Env:
|
||||||
"""Build a Linux environment and install tools for Dangerzone development."""
|
"""Build a Linux environment and install tools for Dangerzone development."""
|
||||||
if self.distro == "fedora":
|
if self.distro == "fedora":
|
||||||
install_deps = DOCKERFILE_BUILD_DEV_FEDORA_DEPS
|
install_deps = DOCKERFILE_BUILD_DEV_FEDORA_DEPS
|
||||||
elif self.distro == "ubuntu" and self.version in ("20.04", "focal"):
|
else:
|
||||||
|
# Use Qt6 in all of our Linux dev environments, and add a missing
|
||||||
|
# libxcb-cursor0 dependency
|
||||||
|
#
|
||||||
|
# See https://github.com/freedomofpress/dangerzone/issues/482
|
||||||
|
qt_deps = "libqt6gui6 libxcb-cursor0"
|
||||||
|
install_deps = DOCKERFILE_BUILD_DEV_DEBIAN_DEPS
|
||||||
|
if self.distro == "ubuntu" and self.version in ("20.04", "focal"):
|
||||||
|
qt_deps = "libqt5gui5 libxcb-cursor0" # Ubuntu Focal has only Qt5.
|
||||||
install_deps = (
|
install_deps = (
|
||||||
DOCKERFILE_UBUNTU_2004_DEPS + DOCKERFILE_BUILD_DEV_DEBIAN_DEPS
|
DOCKERFILE_UBUNTU_2004_DEPS + DOCKERFILE_BUILD_DEV_DEBIAN_DEPS
|
||||||
)
|
)
|
||||||
|
elif self.distro == "ubuntu" and self.version in ("22.04", "jammy"):
|
||||||
|
# Ubuntu Jammy misses a dependency to `libxkbcommon-x11-0`, which we can
|
||||||
|
# install indirectly via `qt6-qpa-plugins`.
|
||||||
|
qt_deps += " qt6-qpa-plugins"
|
||||||
elif self.distro == "ubuntu" and self.version in ("23.04", "lunar"):
|
elif self.distro == "ubuntu" and self.version in ("23.04", "lunar"):
|
||||||
install_deps = (
|
install_deps = (
|
||||||
DOCKERFILE_UBUNTU_2304_REM_USER + DOCKERFILE_BUILD_DEV_DEBIAN_DEPS
|
DOCKERFILE_UBUNTU_2304_REM_USER + DOCKERFILE_BUILD_DEV_DEBIAN_DEPS
|
||||||
)
|
)
|
||||||
else:
|
elif self.distro == "debian" and self.version in ("bullseye-backports",):
|
||||||
install_deps = DOCKERFILE_BUILD_DEV_DEBIAN_DEPS
|
# Debian Bullseye misses a dependency to libgl1.
|
||||||
|
qt_deps += " libgl1"
|
||||||
|
|
||||||
|
install_deps = install_deps.format(qt_deps=qt_deps)
|
||||||
|
|
||||||
dockerfile = DOCKERFILE_BUILD_DEV.format(
|
dockerfile = DOCKERFILE_BUILD_DEV.format(
|
||||||
distro=self.distro, version=self.version, install_deps=install_deps
|
distro=self.distro, version=self.version, install_deps=install_deps
|
||||||
|
|
|
@ -154,7 +154,7 @@ CONTENT_BUILD_DEBIAN_UBUNTU = r"""## Debian/Ubuntu
|
||||||
Install dependencies:
|
Install dependencies:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo apt install -y podman dh-python build-essential fakeroot make libqt5gui5 \
|
sudo apt install -y podman dh-python build-essential fakeroot make libqt6gui6 \
|
||||||
pipx python3 python3-dev python3-stdeb python3-all
|
pipx python3 python3-dev python3-stdeb python3-all
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ CONTENT_BUILD_FEDORA = r"""## Fedora
|
||||||
Install dependencies:
|
Install dependencies:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo dnf install -y rpm-build podman python3 pipx qt5-qtbase-gui
|
sudo dnf install -y rpm-build podman python3 pipx qt6-qtbase-gui
|
||||||
```
|
```
|
||||||
|
|
||||||
Install Poetry using `pipx`:
|
Install Poetry using `pipx`:
|
||||||
|
|
Loading…
Reference in a new issue