From e0878e489a25e07b34948d70cb1e9f25eb116021 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Wed, 11 Sep 2024 19:55:03 +0300 Subject: [PATCH] Vendor PyMuPDF --- debian/control | 4 ++-- debian/source/options | 2 +- install/linux/build-rpm.py | 5 +++++ install/linux/vendor-pymupdf.py | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 133883b..916030c 100644 --- a/debian/control +++ b/debian/control @@ -2,14 +2,14 @@ Source: dangerzone Maintainer: Freedom of the Press Foundation Section: python Priority: optional -Build-Depends: dh-python, python3-setuptools, python3, dpkg-dev, debhelper (>= 9) +Build-Depends: dh-python, python3-setuptools, python3 (>= 3.9) | python3.9, dpkg-dev, debhelper (>= 9) Standards-Version: 4.5.1 Homepage: https://github.com/freedomofpress/dangerzone Rules-Requires-Root: no Package: dangerzone Architecture: any -Depends: ${misc:Depends}, ${python3:Depends}, podman, python3, python3-pyside2.qtcore, python3-pyside2.qtgui, python3-pyside2.qtwidgets, python3-pyside2.qtsvg, python3-appdirs, python3-click, python3-xdg, python3-colorama, python3-requests, python3-markdown, python3-packaging +Depends: ${misc:Depends}, ${python3:Depends}, podman, python3 (>= 3.9) | python3.9, python3-pyside2.qtcore, python3-pyside2.qtgui, python3-pyside2.qtwidgets, python3-pyside2.qtsvg, python3-appdirs, python3-click, python3-xdg, python3-colorama, python3-requests, python3-markdown, python3-packaging Description: Take potentially dangerous PDFs, office documents, or images Dangerzone is an open source desktop application that takes potentially dangerous PDFs, office documents, or images and converts them to safe PDFs. It uses disposable VMs on Qubes OS, or container technology in other OSes, to convert the documents within a secure sandbox. . diff --git a/debian/source/options b/debian/source/options index 57156b1..79028c6 100644 --- a/debian/source/options +++ b/debian/source/options @@ -1,4 +1,4 @@ compression = "gzip" tar-ignore = "dev_scripts" tar-ignore = ".*" -tar-ignore = "__pycache__" \ No newline at end of file +tar-ignore = "__pycache__" diff --git a/install/linux/build-rpm.py b/install/linux/build-rpm.py index 56f5ab2..162513c 100755 --- a/install/linux/build-rpm.py +++ b/install/linux/build-rpm.py @@ -64,8 +64,12 @@ def build(build_dir, qubes=False): os.symlink(dist_path, srpm_dir) print("* Creating a Python sdist") + tessdata = root / "share" / "tessdata" + tessdata_bak = root / "tessdata.bak" container_tar_gz = root / "share" / "container.tar.gz" container_tar_gz_bak = root / "container.tar.gz.bak" + + tessdata.rename(tessdata_bak) stash_container = qubes and container_tar_gz.exists() if stash_container: container_tar_gz.rename(container_tar_gz_bak) @@ -77,6 +81,7 @@ def build(build_dir, qubes=False): shutil.copy2(sdist_path, build_dir / "SOURCES" / sdist_name) sdist_path.unlink() finally: + tessdata_bak.rename(tessdata) if stash_container: container_tar_gz_bak.rename(container_tar_gz) diff --git a/install/linux/vendor-pymupdf.py b/install/linux/vendor-pymupdf.py index 1a0efdd..88e2fcb 100755 --- a/install/linux/vendor-pymupdf.py +++ b/install/linux/vendor-pymupdf.py @@ -5,6 +5,7 @@ import subprocess import sys from pathlib import Path + DZ_VENDOR_DIR = Path("./dangerzone/vendor")