Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-electronics/iverilog/, sci-electronics/iverilog/files/
Date: Mon, 14 Sep 2020 18:26:18
Message-Id: 1600107963.c993d8bd5997e5003f88fbffdaac2906db963fae.sam@gentoo
1 commit: c993d8bd5997e5003f88fbffdaac2906db963fae
2 Author: Felix Neumärker <xdch47 <AT> posteo <DOT> de>
3 AuthorDate: Fri Sep 4 16:50:50 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 14 18:26:03 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c993d8bd
7
8 sci-electronics/iverilog: fix compile error
9
10 Closes: https://bugs.gentoo.org/734760
11 Package-Manager: Portage-3.0.5, Repoman-3.0.1
12 Signed-off-by: Felix Neumärker <xdch47 <AT> posteo.de>
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 .../files/iverilog-10.3-gen-bison-header.patch | 97 ++++++++++++++++++++++
16 sci-electronics/iverilog/iverilog-10.3-r2.ebuild | 76 +++++++++++++++++
17 2 files changed, 173 insertions(+)
18
19 diff --git a/sci-electronics/iverilog/files/iverilog-10.3-gen-bison-header.patch b/sci-electronics/iverilog/files/iverilog-10.3-gen-bison-header.patch
20 new file mode 100644
21 index 00000000000..0027184c833
22 --- /dev/null
23 +++ b/sci-electronics/iverilog/files/iverilog-10.3-gen-bison-header.patch
24 @@ -0,0 +1,97 @@
25 +From 5b699c1be73e789831db01e779a41478c0c62309 Mon Sep 17 00:00:00 2001
26 +From: Henner Zeller <h.zeller@×××.org>
27 +Date: Wed, 29 Jul 2020 15:29:08 -0700
28 +Subject: [PATCH] Bison includes its generated header in *.cc. Generate with
29 + correct name.
30 +
31 +The current bison (3.7) generates a *.cc file that includes the header
32 +it generated. For parse.cc this would be parse.hh. Right now, we rename
33 +this header to have a common name used in other files, but this results
34 +in a compile error for the parse.cc file:
35 +
36 +parse.cc:462:10: fatal error: parse.hh: No such file or directory
37 + 462 | #include "parse.hh"
38 + | ^~~~~~~~~~
39 +
40 +Fix this by telling bison to output the header file to the correct
41 +filename in the first place so that we don't have to rename it.
42 +(using the --defines instead of -d option).
43 +
44 +This looks like a bison specific option not available in Posix yacc;
45 +but looks like we're requiring bison anyway.
46 +
47 +Signed-off-by: Henner Zeller <h.zeller@×××.org>
48 +---
49 + Makefile.in | 4 +---
50 + tgt-pcb/Makefile.in | 4 +---
51 + vhdlpp/Makefile.in | 4 +---
52 + vvp/Makefile.in | 4 +---
53 + 4 files changed, 4 insertions(+), 12 deletions(-)
54 +
55 +diff --git a/Makefile.in b/Makefile.in
56 +index 5ac5515a..cc8cac46 100644
57 +--- a/Makefile.in
58 ++++ b/Makefile.in
59 +@@ -256,10 +256,8 @@ parse.o: parse.cc
60 +
61 + # Build this in two steps to avoid parallel build issues (see pr3462585)
62 + parse.cc: $(srcdir)/parse.y
63 +- $(YACC) --verbose -t -p VL -d -o $@ $<
64 ++ $(YACC) --verbose -t -p VL --defines=parse.h -o $@ $<
65 + parse.h: parse.cc
66 +- mv parse.cc.h $@ 2>/dev/null || mv parse.hh $@
67 +- touch $@
68 +
69 + syn-rules.cc: $(srcdir)/syn-rules.y
70 + $(YACC) --verbose -t -p syn_ -o $@ $<
71 +diff --git a/tgt-pcb/Makefile.in b/tgt-pcb/Makefile.in
72 +index a5f9b7d5..7345e195 100644
73 +--- a/tgt-pcb/Makefile.in
74 ++++ b/tgt-pcb/Makefile.in
75 +@@ -89,10 +89,8 @@ fp_lex.cc: $(srcdir)/fp.lex
76 + $(LEX) -s -ofp_lex.cc $(srcdir)/fp.lex
77 +
78 + fp.cc: $(srcdir)/fp.y
79 +- $(YACC) --verbose -t -p fp -d -o $@ $<
80 ++ $(YACC) --verbose -t -p fp --defines=fp.h -o $@ $<
81 + fp.h: fp.cc
82 +- mv fp.cc.h $@ 2>/dev/null || mv fp.hh $@
83 +- touch $@
84 +
85 + ifeq (@WIN32@,yes)
86 + TGTLDFLAGS=-L.. -livl
87 +diff --git a/vhdlpp/Makefile.in b/vhdlpp/Makefile.in
88 +index 53ae140a..458178bd 100644
89 +--- a/vhdlpp/Makefile.in
90 ++++ b/vhdlpp/Makefile.in
91 +@@ -117,10 +117,8 @@ lexor.cc: $(srcdir)/lexor.lex
92 +
93 + # Build this in two steps to avoid parallel build issues (see pr3462585)
94 + parse.cc: $(srcdir)/parse.y
95 +- $(YACC) --verbose -t -d -o $@ $<
96 ++ $(YACC) --verbose -t --defines=parse.h -o $@ $<
97 + parse.h: parse.cc
98 +- mv parse.cc.h $@ 2>/dev/null || mv parse.hh $@
99 +- touch $@
100 +
101 + lexor_keyword.o: lexor_keyword.cc parse.h
102 +
103 +diff --git a/vvp/Makefile.in b/vvp/Makefile.in
104 +index 8ccdb1d2..cdd940f5 100644
105 +--- a/vvp/Makefile.in
106 ++++ b/vvp/Makefile.in
107 +@@ -142,10 +142,8 @@ tables.o: tables.cc
108 +
109 + # Build this in two steps to avoid parallel build issues (see pr3462585)
110 + parse.cc: $(srcdir)/parse.y
111 +- $(YACC) --verbose -t -d -o $@ $<
112 ++ $(YACC) --verbose -t --defines=parse.h -o $@ $<
113 + parse.h: parse.cc
114 +- mv parse.cc.h $@ 2>/dev/null || mv parse.hh $@
115 +- touch $@
116 +
117 + lexor.cc: $(srcdir)/lexor.lex
118 + $(LEX) -s -olexor.cc $(srcdir)/lexor.lex
119 +--
120 +2.26.2
121 +
122
123 diff --git a/sci-electronics/iverilog/iverilog-10.3-r2.ebuild b/sci-electronics/iverilog/iverilog-10.3-r2.ebuild
124 new file mode 100644
125 index 00000000000..dcce51a4502
126 --- /dev/null
127 +++ b/sci-electronics/iverilog/iverilog-10.3-r2.ebuild
128 @@ -0,0 +1,76 @@
129 +# Copyright 1999-2020 Gentoo Authors
130 +# Distributed under the terms of the GNU General Public License v2
131 +
132 +EAPI=7
133 +
134 +inherit autotools
135 +
136 +GITHUB_PV=$(ver_rs 1- '_')
137 +
138 +DESCRIPTION="A Verilog simulation and synthesis tool"
139 +HOMEPAGE="
140 + http://iverilog.icarus.com
141 + https://github.com/steveicarus/iverilog
142 +"
143 +
144 +if [[ ${PV} == "9999" ]] ; then
145 + inherit git-r3
146 + EGIT_REPO_URI="https://github.com/steveicarus/${PN}.git"
147 +else
148 + SRC_URI="https://github.com/steveicarus/${PN}/archive/v${GITHUB_PV}.tar.gz -> ${P}.tar.gz"
149 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
150 + S="${WORKDIR}/${PN}-${GITHUB_PV}"
151 +fi
152 +
153 +LICENSE="LGPL-2.1"
154 +SLOT="0"
155 +IUSE="examples"
156 +
157 +# If you are building from git, you will also need gperf to generate
158 +# the configure scripts.
159 +RDEPEND="
160 + sys-libs/readline:=
161 + sys-libs/zlib
162 +"
163 +
164 +DEPEND="
165 + dev-util/gperf
166 + sys-devel/bison
167 + sys-devel/flex
168 + ${RDEPEND}
169 +"
170 +
171 +PATCHES=(
172 + "${FILESDIR}"/${PN}-10.3-file-missing.patch #705412
173 + "${FILESDIR}"/${PN}-10.3-fno-common.patch #706366
174 + "${FILESDIR}"/${PN}-10.3-gen-bison-header.patch #734760
175 +)
176 +
177 +src_prepare() {
178 + default
179 +
180 + # From upstreams autoconf.sh, to make it utilize the autotools eclass
181 + # Here translate the autoconf.sh, equivalent to the following code
182 + # > sh autoconf.sh
183 +
184 + # Autoconf in root ...
185 + eautoconf --force
186 + # Precompiling lexor_keyword.gperf
187 + gperf -o -i 7 -C -k 1-4,6,9,\$ -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc || die
188 + # Precompiling vhdlpp/lexor_keyword.gperf
189 + cd vhdlpp || die
190 + gperf -o -i 7 --ignore-case -C -k 1-4,6,9,\$ -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc || die
191 +}
192 +
193 +src_install() {
194 + local DOCS=( *.txt )
195 + # Default build fails with parallel jobs,
196 + # https://github.com/steveicarus/iverilog/pull/294
197 + emake installdirs DESTDIR="${D}"
198 + default
199 +
200 + if use examples; then
201 + dodoc -r examples
202 + docompress -x /usr/share/doc/${PF}/examples
203 + fi
204 +}