From 6d7342091fe594d8c1f841e639cdb3a79bed86033446d2d9efeb1e89af972935 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 8 Oct 2020 10:03:10 +0000 Subject: [PATCH] Accepting request 839768 from home:frispete:python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tomáš, have a look at this iteration, please. OBS-URL: https://build.opensuse.org/request/show/839768 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-poppler?expand=0&rev=1 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + _service | 15 +++++++ _servicedata | 4 ++ python-poppler-0.2.2.tar.xz | 3 ++ python-python-poppler.changes | 53 ++++++++++++++++++++++++ python-python-poppler.spec | 78 +++++++++++++++++++++++++++++++++++ use-system-pybind11.patch | 41 ++++++++++++++++++ 8 files changed, 218 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _service create mode 100644 _servicedata create mode 100644 python-poppler-0.2.2.tar.xz create mode 100644 python-python-poppler.changes create mode 100644 python-python-poppler.spec create mode 100644 use-system-pybind11.patch 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/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-python-poppler.changes b/python-python-poppler.changes new file mode 100644 index 0000000..6885771 --- /dev/null +++ b/python-python-poppler.changes @@ -0,0 +1,53 @@ +------------------------------------------------------------------- +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..68fc544 --- /dev/null +++ b/python-python-poppler.spec @@ -0,0 +1,78 @@ +# +# spec file for package python-python-poppler +# +# Copyright (c) 2020 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/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 +Name: python-python-poppler +Version: 0.2.2 +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 +BuildRequires: python3 +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pybind11-devel} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: pkg-config +BuildRequires: c++_compiler +BuildRequires: cmake +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: pkgconfig(poppler) +# some tests require this 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 +sed -i -e 's/-j2/%{?_smp_mflags}/' setup.py + +%build +export CXXFLAGS="%{optflags}" +%python_build --debug + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} + +%check +%pytest_arch tests + +%files %{python_files} +%license LICENSE.txt +%doc README.md +%{python_sitearch}/ + +%changelog diff --git a/use-system-pybind11.patch b/use-system-pybind11.patch new file mode 100644 index 0000000..57637a9 --- /dev/null +++ b/use-system-pybind11.patch @@ -0,0 +1,41 @@ +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") + + +-# 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 + )