From b5352c2177011ca389cbb7c68e78447549cbdaaa Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Wed, 29 Dec 2021 11:41:49 +0100 Subject: [PATCH] package/qpdf: bump to version 10.5.0 - Drop patches (already in version and C++14 now required) - openssl is an optional dependency since version 10.0.0 and https://github.com/qpdf/qpdf/commit/0f2507234fbe3bd305404b1267607b9900857523 - wchar is not mandatory since version 10.0.0 and https://github.com/qpdf/qpdf/commit/2100b4ce152e9c70b3ce8760112d5a24ead4e52d - atomic is needed since version 10.0.0 and https://github.com/qpdf/qpdf/commit/c5c1a028cdd3cf345046c46963fb0fdacfb2c33c - C++14 is required since version 10.2.0 and https://github.com/qpdf/qpdf/commit/1b3f84f967daf9a668a5b1f5337d5d3d96e9112b http://qpdf.sourceforge.net/files/qpdf-manual.html#ref.release-notes Signed-off-by: Fabrice Fontaine Signed-off-by: Thomas Petazzoni --- package/cups-filters/Config.in | 8 +- ...ests-cxx11.cc-fix-build-with-gcc-4.8.patch | 38 -------- ...to-be-safe-if-downstream-write-fails.patch | 86 ------------------- package/qpdf/Config.in | 9 +- package/qpdf/qpdf.hash | 4 +- package/qpdf/qpdf.mk | 14 ++- 6 files changed, 21 insertions(+), 138 deletions(-) delete mode 100644 package/qpdf/0001-libtests-cxx11.cc-fix-build-with-gcc-4.8.patch delete mode 100644 package/qpdf/0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch diff --git a/package/cups-filters/Config.in b/package/cups-filters/Config.in index 9e4e37ca6b..32381e6c1f 100644 --- a/package/cups-filters/Config.in +++ b/package/cups-filters/Config.in @@ -4,10 +4,10 @@ config BR2_PACKAGE_CUPS_FILTERS depends on BR2_USE_MMU depends on BR2_INSTALL_LIBSTDCPP # qpdf depends on !BR2_STATIC_LIBS - depends on BR2_USE_WCHAR # libglib2, qpdf + depends on BR2_USE_WCHAR # libglib2 depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2 depends on BR2_PACKAGE_CUPS - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # qpdf select BR2_PACKAGE_JPEG select BR2_PACKAGE_FONTCONFIG select BR2_PACKAGE_FREETYPE @@ -31,8 +31,8 @@ config BR2_PACKAGE_CUPS_FILTERS http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters -comment "cups-filters needs a toolchain w/ wchar, C++, threads and dynamic library, gcc >= 4.8" +comment "cups-filters needs a toolchain w/ wchar, C++, threads and dynamic library, gcc >= 5" depends on BR2_USE_MMU depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \ !BR2_USE_WCHAR || BR2_STATIC_LIBS || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 + !BR2_TOOLCHAIN_GCC_AT_LEAST_5 diff --git a/package/qpdf/0001-libtests-cxx11.cc-fix-build-with-gcc-4.8.patch b/package/qpdf/0001-libtests-cxx11.cc-fix-build-with-gcc-4.8.patch deleted file mode 100644 index 76504c7475..0000000000 --- a/package/qpdf/0001-libtests-cxx11.cc-fix-build-with-gcc-4.8.patch +++ /dev/null @@ -1,38 +0,0 @@ -From e70c2605a11d12a8eeee3e7eec46077956e11e1f Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Mon, 17 Feb 2020 22:36:08 +0100 -Subject: [PATCH] libtests/cxx11.cc: fix build with gcc 4.8 - -Build fails on gcc 4.8 since version 9.1.1 and commit -752416554086d5d34323bc14164d5084db83cfbd: - -libtests/cxx11.cc: In function 'void do_regex()': -libtests/cxx11.cc:347:42: error: 'strlen' is not a member of 'std' - std::cregex_iterator m3(str7, str7 + std::strlen(str7), expr4); - ^ - -To fix the build failure, add missing include on cstring - -Fixes: - - http://autobuild.buildroot.org/results/ad7fb68ae87850a85509eed80fd0cae8721b10c5 - -Signed-off-by: Fabrice Fontaine -[Upstream status: https://github.com/qpdf/qpdf/pull/400] ---- - libtests/cxx11.cc | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libtests/cxx11.cc b/libtests/cxx11.cc -index fa1dc6b..91ed7b1 100644 ---- a/libtests/cxx11.cc -+++ b/libtests/cxx11.cc -@@ -1,5 +1,6 @@ - #include - #include -+#include - #include - #include - #include --- -2.24.1 - diff --git a/package/qpdf/0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch b/package/qpdf/0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch deleted file mode 100644 index 70017350f2..0000000000 --- a/package/qpdf/0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch +++ /dev/null @@ -1,86 +0,0 @@ -From dc92574c10f3e2516ec6445b88c5d584f40df4e5 Mon Sep 17 00:00:00 2001 -From: Jay Berkenbilt -Date: Mon, 4 Jan 2021 11:55:28 -0500 -Subject: [PATCH] Fix some pipelines to be safe if downstream write fails (fuzz - issue 28262) - -[Retrieved (and updated to remove updates on ChangeLog and fuzz) from: -https://github.com/qpdf/qpdf/commit/dc92574c10f3e2516ec6445b88c5d584f40df4e5] -Signed-off-by: Fabrice Fontaine ---- - ChangeLog | 6 ++++++ - fuzz/qpdf_extra/28262.fuzz | Bin 0 -> 40395 bytes - libqpdf/Pl_AES_PDF.cc | 2 +- - libqpdf/Pl_ASCII85Decoder.cc | 7 +++++-- - libqpdf/Pl_ASCIIHexDecoder.cc | 6 ++++-- - libqpdf/Pl_Count.cc | 2 +- - 6 files changed, 17 insertions(+), 6 deletions(-) - create mode 100644 fuzz/qpdf_extra/28262.fuzz - -diff --git a/libqpdf/Pl_AES_PDF.cc b/libqpdf/Pl_AES_PDF.cc -index 18cf3a4d..2865f804 100644 ---- a/libqpdf/Pl_AES_PDF.cc -+++ b/libqpdf/Pl_AES_PDF.cc -@@ -238,6 +238,6 @@ Pl_AES_PDF::flush(bool strip_padding) - } - } - } -- getNext()->write(this->outbuf, bytes); - this->offset = 0; -+ getNext()->write(this->outbuf, bytes); - } -diff --git a/libqpdf/Pl_ASCII85Decoder.cc b/libqpdf/Pl_ASCII85Decoder.cc -index b8df3e87..9d9f6704 100644 ---- a/libqpdf/Pl_ASCII85Decoder.cc -+++ b/libqpdf/Pl_ASCII85Decoder.cc -@@ -119,10 +119,13 @@ Pl_ASCII85Decoder::flush() - - QTC::TC("libtests", "Pl_ASCII85Decoder partial flush", - (this->pos == 5) ? 0 : 1); -- getNext()->write(outbuf, this->pos - 1); -- -+ // Reset before calling getNext()->write in case that throws an -+ // exception. -+ auto t = this->pos - 1; - this->pos = 0; - memset(this->inbuf, 117, 5); -+ -+ getNext()->write(outbuf, t); - } - - void -diff --git a/libqpdf/Pl_ASCIIHexDecoder.cc b/libqpdf/Pl_ASCIIHexDecoder.cc -index f20a9769..7845268e 100644 ---- a/libqpdf/Pl_ASCIIHexDecoder.cc -+++ b/libqpdf/Pl_ASCIIHexDecoder.cc -@@ -97,12 +97,14 @@ Pl_ASCIIHexDecoder::flush() - - QTC::TC("libtests", "Pl_ASCIIHexDecoder partial flush", - (this->pos == 2) ? 0 : 1); -- getNext()->write(&ch, 1); -- -+ // Reset before calling getNext()->write in case that throws an -+ // exception. - this->pos = 0; - this->inbuf[0] = '0'; - this->inbuf[1] = '0'; - this->inbuf[2] = '\0'; -+ -+ getNext()->write(&ch, 1); - } - - void -diff --git a/libqpdf/Pl_Count.cc b/libqpdf/Pl_Count.cc -index 8077092a..c35619b8 100644 ---- a/libqpdf/Pl_Count.cc -+++ b/libqpdf/Pl_Count.cc -@@ -27,8 +27,8 @@ Pl_Count::write(unsigned char* buf, size_t len) - if (len) - { - this->m->count += QIntC::to_offset(len); -- getNext()->write(buf, len); - this->m->last_char = buf[len - 1]; -+ getNext()->write(buf, len); - } - } - diff --git a/package/qpdf/Config.in b/package/qpdf/Config.in index 56a96e4f41..eadfc5ea92 100644 --- a/package/qpdf/Config.in +++ b/package/qpdf/Config.in @@ -1,8 +1,7 @@ config BR2_PACKAGE_QPDF bool "qpdf" depends on BR2_INSTALL_LIBSTDCPP - depends on BR2_USE_WCHAR - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # C++14 select BR2_PACKAGE_ZLIB select BR2_PACKAGE_JPEG help @@ -15,6 +14,6 @@ config BR2_PACKAGE_QPDF http://qpdf.sourceforge.net/ -comment "qpdf needs a toolchain w/ C++, wchar, gcc >= 4.7" - depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 +comment "qpdf needs a toolchain w/ C++, gcc >= 5" + depends on !BR2_INSTALL_LIBSTDCPP || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_5 diff --git a/package/qpdf/qpdf.hash b/package/qpdf/qpdf.hash index 050c9d9a4c..08a048f2ed 100644 --- a/package/qpdf/qpdf.hash +++ b/package/qpdf/qpdf.hash @@ -1,5 +1,5 @@ -# From https://sourceforge.net/projects/qpdf/files/qpdf/9.1.1/qpdf-9.1.1.sha512/download -sha512 008a11fef663a57ca173631f2053988023babea6c333cfe01db0ef955c8cd36d387ed9f2039f55bd5f9ca94c7a8e400461a09a15c5f89e03bc0817fdd0d3d585 qpdf-9.1.1.tar.gz +# From https://sourceforge.net/projects/qpdf/files/qpdf/10.5.0/qpdf-10.5.0.sha256/download +sha256 88257d36a44fd5c50b2879488324dd9cafc11686ae49d8c4922a4872203ce006 qpdf-10.5.0.tar.gz # Locally computed: sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE.txt sha256 fb929ac30decb4dc3a2eea2bec6c43296a797c5d2d602deb3784ee39430583d5 Artistic-2.0 diff --git a/package/qpdf/qpdf.mk b/package/qpdf/qpdf.mk index c96bf6bf2e..8e0769059d 100644 --- a/package/qpdf/qpdf.mk +++ b/package/qpdf/qpdf.mk @@ -4,7 +4,7 @@ # ################################################################################ -QPDF_VERSION = 9.1.1 +QPDF_VERSION = 10.5.0 QPDF_SITE = http://downloads.sourceforge.net/project/qpdf/qpdf/$(QPDF_VERSION) QPDF_INSTALL_STAGING = YES QPDF_LICENSE = Apache-2.0 or Artistic-2.0 @@ -14,8 +14,9 @@ QPDF_DEPENDENCIES = host-pkgconf zlib jpeg QPDF_CONF_OPTS = --with-random=/dev/urandom -# 0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch -QPDF_IGNORE_CVES += CVE-2021-36978 +ifeq ($(BR2_USE_WCHAR),) +QPDF_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -DQPDF_NO_WCHAR_T" +endif ifeq ($(BR2_PACKAGE_GNUTLS),y) QPDF_CONF_OPTS += --enable-crypto-gnutls @@ -24,4 +25,11 @@ else QPDF_CONF_OPTS += --disable-crypto-gnutls endif +ifeq ($(BR2_PACKAGE_OPENSSL),y) +QPDF_CONF_OPTS += --enable-crypto-openssl +QPDF_DEPENDENCIES += openssl +else +QPDF_CONF_OPTS += --disable-crypto-openssl +endif + $(eval $(autotools-package))