From 61528c0b0ad9de8eea101c298f1e78187d93d3c6 Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Fri, 11 Feb 2022 11:54:53 -0600 Subject: swftools package: patches for GCC@10: (#28296) --- .../repos/builtin/packages/swftools/extern.patch | 86 ++++++++++++++++++++++ .../repos/builtin/packages/swftools/package.py | 6 ++ .../packages/swftools/pointer_compare.patch | 14 ++++ 3 files changed, 106 insertions(+) create mode 100644 var/spack/repos/builtin/packages/swftools/extern.patch create mode 100644 var/spack/repos/builtin/packages/swftools/pointer_compare.patch diff --git a/var/spack/repos/builtin/packages/swftools/extern.patch b/var/spack/repos/builtin/packages/swftools/extern.patch new file mode 100644 index 0000000000..012ebc573d --- /dev/null +++ b/var/spack/repos/builtin/packages/swftools/extern.patch @@ -0,0 +1,86 @@ +--- lib/as3/registry.h ++++ lib/as3/registry.h +@@ -153,7 +153,6 @@ void registry_use(slotinfo_t*s); + asset_bundle_list_t*registry_getassets(); + + // static multinames +-classinfo_t voidclass; + classinfo_t* registry_getanytype(); + classinfo_t* registry_getarrayclass(); + classinfo_t* registry_getobjectclass(); +--- lib/gfxpoly/poly.h ++++ lib/gfxpoly/poly.h +@@ -18,7 +18,7 @@ typedef struct _point { + int32_t x; + int32_t y; + } point_t; +-type_t point_type; ++extern type_t point_type; + + #define SEGNR(s) ((int)((s)?(s)->nr:-1)) + +--- src/swfc-feedback.c ++++ src/swfc-feedback.c +@@ -24,6 +24,11 @@ + #include + #include "swfc-feedback.h" + ++char* filename; ++int line; ++int column; ++void (*cleanUp)(); ++ + void syntaxerror(char*format, ...) + { + char buf[1024]; +--- src/swfc-feedback.h ++++ src/swfc-feedback.h +@@ -22,10 +22,10 @@ + #ifndef __FEEDBACK_H + #define __FEEDBACK_H + +-char* filename; +-int line; +-int column; +-void (*cleanUp)(); ++extern char* filename; ++extern int line; ++extern int column; ++extern void (*cleanUp)(); + + void syntaxerror(char*format, ...); + void warning(char*format, ...); +--- src/swfc-history.c ++++ src/swfc-history.c +@@ -23,6 +23,12 @@ + #include + #include "swfc-history.h" + ++FILTER* noFilters; ++FILTER_BLUR* noBlur; ++FILTER_BEVEL* noBevel; ++FILTER_DROPSHADOW* noDropshadow; ++FILTER_GRADIENTGLOW* noGradientGlow; ++ + enum + { + T_BEFORE, +--- src/swfc-history.h ++++ src/swfc-history.h +@@ -55,11 +55,11 @@ enum + + #define IF_FIXED_ALIGNMENT 0x0001 + +-FILTER* noFilters; +-FILTER_BLUR* noBlur; +-FILTER_BEVEL* noBevel; +-FILTER_DROPSHADOW* noDropshadow; +-FILTER_GRADIENTGLOW* noGradientGlow; ++extern FILTER* noFilters; ++extern FILTER_BLUR* noBlur; ++extern FILTER_BEVEL* noBevel; ++extern FILTER_DROPSHADOW* noDropshadow; ++extern FILTER_GRADIENTGLOW* noGradientGlow; + + typedef struct _spline + { diff --git a/var/spack/repos/builtin/packages/swftools/package.py b/var/spack/repos/builtin/packages/swftools/package.py index 1fe30de3f8..dcb12e58e3 100644 --- a/var/spack/repos/builtin/packages/swftools/package.py +++ b/var/spack/repos/builtin/packages/swftools/package.py @@ -25,6 +25,12 @@ class Swftools(AutotoolsPackage): sha256='6a995dfd674c5954f5b967e3d45d6845a186872fcaa4223d725902fd4d679f1b', level=0) + # The patches below are needed for swftools to compile on newer GCC + # versions. These are derived from: + # https://aur.archlinux.org/packages/swftools/#comment-839523 + patch('extern.patch', level=0, when='%gcc@10:') + patch('pointer_compare.patch', level=0, when='%gcc@11:') + depends_on('giflib') depends_on('lame') depends_on('poppler') diff --git a/var/spack/repos/builtin/packages/swftools/pointer_compare.patch b/var/spack/repos/builtin/packages/swftools/pointer_compare.patch new file mode 100644 index 0000000000..4110e66198 --- /dev/null +++ b/var/spack/repos/builtin/packages/swftools/pointer_compare.patch @@ -0,0 +1,14 @@ +--- lib/pdf/xpdf/GlobalParams.cc ++++ lib/pdf/xpdf/GlobalParams.cc +@@ -922,9 +922,9 @@ void GlobalParams::parseFile(GString *fileName, FILE *f) { + char* p = pos1>pos2?pos1:pos2; + int pos = p ? p-cfgFileName : -1; + GString*path = new GString(new GString(cfgFileName), 0, (pos < 0 ? strlen(cfgFileName): pos)); +- if(pos1>=0) ++ if(pos1==0) + path->append('/'); +- else if(pos2>=0) ++ else if(pos2==0) + path->append('\\'); + else + #ifdef WIN32 -- cgit v1.2.3-70-g09d2