groff: import newer version from upstream

This includes a few more fixes including the one for parallel building
the pdfmark subdir.

BUG=chromium-os:24481
TEST=`emerge groff` works

Change-Id: I16c110b0421b1ae8889517893495d6cf84cc345b
Reviewed-on: https://gerrit.chromium.org/gerrit/13351
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2011-12-21 14:35:04 -05:00 committed by Gerrit
parent 3f35c9c135
commit dc028ce244
7 changed files with 373 additions and 0 deletions

View File

@ -0,0 +1,8 @@
AUX groff-1.19.2-man-unicode-dashes.patch 574 RMD160 759b9822f6950eeaac78ac16cfc8ebf58a77be38 SHA1 a7859ebef38fc0e2d73c1bc500e716c77ce8dc47 SHA256 e8fa93d3536bb6053ec104b567444cec7da8f101e24923dc4003efc8b7bf5bbe
AUX groff-1.20.1-Thtml-mem-leak.patch 1814 RMD160 e10f328091986ce4a9c3b6e3c7624a48befbecd6 SHA1 db01f9081d2dacf06476913fac3538f9dfa608fd SHA256 b0fc131d0deed47ebe6432fddf93ef8e2bca2dec8f460a39441fadd76361dc8f
AUX groff-1.20.1-double-frees-mem-leaks.patch 2752 RMD160 4aedb3ced29c09120df170331c5fb439695c039c SHA1 627d3214018a161b29d217abb64874b04c5d5303 SHA256 f4e53e33fbb5ca53841b0984ea9281a5009243ac59b774373c1dd4a9b257dd75
AUX groff-1.20.1-pdfmark-parallel.patch 1392 RMD160 c2e9d008ad9e03826a00b2cbc0c27d8dec265dd0 SHA1 6d8c2d5851f88f61c11aa79df102396abfa85559 SHA256 cf6f9328956d14e354632ad3ecfe740789a450b519125c6057affeadef05aa5e
AUX groff-1.20.1-tmac-ec.patch 763 RMD160 ed2df5ee3287d109b1efa85751c6620553e4b251 SHA1 76516a1a0794f310b74875d80b6651fe19735108 SHA256 5d141c2389da50a689b1f7ac6b704c25b42041b96f6b1a28faa3080084d1fdb9
DIST groff-1.20.1-r2-japanese.patch.bz2 52496 RMD160 a099b495315cc7d5863d756e227b67916d37d5f8 SHA1 7c689412f817e3326cdd8ee1d002a3a6562b9f54 SHA256 becc287fd0a748b73a04bbf45f0a3add6fc4754490b009c35624d0c93125b476
DIST groff-1.20.1.tar.gz 3594658 RMD160 ec311727206d183fb04f1b4bd01c1284142fdb52 SHA1 3066587d73df73c2bda235034f4515cf52d22549 SHA256 b645878135cb620c6c417c5601bfe96172245af12045540d7344938b4c2cd805
EBUILD groff-1.20.1-r3.ebuild 2462 RMD160 5b05d1f5bab1b980f3b4eb2fcc3c6bf5b0c87946 SHA1 5faa2d9758ef8ecf70c8d34f6c376129257111a6 SHA256 212c20b534755e9b09d462c62d2258e3ae2f1792e490c6d03f3463d146967799

View File

@ -0,0 +1,24 @@
format dashes as dashes so as to not confuse people
http://bugs.gentoo.org/16108
http://bugs.gentoo.org/17580
http://bugs.gentoo.org/121502
--- tmac/man.local
+++ tmac/man.local
@@ -1,2 +1,6 @@
.\" This file is loaded after an-old.tmac.
.\" Put any local modifications to an-old.tmac here.
+.if '\*[.T]'utf8' \{\
+. char \- \N'45'
+. char - \N'45'
+.\}
--- tmac/mdoc.local
+++ tmac/mdoc.local
@@ -1,2 +1,6 @@
.\" This file is loaded after doc.tmac.
.\" Put any local modifications to doc.tmac here.
+.if '\*[.T]'utf8' \{\
+. char \- \N'45'
+. char - \N'45'
+.\}

View File

