unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 24069@debbugs.gnu.org
Subject: bug#24069: [PATCHv4] Re: bug#24069: gcc man page is broken
Date: Tue, 03 Oct 2017 19:44:31 -0400	[thread overview]
Message-ID: <87bmlneqzk.fsf_-_@gmail.com> (raw)
In-Reply-To: <8760bx2ce9.fsf_-_@gmail.com> (Maxim Cournoyer's message of "Mon, 02 Oct 2017 22:28:14 -0400")

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

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Patch v3 still doesn't fix the problem. There are now pod2man errors
> that prevent correctly generating the man pages:
[...]
> (pod2man --center="GNU" --release="gcc-5.4.0" --date=2016-06-03 --section=7 gpl.pod > doc/gpl.7.T$$ && \
>         mv -f doc/gpl.7.T$$ doc/gpl.7) || \
>         (rm -f doc/gpl.7.T$$ && exit 1)
> pod2man: unable to format gpl.pod
> make: [Makefile:3061: doc/gpl.7] Error 1 (ignored)
> ../../gcc-5.4.0/gcc/cp/Make-lang.in:189: update target 'doc/g++.1' due to: doc/gcc.1
> cp doc/gcc.1 doc/g++.1
> rm gcc.pod
> make: Leaving directory '/tmp/guix-build-gcc-5.4.0.drv-0/build/gcc'
>

Apparently GCC < 6 required a patch to its texi2pod.pl script, which had
a syntax problem. The attached patch fixes this last problem. I could
successfully build GCC 5.4.0 by using a derived package for testing
(otherwise it would trigger a world rebuild which was never ending of my
lesser machine).

Here's the patch used to test it:

--8<---------------cut here---------------start------------->8---
 gnu/packages/gcc.scm                        | 21 +++++++++++++++++++++
 gnu/packages/patches/gcc-fix-texi2pod.patch | 19 +++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 gnu/packages/patches/gcc-fix-texi2pod.patch

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 7870d4513..320201b9c 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -395,6 +395,27 @@ Go.  It also includes runtime support libraries for these languages.")
     ;; `(("isl" ,isl)
     ;;   ,@(package-inputs gcc-4.7)))))
 
+(define-public gcc-5-dev
+  (package (inherit gcc-5)
+    (name "gcc-dev")
+    (version "5.4.0-dev")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnu/gcc/gcc-"
+                                  version "/gcc-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0fihlcy5hnksdxk0sn6bvgnyq8gfrgs8m794b1jxwd1dxinzg3b0"))
+              (patches (search-patches "gcc-arm-bug-71399.patch"
+                                       "gcc-strmov-store-file-names.patch"
+                                       "gcc-asan-powerpc-missing-include.patch"
+                                       "gcc-5.0-libvtv-runpath.patch"
+                                       "gcc-5-source-date-epoch-1.patch"
+                                       "gcc-5-source-date-epoch-2.patch"
+                                       "gcc-fix-texi2pod.patch"))))
+    (native-inputs `(("perl" ,perl)   ;for manpages
+                     ("texinfo" ,texinfo)))))
+
 (define-public gcc-6
   (package
     (inherit gcc-5)
diff --git a/gnu/packages/patches/gcc-fix-texi2pod.patch b/gnu/packages/patches/gcc-fix-texi2pod.patch
new file mode 100644
index 000000000..28bd56a38
--- /dev/null
+++ b/gnu/packages/patches/gcc-fix-texi2pod.patch
@@ -0,0 +1,19 @@
+This patch was taken from the official GCC git repository.
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff_plain;f=contrib%2Ftexi2pod.pl;h=91bdbb5cea933d0381f2924ab94490fca31d5800;hp=eba1bcaa3cffa78b46030b219d04fe7d68367658;hb=67b56c905078d49d3e4028085e5cb1e1fb87a8aa;hpb=2f508a78310caab123e9794d3dcfe41f2769449b
+
+It fixes a defect in the contrib/texi2pod.pl script that prevented generating
+manual pages. It was corrected in the GCC 6.X series.
+
+diff --git a/contrib/texi2pod.pl b/contrib/texi2pod.pl
+index eba1bca..91bdbb5 100755
+--- a/contrib/texi2pod.pl
++++ b/contrib/texi2pod.pl
+@@ -316,7 +316,7 @@ while(<$inf>) {
+ 	@columns = ();
+ 	for $column (split (/\s*\@tab\s*/, $1)) {
+ 	    # @strong{...} is used a @headitem work-alike
+-	    $column =~ s/^\@strong{(.*)}$/$1/;
++	    $column =~ s/^\@strong\{(.*)\}$/$1/;
+ 	    push @columns, $column;
+ 	}
+ 	$_ = "\n=item ".join (" : ", @columns)."\n";
--8<---------------cut here---------------end--------------->8---

I could then build gcc-dev and verify that the man pages gcc and cpp
were working correctly in an environment instantiated using:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix environment --pure --ad-hoc gcc-dev man-db
--8<---------------cut here---------------end--------------->8---

The complete patch is attached; it should be good for core-updates.

Thank you,

Maxim


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-gcc-Fix-manual-pages.patch --]
[-- Type: text/x-patch, Size: 7045 bytes --]

From 7229d7887289316031847893f8ad020ff07bdcdd Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Sun, 1 Oct 2017 09:27:31 -0400
Subject: [PATCH] gnu: gcc: Fix manual pages.

Fixes bug #24069. perl is made a native input to all of the gcc-* packages
except for gcc-boot0; perl-boot0 is made a native input to gcc-final.

* gnu/packages/patches/gcc-fix-texi2pod.patch: Add patch file to fix texi2pod.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/gcc.scm (gcc-4.7, gcc-4.8, gcc-4.9, gcc-5): Use it.
(gcc-4.7)[native-inputs]: Add perl.
(gcc-4.9)[native-inputs]: Likewise.
* gnu/packages/commencement.scm (gcc-boot0)[native-inputs]: Filter out perl.
(gcc-final)[native-inputs]: Add perl-boot0.
---
 gnu/local.mk                                |  1 +
 gnu/packages/commencement.scm               |  9 ++++++---
 gnu/packages/gcc.scm                        | 19 +++++++++++++------
 gnu/packages/patches/gcc-fix-texi2pod.patch | 19 +++++++++++++++++++
 4 files changed, 39 insertions(+), 9 deletions(-)
 create mode 100644 gnu/packages/patches/gcc-fix-texi2pod.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index edd6d8237..06b059341 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -626,6 +626,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-arm-link-spec-fix.patch		\
   %D%/packages/patches/gcc-asan-powerpc-missing-include.patch	\
   %D%/packages/patches/gcc-cross-environment-variables.patch	\
+  %D%/packages/patches/gcc-fix-texi2pod.patch			\
   %D%/packages/patches/gcc-libvtv-runpath.patch			\
   %D%/packages/patches/gcc-strmov-store-file-names.patch	\
   %D%/packages/patches/gcc-4.6-gnu-inline.patch			\
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ec7677814..194feda0a 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -286,9 +286,11 @@
                ("libc-native" ,@(assoc-ref %boot0-inputs "libc"))
                ,@(alist-delete "libc" %boot0-inputs)))
 
