fix build with GCC 10 and remove old obsoletes

This commit is contained in:
Zdenek Dohnal 2020-01-23 17:52:25 +01:00
parent bc3414ce3e
commit 165fc502ac
4 changed files with 12672 additions and 52 deletions

View File

@ -0,0 +1,53 @@
From e6c5025df307d3e8c79c3cd801780e4570f8607e Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Thu, 9 Jan 2020 10:20:46 +0100
Subject: [PATCH] foomatic-rip: fix compilation with -fno-common
Starting from the upcoming GCC release 10, the default of -fcommon option will
change to -fno-common. This causes compilation errors in foomatic-rip. These
seem to be due to missing "external" declarations.
https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Code-Gen-Options.html#index-fno-common
---
filter/foomatic-rip/foomaticrip.c | 2 +-
filter/foomatic-rip/options.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/filter/foomatic-rip/foomaticrip.c b/filter/foomatic-rip/foomaticrip.c
index 3b27ce93..2c6cdb66 100644
--- a/filter/foomatic-rip/foomaticrip.c
+++ b/filter/foomatic-rip/foomaticrip.c
@@ -105,7 +105,7 @@ jobparams_t * get_current_job()
}
-dstr_t *postpipe; /* command into which the output of this filter should be piped */
+dstr_t *postpipe = NULL; /* command into which the output of this filter should be piped */
FILE *postpipe_fh = NULL;
FILE * open_postpipe()
diff --git a/filter/foomatic-rip/options.c b/filter/foomatic-rip/options.c
index 481e5c54..3c6b63d4 100644
--- a/filter/foomatic-rip/options.c
+++ b/filter/foomatic-rip/options.c
@@ -38,14 +38,14 @@ typedef struct icc_mapping_entry_s {
} icc_mapping_entry_t;
/* Values from foomatic keywords in the ppd file */
-char printer_model [256];
+extern char printer_model [256];
char printer_id [256];
char driver [128];
char cmd [4096];
char cmd_pdf [4096];
-dstr_t *postpipe = NULL; /* command into which the output of this
+extern dstr_t *postpipe; /* command into which the output of this
filter should be piped */
-char cupsfilter [256];
+extern char cupsfilter [256];
int jobentitymaxlen = 0;
int userentitymaxlen = 0;
int hostentitymaxlen = 0;
--
2.21.1

View File

@ -1,42 +0,0 @@
--- cups-filters-1.22.5/filter/pdftoijs.cxx
+++ cups-filters-1.22.5/filter/pdftoijs.cxx
@@ -286,7 +286,7 @@ int main(int argc, char *argv[]) {
bool reverseVideo;
setErrorCallback(::myErrorFun,NULL);
- globalParams = new GlobalParams();
+ globalParams = std::make_unique<GlobalParams>();
parseOpts(argc, argv);
if (argc == 6) {
--- cups-filters-1.22.5/filter/pdftoopvp/pdftoopvp.cxx.orig 2019-04-07 17:00:58.000000000 +0200
+++ cups-filters-1.22.5/filter/pdftoopvp/pdftoopvp.cxx 2020-01-03 17:56:44.571862630 +0100
@@ -605,7 +605,7 @@ exit(0);
}
// read config file
- globalParams = new GlobalParams();
+ globalParams = std::make_unique<GlobalParams>();
if (enableFreeTypeStr[0]) {
if (!globalParams->setEnableFreeType(enableFreeTypeStr)) {
opvpError(-1,"Bad '-freetype' value on command line");
@@ -766,7 +766,7 @@ err2:
err05:
delete doc;
err0:
- delete globalParams;
+ globalParams.reset();
#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR < 69
// check for memory leaks
--- cups-filters-1.22.5/filter/pdftoraster.cxx.orig 2019-04-07 17:00:58.000000000 +0200
+++ cups-filters-1.22.5/filter/pdftoraster.cxx 2020-01-03 17:56:05.477767380 +0100
@@ -1958,7 +1958,7 @@ int main(int argc, char *argv[]) {
setErrorCallback(::myErrorFun,NULL);
cmsSetLogErrorHandler(lcmsErrorHandler);
- globalParams = new GlobalParams();
+ globalParams = std::make_unique<GlobalParams>();
parseOpts(argc, argv);
if (argc == 6) {

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
Summary: OpenPrinting CUPS filters and backends
Name: cups-filters
Version: 1.22.5
Release: 12%{?dist}
Release: 13%{?dist}
# For a breakdown of the licensing, see COPYING file
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
@ -42,8 +42,11 @@ Patch06: cups-filters-setfilladjust.patch
Patch07: 0001-libcupsfilters-In-generated-PPDs-prefer-Apple-Raster.patch
# 1776271 - Updated cups-browsed in RHEL 7.7 leaks sockets
Patch08: cups-browsed-socket-leak.patch
Patch09: cups-filters-poppler-0.84.0.patch
# built with gcc 10
Patch09: 0001-foomatic-rip-fix-compilation-with-fno-common.patch
# backported from upstream, current code of pdftoraster, backported
# because of FTBFS with new gcc otherwise
Patch10: cups-filters-upstream-pdftoraster.patch
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
@ -122,12 +125,6 @@ Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
# some installations can have ghostscript-cups or foomatic-filters installed,
# but they are provided by cups-filters, so we need to obsolete them to have
# them uninstalled - remove these obsoletes when F31+
Obsoletes: ghostscript-cups
Obsoletes: foomatic-filters
%package libs
Summary: OpenPrinting CUPS filters and backends - cupsfilters and fontembed libraries
# LGPLv2: libcupsfilters
@ -166,7 +163,8 @@ This is the development package for OpenPrinting CUPS filters and backends.
%patch06 -p1 -b .setfilladjust
%patch07 -p1 -b .prefer-apple-raster
%patch08 -p1 -b .socket-leak
%patch09 -p1 -b .poppler-0.84.0
%patch09 -p1 -b .gcc10
%patch10 -p1 -b .pdftoraster
%build
# work-around Rpath
@ -315,6 +313,9 @@ make check
%{_libdir}/libfontembed.so
%changelog
* Wed Jan 22 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-13
- fix build with GCC 10 and remove old obsoletes
* Fri Jan 17 2020 Marek Kasik <mkasik@redhat.com> - 1.22.5-11
- Rebuild for poppler-0.84.0