@ -0,0 +1,70 @@
https://bugs.gentoo.org/294045
From f68481cd98e1d8451dd16d6d1b1b3513110a5559 Mon Sep 17 00:00:00 2001
From: wl <wl>
Date: Fri, 10 Apr 2009 18:13:29 +0000
Subject: [PATCH] Fix a memory leak in troff for -Thtml.
Reported by Urs Eggli <Urs.Eggli@zuerich.ch>.
* src/roff/troff/node.h (node::~node): Move to...
* src/roff/troff/node.cpp: Here. Free `state' and `push_state'.
---
ChangeLog | 8 ++++++++
src/roff/troff/node.cpp | 11 ++++++++++-
src/roff/troff/node.h | 4 ----
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index afe4998..58cf59a 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -1811,6 +1811,14 @@ void suppress_output_file::really_transparent_char(unsigned char)
{
}
+inline node::~node()
+{
+ if (state != 0)
+ delete state;
+ if (push_state != 0)
+ delete push_state;
+}
+
/* glyphs, ligatures, kerns, discretionary breaks */
class charinfo_node : public node {
@@ -4643,7 +4651,7 @@ void hline_node::tprint(troff_output_file *out)
}
else {
hunits rem = x - w*i;
- if (rem > H0)
+ if (rem > H0) {
if (n->overlaps_horizontally()) {
if (out->is_on())
n->tprint(out);
@@ -4651,6 +4659,7 @@ void hline_node::tprint(troff_output_file *out)
}
else
out->right(rem);
+ }
while (--i >= 0)
if (out->is_on())
n->tprint(out);
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index a598ae5..9850be2 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -132,10 +132,6 @@ inline node::node(node *n, statem *s, int divlevel)
state = 0;
}
-inline node::~node()
-{
-}
-
// 0 means it doesn't, 1 means it does, 2 means it's transparent
int node_list_ends_sentence(node *);
--
1.7.1.1

View File

