diff --git a/_service b/_service deleted file mode 100644 index 72241d5..0000000 --- a/_service +++ /dev/null @@ -1,15 +0,0 @@ - - - git://github.com/cbrunet/python-poppler - git - enable - pybind11 - 0.2.2 - v0.2.2 - - - xz - *.tar - - - diff --git a/_servicedata b/_servicedata deleted file mode 100644 index d0675f2..0000000 --- a/_servicedata +++ /dev/null @@ -1,4 +0,0 @@ - - - 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 deleted file mode 100644 index aa3d66c..0000000 --- a/fix-image-argb.patch +++ /dev/null @@ -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_(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 deleted file mode 100644 index 7108c07..0000000 --- a/python-poppler-0.2.2.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -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 index 48d477f..11c6664 100644 --- a/python-python-poppler.changes +++ b/python-python-poppler.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +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 diff --git a/python-python-poppler.spec b/python-python-poppler.spec index ea005fa..bfb6f63 100644 --- a/python-python-poppler.spec +++ b/python-python-poppler.spec @@ -1,7 +1,7 @@ # # spec file for package python-python-poppler # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2025 SUSE LLC # Copyright (c) 2020 LISA GmbH ,Bingen, Germany # # 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 -Version: 0.2.2 +Version: 0.4.1 Release: 0 Summary: Python binding to the poppler-cpp library License: GPL-2.0-only -Group: Development/Libraries/Python URL: https://github.com/cbrunet/python-poppler -Source: python-poppler-%{version}.tar.xz -Patch: use-system-pybind11.patch -Patch1: fix-image-argb.patch -BuildRequires: %{python_module devel} +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 setuptools} +BuildRequires: %{python_module wheel} BuildRequires: c++_compiler -BuildRequires: cmake BuildRequires: fdupes +BuildRequires: ninja BuildRequires: pkg-config BuildRequires: python-rpm-macros -BuildRequires: python3 BuildRequires: pkgconfig(poppler) # some tests require this BuildRequires: poppler-data @@ -58,25 +56,23 @@ to: %prep %autosetup -p1 -n python-poppler-%version -sed -i -e "s/-j2/%{?_smp_mflags}/" setup.py +rm -rf subprojects %build export CXXFLAGS="%{optflags}" -%python_build --debug +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %check -# gh#cbrunet/python-poppler#39 -donttest="test_get_pdf_version_of_locked_document" -%pytest_arch tests -k "not ($donttest)" +%pytest_arch tests %files %{python_files} %license LICENSE.txt %doc README.md %{python_sitearch}/poppler -%{python_sitearch}/python_poppler-%{version}*-info +%{python_sitearch}/python_poppler-%{version}.dist-info %changelog diff --git a/use-system-pybind11.patch b/use-system-pybind11.patch index 57637a9..e21e202 100644 --- a/use-system-pybind11.patch +++ b/use-system-pybind11.patch @@ -1,41 +1,17 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 936467d..0f97a75 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -6,8 +6,8 @@ list(APPEND Targets "page_renderer" "page_transition") - list(APPEND Targets "embedded_file" "destination" "toc" "font") +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()], ++) --# find_package(pybind11) --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 - ) + subdir('src')