14
0

- Update to 0.4.1:

* Fix non-pure build for meson-python
  * Tested with Python 3.11 and Poppler 23.04.0
  * Minimal supported Python version is now 3.7
  * Tested with Python 3.11 and Poppler 23.03.0
  * Build system is now meson, and package is PEP-517 compliant
  * Tested with Python 3.10 and Poppler 22.04.0
  * EmbeddedFile data() and checksum() now return bytes
  * Bugfix: Fixed typos in EmbeddedFile.modification_date and
    EmbeddedFile.is_valid
  * Bugfix: Fixed typo in page.search
  * Bugfix: Fix underscore position in two attributes of the Rotation Enum
  * Bugfix: Reading pdf_version now requires unlocked document
  * Bugfix: Ensure document was loaded before creating Document object
- Drop patch fix-image-argb.patch, no longer required.
- No longer use disabled service to update, we don't need to clean up
  pybind11 sources, switch to the GitHub tarball to keep the testsuite.
- Refresh patch use-system-pybind11.patch to work with meson.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-poppler?expand=0&rev=9
This commit is contained in:
2025-01-13 01:29:49 +00:00
committed by Git OBS Bridge
commit 34d620d852
10 changed files with 260 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

15
_service Normal file
View File

@@ -0,0 +1,15 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">git://github.com/cbrunet/python-poppler</param>
<param name="scm">git</param>
<param name="changesgenerate">enable</param>
<param name="exclude">pybind11</param>
<param name="version">0.2.2</param>
<param name="revision">v0.2.2</param>
</service>
<service name="recompress" mode="disabled">
<param name="compression">xz</param>
<param name="file">*.tar</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

4
_servicedata Normal file
View File

@@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/cbrunet/python-poppler</param>
<param name="changesrevision">04ddb469ec2dcabd84c7224eec02f8f72842eb1d</param></service></servicedata>

23
fix-image-argb.patch Normal file
View File

@@ -0,0 +1,23 @@
Index: b/src/cpp/image.cpp
===================================================================
--- a/src/cpp/image.cpp
+++ b/src/cpp/image.cpp
@@ -93,7 +93,11 @@ PYBIND11_MODULE(image, m)
.value("bgr24", image::format_enum::format_bgr24)
#endif
.export_values()
+#if PYBIND11_VERSION_MAJOR >= 2 && PYBIND11_VERSION_MINOR >= 6
+ .def("__str__", &format_to_str, "Image format used by PIL converters.", py::prepend());
+#else
.def("__str__", &format_to_str, "Image format used by PIL converters.");
+#endif
py::class_<image>(m, "image", py::buffer_protocol())
.def(py::init<>())
@@ -114,4 +118,4 @@ PYBIND11_MODULE(image, m)
m.def("supported_image_formats", &image::image::supported_image_formats);
}
-} // namespace poppler
\ No newline at end of file
+} // namespace poppler

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2be62708cdfd90928a3aceaa488f398cf2e6e7b5f6d497fd19bcf48f0a924690
size 108232

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:537e706215dcefb823d94b6d00473a2f43544d4902afaf84eb660dea53590166
size 132065

View File

