Narrow down installed system packages

Narrow down the system packages that we install in dev environments. The
rationale is that we get most of the Python dependencies from Poetry, so
we don't need to install them from the system as well.

The packages that we do need to install are non-Python ones, and this
commit adds some that were missing: make, python3-stdeb. Also, we
explicitly install the base Qt5 libraries, in order to get the graphics
and C++ libraries that we can't get from PyPI.
This commit is contained in:
Alex Pyrgiotis 2023-01-06 17:22:40 +02:00
parent f16b42bb18
commit ea99b1e1dd
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA
6 changed files with 539 additions and 534 deletions

View file

@ -23,12 +23,12 @@ aliases:
command: |
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
apt-get update
apt-get install -y dh-python python3 python3-setuptools python3-stdeb
apt-get install -y dh-python python3 python3-stdeb
- &install-dependencies-rpm
name: Install dependencies (rpm)
command: |
dnf install -y podman git openssh make automake gcc gcc-c++ rpm-build python3-setuptools python3-pyside2 python3-appdirs python3-click python3-pyxdg python3-colorama
dnf install -y rpm-build python3 python3-setuptools
- &build-deb
name: Build the .deb package

View file

@ -5,7 +5,8 @@
Install dependencies:
```sh
sudo apt install -y podman dh-python python3 python3-pip python3-stdeb python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtwidgets python3-appdirs python3-click python3-xdg python3-colorama
sudo apt install -y podman dh-python make libqt5gui5 \
python3 python3-dev python3-venv python3-pip python3-stdeb
```
Install poetry (you may need to add `~/.local/bin/` to your `PATH` first):
@ -50,7 +51,7 @@ Create a .deb:
Install dependencies:
```sh
sudo dnf install -y rpm-build podman python3 python3-pip python3-setuptools python3-pyside2 python3-appdirs python3-click python3-pyxdg python3-colorama
sudo dnf install -y rpm-build podman python3 python3-pip qt5-qtbase-gui
```
Install poetry:

View file

@ -52,24 +52,25 @@ Run Dangerzone in the end-user environment:
"""
DOCKERFILE_BUILD_DEV_DEBIAN_DEPS = rf"""
RUN apt-get update && apt-get install -y \
podman dh-python python3 python3-stdeb python3-pyside2.qtcore \
python3-pyside2.qtgui python3-pyside2.qtwidgets python3-appdirs \
python3-click python3-xdg python3-colorama
# FIXME: Do we really need the python3-venv packages?
# XXX: We install uidmap separately, because it is not a hard dependency for Podman, and
# we use --no-install-recommends.
DOCKERFILE_BUILD_DEV_DEBIAN_DEPS = r"""
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y make
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3-dev python3-venv python3-pip
RUN apt-get update \
&& apt-get install -y --no-install-recommends podman uidmap dh-python make \
libqt5gui5 python3 python3-dev python3-venv python3-pip python3-stdeb \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install -y --no-install-recommends mupdf \
&& rm -rf /var/lib/apt/lists/*
"""
# FIXME: Install Poetry on Fedora via package manager.
DOCKERFILE_BUILD_DEV_FEDORA_DEPS = r"""
RUN dnf update -y && dnf install -y rpm-build podman python3 python3-setuptools \
python3-pyside2 python3-appdirs python3-click python3-pyxdg python3-colorama
RUN dnf update -y && dnf install -y make
RUN dnf update -y && dnf install -y python3-pip
RUN dnf install -y rpm-build podman python3 make python3-pip qt5-qtbase-gui \
&& dnf clean all
# FIXME: Drop this fix after it's resolved upstream.
# See https://github.com/freedomofpress/dangerzone/issues/286#issuecomment-1347149783

View file

@ -155,10 +155,11 @@ CONTENT_BUILD_DEBIAN_UBUNTU = r"""## Debian/Ubuntu
Install dependencies:
```sh
sudo apt install -y podman dh-python python3 python3-stdeb python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtwidgets python3-appdirs python3-click python3-xdg python3-colorama
sudo apt install -y podman dh-python make libqt5gui5 \
python3 python3-dev python3-venv python3-pip python3-stdeb
```
Install poetry:
Install poetry (you may need to add `~/.local/bin/` to your `PATH` first):
```sh
python3 -m pip install poetry
@ -201,7 +202,7 @@ CONTENT_BUILD_FEDORA = r"""## Fedora
Install dependencies:
```sh
sudo dnf install -y rpm-build podman python3 python3-setuptools python3-pyside2 python3-appdirs python3-click python3-pyxdg python3-colorama
sudo dnf install -y rpm-build podman python3 python3-pip qt5-qtbase-gui
```
Install poetry:

1014
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -11,32 +11,34 @@ click = "*"
appdirs = "*"
PySide2 = "5.15.2.1"
colorama = "*"
cx_freeze = {version = "^6.13.1", platform = "win32"}
pywin32 = {version = "*", platform = "win32"}
pyxdg = {version = "*", platform = "linux"}
pyinstaller = {version = "*", platform = "darwin"}
strip-ansi = {version = "*", platform = "darwin"}
[tool.poetry.scripts]
dangerzone = 'dangerzone:main'
dangerzone-container = 'dangerzone:main'
dangerzone-cli = 'dangerzone:main'
[tool.poetry.group.dev.dependencies]
setuptools = {version = "*", platform = "win32"}
strip-ansi = "*"
# Dependencies required for packaging the code on various platforms.
[tool.poetry.group.package.dependencies]
setuptools = "*"
cx_freeze = {version = "^6.13.1", platform = "win32"}
pywin32 = {version = "*", platform = "win32"}
pyinstaller = {version = "*", platform = "darwin"}
# Dependencies required for linting the code.
[tool.poetry.group.lint.dependencies]
black = "*"
isort = "*"
mypy = "*"
PySide2-stubs = "*"
# Dependencies required for testing the code.
[tool.poetry.group.test.dependencies]
pytest = "^7.1.2"
pytest-mock = "^3.10.0"
pytest-xdist = "^2.5.0"
pytest-cov = "^3.0.0"
strip-ansi = "*"
[build-system]
requires = ["poetry>=1.1.4"]