@ -0,0 +1,98 @@
https://bugs.gentoo.org/294045
From be095a293e09eae67254f59ce878b1a36233b447 Mon Sep 17 00:00:00 2001
From: wl <wl>
Date: Tue, 24 Nov 2009 13:32:17 +0000
Subject: [PATCH] Fix double frees and memory leaks.
* src/roff/troff/env.cpp (environment::make_tag): Use local object.
* src/roff/troff/input.cpp (input_stack::check_end_diversion): Free
`diversion_state' here.
(interpolate_arg): Fix memory leaks.
* src/roff/troff/mtsm.cpp (mtsm::pop_state): Don't free `sp->state'.
---
ChangeLog | 10 ++++++++++
src/roff/troff/env.cpp | 13 +++++++------
src/roff/troff/input.cpp | 5 +++++
src/roff/troff/mtsm.cpp | 2 --
4 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 56bfe21..13672cc 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2213,14 +2213,15 @@ node *environment::make_tag(const char *nm, int i)
*/
if (curdiv == topdiv && topdiv->before_first_page)
topdiv->begin_page();
- macro *m = new macro;
- m->append_str("devtag:");
+
+ macro m;
+ m.append_str("devtag:");
for (const char *p = nm; *p; p++)
if (!invalid_input_char((unsigned char)*p))
- m->append(*p);
- m->append(' ');
- m->append_int(i);
- return new special_node(*m);
+ m.append(*p);
+ m.append(' ');
+ m.append_int(i);
+ return new special_node(m);
}
return 0;
}
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 17d2451..7c816e8 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -531,6 +531,8 @@ void input_stack::check_end_diversion(input_iterator *t)
{
if (t->is_diversion) {
div_level--;
+ if (diversion_state)
+ delete diversion_state;
diversion_state = t->diversion_state;
}
}
@@ -4398,6 +4400,7 @@ static void interpolate_arg(symbol nm)
args += c;
if (i != limit)
args += ' ';
+ delete p;
}
if (limit > 0) {
args += '\0';
@@ -4419,6 +4422,7 @@ static void interpolate_arg(symbol nm)
args += '"';
if (i != limit)
args += ' ';
+ delete p;
}
if (limit > 0) {
args += '\0';
@@ -4438,6 +4442,7 @@ static void interpolate_arg(symbol nm)
}
if (input_stack::space_follows_arg(i))
args += ' ';
+ delete p;
}
if (limit > 0) {
args += '\0';
diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp
index 83a6906..79e2f78 100644
--- a/src/roff/troff/mtsm.cpp
+++ b/src/roff/troff/mtsm.cpp
@@ -390,8 +390,6 @@ void mtsm::pop_state()
#endif
if (sp == 0)
fatal("empty state machine stack");
- if (sp->state)
- delete sp->state;
sp->state = 0;
stack *t = sp;
sp = sp->next;
--
1.7.1.1

View File

@ -0,0 +1,46 @@
http://crosbug.com/24481
https://savannah.gnu.org/bugs/index.php?35146
From 324a699b3903bd7d9d248bc229ab8518fc47cbed Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Wed, 21 Dec 2011 14:15:50 -0500
Subject: [PATCH] pdfmark: fix parallel build race failure
Sometimes building in parallel will fail in the pdfmark directory:
make[2]: Entering directory '.../contrib/pdfmark'
rm -f pdfroff
rm -f pdfmark.pdf
sed -f ... ./pdfroff.sh >pdfroff
...; ./pdfroff ... pdfmark.ms >pdfmark.pdf
/bin/sh: ./pdfroff: Permission denied
chmod +x pdfroff
make[2]: *** [pdfmark.pdf] Error 126
This is because the generated pdf files use the local generated pdfroff
helper script, but they don't depend directly upon it, so make tries to
create the two in parallel and randomly falls over.
Have all the .pdf files explicitly depend on the pdfroff helper script.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
contrib/pdfmark/Makefile.sub | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/contrib/pdfmark/Makefile.sub b/contrib/pdfmark/Makefile.sub
index 9eb2763..36c9e0f 100644
--- a/contrib/pdfmark/Makefile.sub
+++ b/contrib/pdfmark/Makefile.sub
@@ -66,6 +66,9 @@ PDFROFF=\
all: pdfroff $(make_pdfdoc)
+# The pdf files use the local script to generate.
+$(PDFDOCFILES): pdfroff
+
pdfdoc: gnu.eps $(PDFDOCFILES)
gnu.eps:
--
1.7.6.1

View File

@ -0,0 +1,35 @@
https://bugs.gentoo.org/263524
revision 1.40
date: 2009-04-01 02:59:08 -0400; author: wl; state: Exp; lines: +3 -3; commitid: VIC1bezuXvKqxhIt;
* tmac/doc.tmac: Call `ec' before mapping characters.
Index: tmac/doc.tmac
===================================================================
RCS file: /sources/groff/groff/tmac/doc.tmac,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -p -r1.39 -r1.40
--- tmac/doc.tmac 2 Jan 2009 23:16:20 -0000 1.39
+++ tmac/doc.tmac 1 Apr 2009 06:59:08 -0000 1.40
@@ -6425,6 +6425,9 @@
.blm doc-empty-line
.
.
+.ec
+.
+.
.\" For UTF-8, map some characters conservatively for the sake
.\" of easy cut and paste.
.
@@ -6438,9 +6441,6 @@
.\}
.
.
-.ec
-.
-.
.\" load local modifications
.mso mdoc.local
.

View File

@ -0,0 +1,92 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/groff/groff-1.20.1-r3.ebuild,v 1.9 2011/02/24 22:13:39 xarthisius Exp $
inherit autotools eutils toolchain-funcs
DESCRIPTION="Text formatter used for man pages"
HOMEPAGE="http://www.gnu.org/software/groff/groff.html"
SRC_URI="mirror://gnu/groff/${P}.tar.gz
linguas_ja? ( mirror://gentoo/${P}-r2-japanese.patch.bz2 )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
IUSE="examples X linguas_ja"
DEPEND=">=sys-apps/texinfo-4.7-r1
X? (
x11-libs/libX11
x11-libs/libXt
x11-libs/libXmu
x11-libs/libXaw
x11-libs/libSM
x11-libs/libICE
)"
src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}"/${PN}-1.19.2-man-unicode-dashes.patch #16108 #17580 #121502
epatch "${FILESDIR}"/${P}-tmac-ec.patch #263524
epatch "${FILESDIR}"/${P}-Thtml-mem-leak.patch #294045
epatch "${FILESDIR}"/${P}-double-frees-mem-leaks.patch #294045
epatch "${FILESDIR}"/${PN}-1.20.1-pdfmark-parallel.patch
# put the docs in the Gentoo-specific spot
sed -i \
-e '/^docdir=/s/=.*/=@docdir@/' \
Makefile.in \
|| die "sed failed"
# Make sure we can cross-compile this puppy
if tc-is-cross-compiler ; then
sed -i \
-e '/^GROFFBIN=/s:=.*:=/usr/bin/groff:' \
-e '/^TROFFBIN=/s:=.*:=/usr/bin/troff:' \
-e '/^GROFF_BIN_PATH=/s:=.*:=:' \
-e '/^GROFF_BIN_DIR=/s:=.*:=:' \
contrib/*/Makefile.sub \
doc/Makefile.in \
doc/Makefile.sub || die "cross-compile sed failed"
fi
cat <<-EOF >> tmac/mdoc.local
.ds volume-operating-system Gentoo
.ds operating-system Gentoo/${KERNEL}
.ds default-operating-system Gentoo/${KERNEL}
EOF
if use linguas_ja ; then
epatch "${WORKDIR}"/${P}-r2-japanese.patch #255292
eautoconf
eautoheader
fi
}
src_compile() {
# Fix problems with not finding g++
# tc-export CC CXX
econf \
--with-appresdir=/usr/share/X11/app-defaults \
--docdir=/usr/share/doc/${PF} \
$(use_with X x) \
$(use linguas_ja && echo --enable-japanese)
emake || die
}
src_install() {
emake install DESTDIR="${D}" || die
# The following links are required for man #123674
dosym eqn /usr/bin/geqn
dosym tbl /usr/bin/gtbl
dodoc BUG-REPORT ChangeLog MORE.STUFF NEWS \
PROBLEMS PROJECTS README REVISION TODO VERSION
if ! use examples ; then
rm -rf "${D}"/usr/share/doc/${PF}/examples
fi
}