-     ;; No need for Texinfo at this stage.
-     (native-inputs (alist-delete "texinfo"
-                                  (package-native-inputs gcc))))))
+     ;; No need for the documentation native-inputs at this stage.
+     (native-inputs
+      (alist-delete "texinfo"
+                    (alist-delete "perl"
+                                  (package-native-inputs gcc)))))))
 
 (define perl-boot0
   (let ((perl (package
@@ -779,6 +781,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
     ;; scripts such as 'mkheaders' and 'fixinc.sh' (XXX: who cares about these
     ;; scripts?).
     (native-inputs `(("texinfo" ,texinfo-boot0)
+                     ("perl" ,perl-boot0) ;for manpages
                      ("static-bash" ,static-bash-for-glibc)
                      ,@(package-native-inputs gcc-boot0)))
 
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 7870d4513..1079a3e14 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -138,7 +138,8 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                                    version "/gcc-" version ".tar.bz2"))
                (sha256
                 (base32
-                 "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))))
+                 "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))
+               (patches (search-patches "gcc-fix-texi2pod.patch"))))
       (build-system gnu-build-system)
 
       ;; Separate out the run-time support libraries because all the
@@ -155,7 +156,8 @@ where the OS part is overloaded to denote a specific ABI---into GCC
 
       ;; GCC < 5 is one of the few packages that doesn't ship .info files.
       ;; Newer texinfos fail to build the manual, so we use an older one.
-      (native-inputs `(("texinfo" ,texinfo-5)))
+      (native-inputs `(("perl" ,perl)   ;for manpages
+                       ("texinfo" ,texinfo-5)))
 
       (arguments
        `(#:out-of-source? #t
@@ -351,7 +353,8 @@ Go.  It also includes runtime support libraries for these languages.")
               (sha256
                (base32
                 "08yggr18v373a1ihj0rg2vd6psnic42b518xcgp3r9k81xz1xyr2"))
-              (patches (search-patches "gcc-arm-link-spec-fix.patch"))))
+              (patches (search-patches "gcc-arm-link-spec-fix.patch"
+                                       "gcc-fix-texi2pod.patch"))))
     (supported-systems %supported-systems)
     (inputs
      `(("isl" ,isl-0.11)
@@ -369,8 +372,11 @@ Go.  It also includes runtime support libraries for these languages.")
                (base32
                 "14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
               (patches (search-patches "gcc-arm-bug-71399.patch"
-                                       "gcc-libvtv-runpath.patch"))))
-    (native-inputs `(("texinfo" ,texinfo)))))
+                                       "gcc-libvtv-runpath.patch"
+                                       "gcc-fix-texi2pod.patch"))))
+    ;; Override inherited texinfo-5 with latest version.
+    (native-inputs `(("perl" ,perl)   ;for manpages
+                     ("texinfo" ,texinfo)))))
 
 (define-public gcc-5
   ;; Note: GCC >= 5 ships with .info files but 'make install' fails to install
@@ -389,7 +395,8 @@ Go.  It also includes runtime support libraries for these languages.")
                                        "gcc-asan-powerpc-missing-include.patch"
                                        "gcc-5.0-libvtv-runpath.patch"
                                        "gcc-5-source-date-epoch-1.patch"
-                                       "gcc-5-source-date-epoch-2.patch"))))))
+                                       "gcc-5-source-date-epoch-2.patch"
+                                       "gcc-fix-texi2pod.patch"))))))
     ;; TODO: gcc-5 doesn't need cloog.
     ;;(inputs
     ;; `(("isl" ,isl)
diff --git a/gnu/packages/patches/gcc-fix-texi2pod.patch b/gnu/packages/patches/gcc-fix-texi2pod.patch
new file mode 100644
index 000000000..28bd56a38
--- /dev/null
+++ b/gnu/packages/patches/gcc-fix-texi2pod.patch
@@ -0,0 +1,19 @@
+This patch was taken from the official GCC git repository.
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff_plain;f=contrib%2Ftexi2pod.pl;h=91bdbb5cea933d0381f2924ab94490fca31d5800;hp=eba1bcaa3cffa78b46030b219d04fe7d68367658;hb=67b56c905078d49d3e4028085e5cb1e1fb87a8aa;hpb=2f508a78310caab123e9794d3dcfe41f2769449b
+
+It fixes a defect in the contrib/texi2pod.pl script that prevented generating
+manual pages. It was corrected in the GCC 6.X series.
+
+diff --git a/contrib/texi2pod.pl b/contrib/texi2pod.pl
+index eba1bca..91bdbb5 100755
+--- a/contrib/texi2pod.pl
++++ b/contrib/texi2pod.pl
+@@ -316,7 +316,7 @@ while(<$inf>) {
+ 	@columns = ();
+ 	for $column (split (/\s*\@tab\s*/, $1)) {
+ 	    # @strong{...} is used a @headitem work-alike
+-	    $column =~ s/^\@strong{(.*)}$/$1/;
++	    $column =~ s/^\@strong\{(.*)\}$/$1/;
+ 	    push @columns, $column;
+ 	}
+ 	$_ = "\n=item ".join (" : ", @columns)."\n";
-- 
2.14.1


  reply	other threads:[~2017-10-03 23:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 20:23 bug#24069: gcc man page is broken Danny Milosavljevic
2017-03-30 22:22 ` Branson, Joshua A
2017-09-30 20:36   ` Maxim Cournoyer
2017-10-01 13:39     ` bug#24069: [PATCH] " Maxim Cournoyer
2017-10-01 15:54       ` bug#24069: [PATCHv2] " Maxim Cournoyer
2017-10-02  9:24         ` Efraim Flashner
2017-10-02 14:53           ` Ludovic Courtès
2017-10-02 20:15             ` Maxim Cournoyer
2017-10-03  2:28               ` bug#24069: [PATCHv3] " Maxim Cournoyer
2017-10-03 23:44                 ` Maxim Cournoyer [this message]
2017-10-31 15:16                   ` bug#24069: [PATCHv4] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bmlneqzk.fsf_-_@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=24069@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).