unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54279] [PATCH 0/2] Fix transfig build errors.
@ 2022-03-06 23:45 Ivan Vilata i Balaguer
  2022-03-06 23:47 ` [bug#54279] [PATCH 1/2] gnu: transfig: Avoid "ar" option incompatibility with binutils 2.36 Ivan Vilata i Balaguer
  2022-03-06 23:47 ` [bug#54279] [PATCH 2/2] gnu: transfig: Fix "multiple definition" errors with GCC 10+ Ivan Vilata i Balaguer
  0 siblings, 2 replies; 3+ messages in thread
From: Ivan Vilata i Balaguer @ 2022-03-06 23:45 UTC (permalink / raw)
  To: 54279

[-- Attachment #1: Type: text/plain, Size: 860 bytes --]

Hello!  The following patches fix two build errors of the package `transfig`
caused by the upgrade to binutils 2.36 (namely bug
<https://issues.guix.gnu.org/53425> (similar to
<https://bugs.debian.org/981072>) and to GCC 10+ with option `-f-no-common`
(similar to <https://bugs.gentoo.org/706706>, which I found when I fixed the
previous one).  Thanks!

Ivan Vilata i Balaguer (2):
  gnu: transfig: Avoid "ar" option incompatibility with binutils 2.36.
  gnu: transfig: Fix "multiple definition" errors with GCC 10+.

 .../patches/transfig-gcc10-fno-common.patch   | 33 +++++++++++++++++++
 gnu/packages/xfig.scm                         | 14 ++++++--
 2 files changed, 45 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/transfig-gcc10-fno-common.patch

-- 
2.34.0


-- 
Ivan Vilata i Balaguer -- https://elvil.net/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#54279] [PATCH 1/2] gnu: transfig: Avoid "ar" option incompatibility with binutils 2.36.
  2022-03-06 23:45 [bug#54279] [PATCH 0/2] Fix transfig build errors Ivan Vilata i Balaguer
@ 2022-03-06 23:47 ` Ivan Vilata i Balaguer
  2022-03-06 23:47 ` [bug#54279] [PATCH 2/2] gnu: transfig: Fix "multiple definition" errors with GCC 10+ Ivan Vilata i Balaguer
  1 sibling, 0 replies; 3+ messages in thread
From: Ivan Vilata i Balaguer @ 2022-03-06 23:47 UTC (permalink / raw)
  To: 54279

[-- Attachment #1: Type: text/plain, Size: 2066 bytes --]

Fixes <https://issues.guix.gnu.org/53425>.

* gnu/packages/xfig.scm (transfig)[arguments]<#:phases>: Remove "l" option
from "ar" invocation in makefiles to avoid incompatible meaning in binutils
2.36 causing error "ar: libdeps specified more than once".
---
 gnu/packages/xfig.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/xfig.scm b/gnu/packages/xfig.scm
index 9004c79e22..ad2f701ff1 100644
--- a/gnu/packages/xfig.scm
+++ b/gnu/packages/xfig.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2022 Ivan Vilata i Balaguer <ivan@selidor.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -123,6 +124,7 @@ (define-public transfig
                (invoke "xmkmf" "-a")
                (substitute* '("Makefile"
                               "fig2dev/Makefile"
+                              "fig2dev/dev/Makefile"
                               "transfig/Makefile")
                  ;; These imake variables somehow remain undefined
                  (("DefaultGcc2[[:graph:]]*Opt") "-O2")
@@ -131,7 +133,12 @@ (define-public transfig
                  (("(MANPATH = )[[:graph:]]*" _ front)
                   (string-append front out "/share/man"))
                  (("(CONFDIR = )([[:graph:]]*)" _ front default)
-                  (string-append front out default)))
+                  (string-append front out default))
+                 ;; The "l" option was silently ignored until binutils 2.36,
+                 ;; where it got a different purpose.  So remove it to avoid
+                 ;; "ar: libdeps specified more than once".
+                 (("((AR|MODAR) = ar )clq" _ front)
+                  (string-append front "cq")))
                #t)))
          (add-after 'install 'install/doc
            (lambda _
-- 
2.34.0


-- 
Ivan Vilata i Balaguer -- https://elvil.net/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#54279] [PATCH 2/2] gnu: transfig: Fix "multiple definition" errors with GCC 10+.
  2022-03-06 23:45 [bug#54279] [PATCH 0/2] Fix transfig build errors Ivan Vilata i Balaguer
  2022-03-06 23:47 ` [bug#54279] [PATCH 1/2] gnu: transfig: Avoid "ar" option incompatibility with binutils 2.36 Ivan Vilata i Balaguer
@ 2022-03-06 23:47 ` Ivan Vilata i Balaguer
  1 sibling, 0 replies; 3+ messages in thread
From: Ivan Vilata i Balaguer @ 2022-03-06 23:47 UTC (permalink / raw)
  To: 54279

[-- Attachment #1: Type: text/plain, Size: 2730 bytes --]

* gnu/packages/patches/transfig-gcc10-fno-common.patch: New patch.
* gnu/packages/xfig.scm (transfig)[source]<origin>: Use patch
"transfig-gcc10-fno-common.patch" to avoid "multiple definition" errors with
GCC 10+ and "-f-no-common".
---
 .../patches/transfig-gcc10-fno-common.patch   | 33 +++++++++++++++++++
 gnu/packages/xfig.scm                         |  5 ++-
 2 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/transfig-gcc10-fno-common.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 <https://bugs.gentoo.org/show_bug.cgi?id=706706>.
+--- 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 @@ (define-public transfig
                            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))
-- 
2.34.0


-- 
Ivan Vilata i Balaguer -- https://elvil.net/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-06 23:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-06 23:45 [bug#54279] [PATCH 0/2] Fix transfig build errors Ivan Vilata i Balaguer
2022-03-06 23:47 ` [bug#54279] [PATCH 1/2] gnu: transfig: Avoid "ar" option incompatibility with binutils 2.36 Ivan Vilata i Balaguer
2022-03-06 23:47 ` [bug#54279] [PATCH 2/2] gnu: transfig: Fix "multiple definition" errors with GCC 10+ Ivan Vilata i Balaguer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).