@@ -0,0 +1,93 @@
-------------------------------------------------------------------
Mon Jan 13 01:28:43 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 0.4.1:
* Fix non-pure build for meson-python
* Tested with Python 3.11 and Poppler 23.04.0
* Minimal supported Python version is now 3.7
* Tested with Python 3.11 and Poppler 23.03.0
* Build system is now meson, and package is PEP-517 compliant
* Tested with Python 3.10 and Poppler 22.04.0
* EmbeddedFile data() and checksum() now return bytes
* Bugfix: Fixed typos in EmbeddedFile.modification_date and
EmbeddedFile.is_valid
* Bugfix: Fixed typo in page.search
* Bugfix: Fix underscore position in two attributes of the Rotation Enum
* Bugfix: Reading pdf_version now requires unlocked document
* Bugfix: Ensure document was loaded before creating Document object
- Drop patch fix-image-argb.patch, no longer required.
- No longer use disabled service to update, we don't need to clean up
pybind11 sources, switch to the GitHub tarball to keep the testsuite.
- Refresh patch use-system-pybind11.patch to work with meson.
-------------------------------------------------------------------
Wed Aug 23 04:20:18 UTC 2023 - Bernhard Wiedemann <bwiedemann@suse.com>
- Fix build with newer rpm
-------------------------------------------------------------------
Fri Aug 27 20:15:33 UTC 2021 - Ben Greiner <code@bnavigator.de>
- remove dangling series file
- skip failing test due to poppler 21.08.0 crash
gh#cbrunet/python-poppler#39
-------------------------------------------------------------------
Mon Mar 22 01:19:20 UTC 2021 - Hans-Peter Jansen <hpj@urpla.net>
- Add fix-image-argb.patch to fix image formatting with
pybind11 >= 2.6.0
-------------------------------------------------------------------
Tue Oct 6 10:45:50 UTC 2020 - Hans-Peter Jansen <hpj@urpla.net>
- Add use-system-pybind11.patch to use system provided pybind11
- Exclude pybind11 from _service
-------------------------------------------------------------------
Sat Oct 3 18:36:27 UTC 2020 - Hans-Peter Jansen <hpj@urpla.net>
- Fix fdupes
- Package license
- Use %pytest_arch
-------------------------------------------------------------------
Sat Oct 03 11:14:01 UTC 2020 - hpj@urpla.net
- Update to version 0.2.2:
* Put changelog in doc (#22)
* lower required python version to 3.6 (#21)
* Fix corrupted document buffer (#20)
-------------------------------------------------------------------
Thu Oct 1 16:45:31 UTC 2020 - Hans-Peter Jansen <hpj@urpla.net>
- Switch to git release by disabled service (pypi is missing tests)
- Enable tests
-------------------------------------------------------------------
Thu Oct 01 15:31:46 UTC 2020 - hpj@urpla.net
- Update to version 0.2.1+git20200930.d09bfc7:
* fix initializer list for some compilers (#18)
* invoke apidoc when running tox -e docs (#15)
* Lower minimum poppler-cpp version to 0.26.0 (#13)
* Documentation (#10)
* Fixes for 20 08 (#11)
* Verbose nested namespace syntax (not C++17) (#7)
* fix include paths (#3)
* ensure document is unlocked (#5)
* Fixed byte order in image format string
* Add automated tests for latest version of Poppler (#1)
- Remove fix-initializer-list-for-some-compilers.patch
-------------------------------------------------------------------
Wed Sep 30 13:15:15 UTC 2020 - Hans-Peter Jansen <hpj@urpla.net>
- Apply fix-initializer-list-for-some-compilers.patch to fix a
32bit build issue
-------------------------------------------------------------------
Fri Sep 25 16:32:20 UTC 2020 - Hans-Peter Jansen <hpj@urpla.net>
- Version 0.2.1: initial build

View File

@@ -0,0 +1,78 @@
#
# spec file for package python-python-poppler
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2020 LISA GmbH ,Bingen, Germany
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: python-python-poppler
Version: 0.4.1
Release: 0
Summary: Python binding to the poppler-cpp library
License: GPL-2.0-only
URL: https://github.com/cbrunet/python-poppler
Source: https://github.com/cbrunet/python-poppler/archive/refs/tags/v%{version}.tar.gz#/python-poppler-%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE Build against system pybind11
Patch0: use-system-pybind11.patch
BuildRequires: %{python_module devel >= 3.7}
BuildRequires: %{python_module meson-python}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pybind11-devel}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module wheel}
BuildRequires: c++_compiler
BuildRequires: fdupes
BuildRequires: ninja
BuildRequires: pkg-config
BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(poppler)
# some tests require this
BuildRequires: poppler-data
%python_subpackages
%description
python-poppler is a Python binding to the poppler-cpp library. It allows to
read, render, or modify PDF documents. More specifically, it currently allows
to:
read an modify document meta data;
list and read embedded documents;
list the fonts used by the document;
search or extract text on a given page of the document;
render a page to a raw image;
get info about transitions effects between the pages;
read the table of contents of the document.
%prep
%autosetup -p1 -n python-poppler-%version
rm -rf subprojects
%build
export CXXFLAGS="%{optflags}"
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
%pytest_arch tests
%files %{python_files}
%license LICENSE.txt
%doc README.md
%{python_sitearch}/poppler
%{python_sitearch}/python_poppler-%{version}.dist-info
%changelog

17
use-system-pybind11.patch Normal file
View File

@@ -0,0 +1,17 @@
Index: python-poppler-0.4.1/meson.build
===================================================================
--- python-poppler-0.4.1.orig/meson.build
+++ python-poppler-0.4.1/meson.build
@@ -13,7 +13,10 @@ poppler_dep = dependency('poppler-cpp',
python_mod = import('python')
python3 = python_mod.find_installation('python3', pure: false)
-pybind11_proj = subproject('pybind11')
-pybind11_dep = pybind11_proj.get_variable('pybind11_dep')
+pybind11_config = find_program('pybind11-config')
+pybind11_config_ret = run_command(pybind11_config, ['--includes'], check: true)
+pybind11_dep = declare_dependency(
+ include_directories: [pybind11_config_ret.stdout().split('-I')[-1].strip()],
+)
subdir('src')