public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Filipe Rosset <filiperosset@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/krop] rawhide: update to 0.7.0 fixes rhbz#1707034 and rhbz#2357714
Date: Tue, 16 Jun 2026 05:25:46 GMT [thread overview]
Message-ID: <178158754659.1.8246457739917594030.rpms-krop-dc49d072345a@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/krop
Branch : rawhide
Commit : dc49d072345a0a91a1e9d3feb2cc209b18d8e277
Author : Filipe Rosset <filiperosset@fedoraproject.org>
Date : 2026-06-16T02:25:32-03:00
Stats : +22/-160 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/krop/c/dc49d072345a0a91a1e9d3feb2cc209b18d8e277?branch=rawhide
Log:
update to 0.7.0 fixes rhbz#1707034 and rhbz#2357714
Signed-off-by: Filipe Rosset <filiperosset@fedoraproject.org>
---
diff --git a/krop-0.5.1-pypdf.patch b/krop-0.5.1-pypdf.patch
deleted file mode 100644
index ec858c0..0000000
--- a/krop-0.5.1-pypdf.patch
+++ /dev/null
@@ -1,106 +0,0 @@
---- krop-0.5.1/krop/pdfcropper.py.orig 2026-06-16 01:54:43.733091604 -0300
-+++ krop-0.5.1/krop/pdfcropper.py 2026-06-16 01:54:40.971167980 -0300
-@@ -16,22 +16,28 @@ the Free Software Foundation; either ver
- import copy
- import sys
-
--# Unless specified otherwise, use PyPDF2 instead of pyPdf if available.
--usepypdf2 = '--no-PyPDF2' not in sys.argv
--if usepypdf2:
-- try:
-- from PyPDF2 import PdfFileReader, PdfFileWriter
-- except ImportError:
-- usepypdf2 = False
--if not usepypdf2:
-- try:
-- from pyPdf import PdfFileReader, PdfFileWriter
-- except ImportError:
-- _msg = "Please install PyPDF2 (or its predecessor pyPdf) first."\
-- "\n\tOn recent versions of Ubuntu, the following should do the trick:"\
-- "\n\tsudo apt-get install python-pypdf2"\
-- "\n\t(or, if using python3) sudo apt-get install python3-pypdf2"
-- raise RuntimeError(_msg)
-+# Try importing pypdf first, then PyPDF2, then pyPdf
-+try:
-+ from pypdf import PdfReader, PdfWriter
-+except ImportError:
-+ usepypdf2 = '--no-PyPDF2' not in sys.argv
-+ if usepypdf2:
-+ try:
-+ from PyPDF2 import PdfReader, PdfWriter
-+ except ImportError:
-+ try:
-+ from PyPDF2 import PdfFileReader as PdfReader, PdfFileWriter as PdfWriter
-+ except ImportError:
-+ usepypdf2 = False
-+ if not usepypdf2:
-+ try:
-+ from pyPdf import PdfFileReader as PdfReader, PdfFileWriter as PdfWriter
-+ except ImportError:
-+ _msg = "Please install pypdf, PyPDF2 (or its predecessor pyPdf) first."\
-+ "\n\tOn recent versions of Fedora, the following should do the trick:"\
-+ "\n\tsudo dnf install python3-pypdf"
-+ raise RuntimeError(_msg)
-+
-
-
- class AbstractPdfFile:
-@@ -60,17 +66,20 @@ class PyPdfFile(AbstractPdfFile):
- def __init__(self):
- self.reader = None
- def loadFromStream(self, stream):
-- if usepypdf2:
-- self.reader = PdfFileReader(stream, strict=False)
-- else:
-- self.reader = PdfFileReader(stream)
-+ try:
-+ self.reader = PdfReader(stream, strict=False)
-+ except TypeError:
-+ self.reader = PdfReader(stream)
- def getPage(self, nr):
-- page = self.reader.getPage(nr-1)
-+ if hasattr(self.reader, 'pages'):
-+ return self.reader.pages[nr-1]
-+ else:
-+ return self.reader.getPage(nr-1)
-
- class PyPdfCropper(AbstractPdfCropper):
- """Implementation of PdfCropper using pyPdf"""
- def __init__(self):
-- self.output = PdfFileWriter()
-+ self.output = PdfWriter()
- def writeToStream(self, stream):
- # For certain large pdf files, PdfFileWriter.write() causes the error:
- # maximum recursion depth exceeded while calling a Python object
-@@ -83,11 +92,17 @@ class PyPdfCropper(AbstractPdfCropper):
- def addPageCropped(self, pdffile, pagenumber, croplist, rotate=0):
- if not croplist:
- return
-- page = pdffile.reader.getPage(pagenumber)
-+ if hasattr(pdffile.reader, 'pages'):
-+ page = pdffile.reader.pages[pagenumber]
-+ else:
-+ page = pdffile.reader.getPage(pagenumber)
- for c in croplist:
- newpage = copy.copy(page)
- self.cropPage(newpage, c, rotate)
-- self.output.addPage(newpage)
-+ if hasattr(self.output, 'add_page'):
-+ self.output.add_page(newpage)
-+ else:
-+ self.output.addPage(newpage)
- def cropPage(self, page, crop, rotate):
- # Note that the coordinate system is up-side down compared with Qt.
- x0, y0 = page.cropBox.lowerLeft
-@@ -100,7 +115,10 @@ class PyPdfCropper(AbstractPdfCropper):
- box.lowerLeft = (x0, y0)
- box.upperRight = (x1, y1)
- if rotate != 0:
-- page.rotateClockwise(rotate)
-+ if hasattr(page, 'rotate'):
-+ page.rotate(rotate)
-+ else:
-+ page.rotateClockwise(rotate)
-
- def optimizePdfGhostscript(oldfilename, newfilename):
- import subprocess
diff --git a/krop-0.5.1-sip_namespace.patch b/krop-0.5.1-sip_namespace.patch
deleted file mode 100644
index e02a13a..0000000
--- a/krop-0.5.1-sip_namespace.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-diff -up krop-0.5.1/krop/config.py.sip krop-0.5.1/krop/config.py
---- krop-0.5.1/krop/config.py.sip 2019-09-18 15:22:09.851429103 -0500
-+++ krop-0.5.1/krop/config.py 2019-09-18 16:35:51.347966628 -0500
-@@ -2,23 +2,26 @@ import sys
-
- PYQT5 = False
- try:
-- import sip
- # use PyQt5 unless not available or specified otherwise
- if '--no-qt5' not in sys.argv:
- try:
- import PyQt5
- PYQT5 = True
-+ import PyQt5.sip
-+ PyQt5.sip.setapi('QString', 2)
-+ PyQt5.sip.setapi('QVariant', 2)
- except ImportError:
- pass
- if not PYQT5:
- import PyQt4
-+ import PyQt4.sip
-+ PyQt4.sip.setapi('QString', 2)
-+ PyQt4.sip.setapi('QVariant', 2)
-+
- except ImportError:
- _msg = "Please install PyQt4 or PyQt5 first."
- raise RuntimeError(_msg)
-
--sip.setapi('QString', 2)
--sip.setapi('QVariant', 2)
--
- # use KDE unless not available or specified otherwise
- KDE = False
- if '--no-kde' not in sys.argv:
diff --git a/krop.spec b/krop.spec
index 0f0421d..71af684 100644
--- a/krop.spec
+++ b/krop.spec
@@ -1,22 +1,19 @@
Name: krop
-Version: 0.5.1
+Version: 0.7.0
Release: %autorelease
Summary: Tool to crop PDF files with an eye towards e-readers
License: GPL-3.0-or-later
-URL: http://arminstraub.com/software/krop
-Source0: http://arminstraub.com/downloads/%{name}/%{name}-%{version}.tar.gz
+URL: https://arminstraub.com/software/krop
+Source0: https://arminstraub.com/downloads/%{name}/%{name}-%{version}.tar.gz
BuildArch: noarch
-Patch1: krop-0.5.1-sip_namespace.patch
-Patch2: krop-0.5.1-pypdf.patch
-
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: python3-devel
BuildRequires: python3-pypdf
-BuildRequires: python3-qt5
-BuildRequires: python3-poppler-qt5
+BuildRequires: python3-pyqt6
+BuildRequires: python3-PyMuPDF
Requires: python3-%{name} = %{version}-%{release}
@@ -29,16 +26,17 @@ your e-reader does not support convenient scrolling.
%package -n python3-%{name}
Summary: Python 3 module for %{name}
Requires: python3-pypdf
-Requires: python3-qt5
-Requires: python3-poppler-qt5
+Requires: python3-pyqt6
+Requires: python3-PyMuPDF
%description -n python3-%{name}
%{summary}.
%prep
-%autosetup -p1
+%autosetup
+# Replace references to Ubuntu/apt-get in user-facing error messages
find . -type f -name '*.py' -exec sed -i -e 's/of ubuntu/of Fedora/Ig' \
- -e 's|apt-get|dnf|g' -e 's|python-pypdf|pyPdf|g' '{}' +
+ -e 's|apt-get|dnf|g' '{}' +
%generate_buildrequires
%pyproject_buildrequires
@@ -49,20 +47,24 @@ find . -type f -name '*.py' -exec sed -i -e 's/of ubuntu/of Fedora/Ig' \
%install
%pyproject_install
%pyproject_save_files -l %{name}
-desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{name}.desktop
-install -D -p -m 0644 %{name}.appdata.xml %{buildroot}%{_metainfodir}/%{name}.appdata.xml
%check
-%pyproject_check_import -e krop.mainwindowui_qt4
-appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml
+%pyproject_check_import -e krop.mainwindowui_qt5
+desktop-file-validate %{buildroot}%{_datadir}/applications/com.arminstraub.krop.desktop
+appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/com.arminstraub.krop.metainfo.xml
%files
-%doc ChangeLog
+%license LICENSE
+%doc ChangeLog README.md
%{_bindir}/%{name}
-%{_metainfodir}/%{name}.appdata.xml
-%{_datadir}/applications/%{name}.desktop
+%{_metainfodir}/com.arminstraub.krop.metainfo.xml
+%{_datadir}/applications/com.arminstraub.krop.desktop
+%{_datadir}/icons/hicolor/scalable/apps/com.arminstraub.krop.svg
+%{_mandir}/man1/%{name}.1*
%files -n python3-%{name} -f %{pyproject_files}
+%license LICENSE
+%doc README.md
%changelog
%autochangelog
diff --git a/sources b/sources
index 1a50340..34e5d90 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (krop-0.5.1.tar.gz) = 2bfd2a5d762454ab45538707c6f333d2b0947b6b203d6e7bd2d9d0d574d79de8ee6b30d87b17d6afea604456b915f323b855c9c9af5c169c192b0a01634075ca
+SHA512 (krop-0.7.0.tar.gz) = e19aae3784e219fb1114e2bd1d9ca5601c46aa777083d1a5fdba6d9221ddc421c193f6daaf75da349c87c8f0bcc301e1183e50c9decf3e01e2b0b7af54008f34
reply other threads:[~2026-06-16 5:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178158754659.1.8246457739917594030.rpms-krop-dc49d072345a@fedoraproject.org \
--to=filiperosset@fedoraproject.org \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox