commit 34d620d8523bcfe444c7548b1f9bba5c5e89a3eb509fde69cf886dbe60e49024 Author: Steve Kowalik Date: Mon Jan 13 01:29:49 2025 +0000 - 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 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..72241d5 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + git://github.com/cbrunet/python-poppler + git + enable + pybind11 + 0.2.2 + v0.2.2 + + + xz + *.tar + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..d0675f2 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + git://github.com/cbrunet/python-poppler + 04ddb469ec2dcabd84c7224eec02f8f72842eb1d \ No newline at end of file diff --git a/fix-image-argb.patch b/fix-image-argb.patch new file mode 100644 index 0000000..aa3d66c --- /dev/null +++ b/fix-image-argb.patch @@ -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_(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 diff --git a/python-poppler-0.2.2.tar.xz b/python-poppler-0.2.2.tar.xz new file mode 100644 index 0000000..7108c07 --- /dev/null +++ b/python-poppler-0.2.2.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2be62708cdfd90928a3aceaa488f398cf2e6e7b5f6d497fd19bcf48f0a924690 +size 108232 diff --git a/python-poppler-0.4.1.tar.gz b/python-poppler-0.4.1.tar.gz new file mode 100644 index 0000000..99a7ed3 --- /dev/null +++ b/python-poppler-0.4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:537e706215dcefb823d94b6d00473a2f43544d4902afaf84eb660dea53590166 +size 132065 diff --git a/python-python-poppler.changes b/python-python-poppler.changes new file mode 100644 index 0000000..11c6664 --- /dev/null +++ b/python-python-poppler.changes @@ -0,0 +1,93 @@ +------------------------------------------------------------------- +Mon Jan 13 01:28:43 UTC 2025 - Steve Kowalik + +- 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 + +- Fix build with newer rpm + +------------------------------------------------------------------- +Fri Aug 27 20:15:33 UTC 2021 - Ben Greiner + +- 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 + +- 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 + +- 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 + +- 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 + +- 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 + +- 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 + +- Version 0.2.1: initial build diff --git a/python-python-poppler.spec b/python-python-poppler.spec new file mode 100644 index 0000000..bfb6f63 --- /dev/null +++ b/python-python-poppler.spec @@ -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 diff --git a/use-system-pybind11.patch b/use-system-pybind11.patch new file mode 100644 index 0000000..e21e202 --- /dev/null +++ b/use-system-pybind11.patch @@ -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')