From 4e0c4ab7f962a56b1c5b023b40dbeb3e856c96f6 Mon Sep 17 00:00:00 2001 From: Ivan Vilata i Balaguer Date: Mon, 7 Mar 2022 00:47:32 +0100 Subject: gnu: transfig: Fix "multiple definition" errors with GCC 10+. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/transfig-gcc10-fno-common.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/xfig.scm (transfig)[source]: Use patch "transfig-gcc10-fno-common.patch" to avoid "multiple definition" errors with GCC 10+ and "-f-no-common". Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + .../patches/transfig-gcc10-fno-common.patch | 33 ++++++++++++++++++++++ gnu/packages/xfig.scm | 5 +++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/transfig-gcc10-fno-common.patch diff --git a/gnu/local.mk b/gnu/local.mk index 60ee713508..484757b207 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1855,6 +1855,7 @@ dist_patch_DATA = \ gnu/packages/patches/tootle-reason-phrase.patch \ %D%/packages/patches/tor-sandbox-i686.patch \ %D%/packages/patches/transcode-ffmpeg.patch \ + %D%/packages/patches/transfig-gcc10-fno-common.patch \ %D%/packages/patches/transmission-honor-localedir.patch \ %D%/packages/patches/tremc-fix-decodestring.patch \ %D%/packages/patches/trytond-add-egg-modules-to-path.patch \ diff --git a/gnu/packages/patches/transfig-gcc10-fno-common.patch b/gnu/packages/patches/transfig-gcc10-fno-common.patch new file mode 100644 index 0000000000..ebe9236533 --- /dev/null +++ b/gnu/packages/patches/transfig-gcc10-fno-common.patch @@ -0,0 +1,33 @@ +Fixes "multiple definition" errors when building with GCC 10+. + +Based on . +--- a/fig2dev/dev/gensvg.c 2010-07-01 22:41:16.000000000 +0200 ++++ b/fig2dev/dev/gensvg.c 2022-02-27 20:02:33.379945500 +0100 +@@ -230,10 +230,12 @@ + }; + + /* arrowhead arrays */ +-Point points[50], fillpoints[50], clippoints[50]; +-int npoints, nfillpoints, nclippoints; +-int arrowx1, arrowy1; /* first point of object */ +-int arrowx2, arrowy2; /* second point of object */ ++Point fillpoints[50]; ++int nfillpoints; ++extern Point points[50], clippoints[50]; ++extern int npoints, nclippoints; ++extern int arrowx1, arrowy1; /* first point of object */ ++extern int arrowx2, arrowy2; /* second point of object */ + + static int tileno=0; /* number of current tile */ + +--- a/fig2dev/fig2dev.h 2010-03-16 19:53:20.000000000 +0100 ++++ b/fig2dev/fig2dev.h 2022-02-27 19:56:06.072253991 +0100 +@@ -126,7 +126,7 @@ + extern char *prog, *from, *to; + extern char *name; + extern double font_size; +-Boolean correct_font_size; /* use correct font size */ ++extern Boolean correct_font_size; /* use correct font size */ + extern double mag, fontmag; + extern FILE *tfp; + diff --git a/gnu/packages/xfig.scm b/gnu/packages/xfig.scm index ad2f701ff1..1d4d17527c 100644 --- a/gnu/packages/xfig.scm +++ b/gnu/packages/xfig.scm @@ -86,7 +86,10 @@ selected in various ways. For text, 35 fonts are available.") version ".tar.gz")) (sha256 (base32 - "0i3p7qmg2w8qrad3pn42b0miwarql7yy0gpd49b1bpal6bqsiicf")))) + "0i3p7qmg2w8qrad3pn42b0miwarql7yy0gpd49b1bpal6bqsiicf")) + (patches + (search-patches + "transfig-gcc10-fno-common.patch")))) ; fix GCC10 build (build-system gnu-build-system) (native-inputs (list imake makedepend)) -- cgit v1.2.3