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
parent 0324f59d62
commit 6417a382e4
8 changed files with 55 additions and 103 deletions

View File

@@ -1,15 +0,0 @@
<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>

View File

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

View File

@@ -1,23 +0,0 @@
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

@@ -1,3 +0,0 @@
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

@@ -1,3 +1,25 @@
-------------------------------------------------------------------
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> Wed Aug 23 04:20:18 UTC 2023 - Bernhard Wiedemann <bwiedemann@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-python-poppler # spec file for package python-python-poppler
# #
# Copyright (c) 2021 SUSE LLC # Copyright (c) 2025 SUSE LLC
# Copyright (c) 2020 LISA GmbH ,Bingen, Germany # Copyright (c) 2020 LISA GmbH ,Bingen, Germany
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
@@ -17,28 +17,26 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-python-poppler Name: python-python-poppler
Version: 0.2.2 Version: 0.4.1
Release: 0 Release: 0
Summary: Python binding to the poppler-cpp library Summary: Python binding to the poppler-cpp library
License: GPL-2.0-only License: GPL-2.0-only
Group: Development/Libraries/Python
URL: https://github.com/cbrunet/python-poppler URL: https://github.com/cbrunet/python-poppler
Source: python-poppler-%{version}.tar.xz Source: https://github.com/cbrunet/python-poppler/archive/refs/tags/v%{version}.tar.gz#/python-poppler-%{version}.tar.gz
Patch: use-system-pybind11.patch # PATCH-FEATURE-OPENSUSE Build against system pybind11
Patch1: fix-image-argb.patch Patch0: use-system-pybind11.patch
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel >= 3.7}
BuildRequires: %{python_module meson-python}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pybind11-devel} BuildRequires: %{python_module pybind11-devel}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel}
BuildRequires: c++_compiler BuildRequires: c++_compiler
BuildRequires: cmake
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: ninja
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
BuildRequires: python3
BuildRequires: pkgconfig(poppler) BuildRequires: pkgconfig(poppler)
# some tests require this # some tests require this
BuildRequires: poppler-data BuildRequires: poppler-data
@@ -58,25 +56,23 @@ to:
%prep %prep
%autosetup -p1 -n python-poppler-%version %autosetup -p1 -n python-poppler-%version
sed -i -e "s/-j2/%{?_smp_mflags}/" setup.py rm -rf subprojects
%build %build
export CXXFLAGS="%{optflags}" export CXXFLAGS="%{optflags}"
%python_build --debug %pyproject_wheel
%install %install
%python_install %pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch} %python_expand %fdupes %{buildroot}%{$python_sitearch}
%check %check
# gh#cbrunet/python-poppler#39 %pytest_arch tests
donttest="test_get_pdf_version_of_locked_document"
%pytest_arch tests -k "not ($donttest)"
%files %{python_files} %files %{python_files}
%license LICENSE.txt %license LICENSE.txt
%doc README.md %doc README.md
%{python_sitearch}/poppler %{python_sitearch}/poppler
%{python_sitearch}/python_poppler-%{version}*-info %{python_sitearch}/python_poppler-%{version}.dist-info
%changelog %changelog

View File

@@ -1,41 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt Index: python-poppler-0.4.1/meson.build
index 936467d..0f97a75 100644 ===================================================================
--- a/CMakeLists.txt --- python-poppler-0.4.1.orig/meson.build
+++ b/CMakeLists.txt +++ python-poppler-0.4.1/meson.build
@@ -6,8 +6,8 @@ list(APPEND Targets "page_renderer" "page_transition") @@ -13,7 +13,10 @@ poppler_dep = dependency('poppler-cpp',
list(APPEND Targets "embedded_file" "destination" "toc" "font") 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()],
+)
-# find_package(pybind11) subdir('src')
-add_subdirectory(pybind11)
+find_package(pybind11)
+# add_subdirectory(pybind11)
find_package(PkgConfig REQUIRED)
diff --git a/setup.py b/setup.py
index c1ba5f6..34f6ac3 100644
--- a/setup.py
+++ b/setup.py
@@ -43,6 +43,7 @@ class CMakeBuild(build_ext):
cmake_args = [
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=" + extdir,
"-DPYTHON_EXECUTABLE=" + sys.executable,
+ "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON",
]
cfg = "Debug" if self.debug else "Release"
@@ -65,9 +66,13 @@ class CMakeBuild(build_ext):
)
if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
+ from pprint import pformat
+ print("Env: {}\n".format(pformat(env)))
+ print("Run: {} in {}\n".format(["cmake", ext.sourcedir] + cmake_args, self.build_temp))
subprocess.check_call(
["cmake", ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env
)
+ print("Run: {} in {}\n".format(["cmake", "--build", "."] + build_args, self.build_temp))
subprocess.check_call(
["cmake", "--build", "."] + build_args, cwd=self.build_temp
)