Re: [ptxdist] [PATCH v2 2/7] qpdf: new package: PDF inspection library and tools

2017-09-27 Thread Roland Hieber

On 27.09.2017 14:22, Roland Hieber wrote:

+
+# 
+# Clean
+# 
+
+#$(STATEDIR)/qpdf.clean:
+#  @$(call targetinfo)
+#  @$(call clean_pkg, QPDF)


Somehow this slipped through. Will fix in v3.

 - Roland

___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] [PATCH v2 2/7] qpdf: new package: PDF inspection library and tools

2017-09-27 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---

Notes:
changes in v1 -> v2:
 - version bump to 7.0.0
   - now with the right md5sum
   - dropped libpcre dependency
   - tests no longer fail to compile, remove our patch
   - but we need to patch for libjpeg's missing pkg-config
 - use default prepare stage
 - always use /dev/urandom

 ...Remove-libjpeg-dependency-from-pkg-config.patch | 40 +
 patches/qpdf-7.0.0/series  |  4 +
 rules/qpdf.in  | 22 +
 rules/qpdf.make| 95 ++
 4 files changed, 161 insertions(+)
 create mode 100644 
patches/qpdf-7.0.0/0001-Remove-libjpeg-dependency-from-pkg-config.patch
 create mode 100644 patches/qpdf-7.0.0/series
 create mode 100644 rules/qpdf.in
 create mode 100644 rules/qpdf.make

diff --git 
a/patches/qpdf-7.0.0/0001-Remove-libjpeg-dependency-from-pkg-config.patch 
b/patches/qpdf-7.0.0/0001-Remove-libjpeg-dependency-from-pkg-config.patch
new file mode 100644
index 0..7255159a1
--- /dev/null
+++ b/patches/qpdf-7.0.0/0001-Remove-libjpeg-dependency-from-pkg-config.patch
@@ -0,0 +1,40 @@
+From: Roland Hieber 
+Date: Mon, 25 Sep 2017 13:01:04 +0200
+Subject: [PATCH] Remove libjpeg dependency from pkg-config
+
+I'm linking QPDF with the original libjpeg-9a from http://ijg.org. This
+works well. But when I then compile cups-filters with QPDF support,
+cups-filters' configure is confused about it, because libjpeg does not
+ship pkg-config definitions:
+
+   [...]
+   checking for ZLIB... yes
+   checking for LIBQPDF... no
+   configure: error: Package requirements (libqpdf >= 3.0.2) were not met:
+
+   Package 'libjpeg', required by 'libqpdf', not found
+
+   Consider adjusting the PKG_CONFIG_PATH environment variable if you
+   installed software in a non-standard prefix.
+
+We cannot solve this problem in QPDF, so just remove the libjpeg
+dependency from the Requires.private variable.
+
+Forwarded: https://github.com/qpdf/qpdf/pull/157
+Signed-off-by: Roland Hieber 
+---
+ libqpdf.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libqpdf.pc.in b/libqpdf.pc.in
+index d45df49ed73b..8ece48734941 100644
+--- a/libqpdf.pc.in
 b/libqpdf.pc.in
+@@ -6,6 +6,6 @@ includedir=@includedir@
+ Name: libqpdf
+ Description: PDF transformation library
+ Version: @PACKAGE_VERSION@
+-Requires.private: zlib, libjpeg
++Requires.private: zlib
+ Libs: -L${libdir} -lqpdf
+ Cflags: -I${includedir}
diff --git a/patches/qpdf-7.0.0/series b/patches/qpdf-7.0.0/series
new file mode 100644
index 0..0de60c199
--- /dev/null
+++ b/patches/qpdf-7.0.0/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Remove-libjpeg-dependency-from-pkg-config.patch
+# c373cfc66b49ecd3549c751d0c0febbe  - git-ptx-patches magic
diff --git a/rules/qpdf.in b/rules/qpdf.in
new file mode 100644
index 0..387e49166
--- /dev/null
+++ b/rules/qpdf.in
@@ -0,0 +1,22 @@
+## SECTION=system_libraries
+
+menuconfig QPDF
+   tristate
+   prompt "qpdf  "
+
+   select LIBJPEG
+   select ZLIB
+
+   help
+ QPDF is a library that can be used to linearize (web-optimize),
+ encrypt (password-protect), decrypt, and inspect PDF files.
+
+if QPDF
+
+config QPDF_TOOLS
+   bool "install tools"
+   help
+ Install the tools. Those include qpdf, zlib-flate, and fix-qdf.
+
+endif
+# vim: ft=kconfig ts=8 noet tw=80
diff --git a/rules/qpdf.make b/rules/qpdf.make
new file mode 100644
index 0..8d03a8b8b
--- /dev/null
+++ b/rules/qpdf.make
@@ -0,0 +1,95 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Roland Hieber 
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_QPDF) += qpdf
+
+#
+# Paths and names
+#
+QPDF_VERSION   := 7.0.0
+QPDF_MD5   := c3ff408f69b3a6b2b3b4c8b373b2600c
+QPDF   := qpdf-$(QPDF_VERSION)
+QPDF_SUFFIX:= tar.gz
+QPDF_URL   := $(call ptx/mirror, SF, 
/qpdf/qpdf/$(QPDF_VERSION)/$(QPDF).$(QPDF_SUFFIX))
+QPDF_SOURCE:= $(SRCDIR)/$(QPDF).$(QPDF_SUFFIX)
+QPDF_DIR   := $(BUILDDIR)/$(QPDF)
+QPDF_LICENSE   := Artistic-2.0
+
+# 
+# Prepare
+# 
+
+# We emulate --enable-external-libs as minimally as possible
+QPDF_CONF_ENV  := \
+   $(CROSS_ENV) \
+   LIBS="-lz -ljpeg"
+
+#
+# autoconf
+#
+# Note: --with-random sets RANDOM_SOURCE, which is not used at all when
+# --enable-insecure-random is given. Nevertheless, autoconf will try to
+# autodetect whether /dev/urandom exists, which fails when cross-compiling.
+QPDF_CONF_TOOL := autoconf
+QPDF_CONF_OPT  := \