Skip to content

Commit

Permalink
WIP: Install Dangerzone with PySide6 on F39
Browse files Browse the repository at this point in the history
  • Loading branch information
apyrgio committed Dec 21, 2023
1 parent 2c5f04c commit 50aa408
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 106 deletions.
16 changes: 15 additions & 1 deletion dev_scripts/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@
# FIXME: Drop this fix after it's resolved upstream.
# See https://github.com/freedomofpress/dangerzone/issues/286#issuecomment-1347149783
RUN rpm --restore shadow-utils
COPY {pyside6_package} /tmp/{pyside6_package}
RUN {install_cmd} /tmp/{pyside6_package}
RUN rm /tmp/{pyside6_package}
"""

# The Dockerfile for building an environment with Dangerzone installed in it. Parts of
Expand Down Expand Up @@ -472,11 +476,21 @@ def build(self, show_dockerfile=DEFAULT_SHOW_DOCKERFILE):
build_dir = distro_build(self.distro, self.version)
version = dz_version()
if self.distro == "fedora":
install_deps = DOCKERFILE_BUILD_FEDORA_DEPS
package = f"dangerzone-{version}-1.fc{self.version}.x86_64.rpm"
package_src = git_root() / "dist" / package
package_dst = build_dir / package

pyside6_version = "6.6.1"
pyside6_package = f"python3-pyside6-{pyside6_version}-1.fc{self.version}.x86_64.rpm"
pyside6_package_src = git_root() / "dist" / pyside6_package
pyside6_package_dst = build_dir / pyside6_package
shutil.copy(pyside6_package_src, pyside6_package_dst)

install_cmd = "dnf install -y"
install_deps = DOCKERFILE_BUILD_FEDORA_DEPS.format(
install_cmd=install_cmd,
pyside6_package=pyside6_package,
)
else:
install_deps = DOCKERFILE_BUILD_DEBIAN_DEPS
if self.distro == "ubuntu" and self.version in ("20.04", "focal"):
Expand Down
8 changes: 0 additions & 8 deletions install/linux/dangerzone.spec
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,6 @@ convert the documents within a secure sandbox.
%prep
%autosetup -p1 -n dangerzone-%{version}

# XXX: Replace the PySide6 dependency in the pyproject.toml file with PySide2,
# since the former does not exist in Fedora. Once we can completely migrate to
# Qt6, we should remove this. For more details, see:
#
# https://github.com/freedomofpress/dangerzone/issues/211
sed -i 's/^PySide6.*$/PySide2 = "*"/' pyproject.toml


%generate_buildrequires
%pyproject_buildrequires -R

Expand Down
128 changes: 33 additions & 95 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ include = [
]

[tool.poetry.dependencies]
python = ">=3.7,<3.12"
python = ">=3.8,<3.13"
click = "*"
appdirs = "*"
PySide6 = "^6.4.1"
PySide6 = "*"
colorama = "*"
pyxdg = {version = "*", platform = "linux"}
requests = "*"
Expand Down

0 comments on commit 50aa408

Please sign in to comment.