Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/sloccount/files/, app-text/sloccount/
Date: Tue, 21 Jan 2020 21:51:33
Message-Id: 1579643459.b7b3801835881669f212218234508522f56bab16.soap@gentoo
1 commit: b7b3801835881669f212218234508522f56bab16
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 21 21:50:59 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 21 21:50:59 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7b38018
7
8 app-text/sloccount: Port to EAPI 7
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: David Seifert <soap <AT> gentoo.org>
12
13 .../sloccount/files/sloccount-2.26-gentoo.patch | 66 +++++++++++++++++++++-
14 app-text/sloccount/sloccount-2.26-r3.ebuild | 54 +++++++++---------
15 2 files changed, 92 insertions(+), 28 deletions(-)
16
17 diff --git a/app-text/sloccount/files/sloccount-2.26-gentoo.patch b/app-text/sloccount/files/sloccount-2.26-gentoo.patch
18 index c3a031190a3..5e4010b81f3 100644
19 --- a/app-text/sloccount/files/sloccount-2.26-gentoo.patch
20 +++ b/app-text/sloccount/files/sloccount-2.26-gentoo.patch
21 @@ -1,5 +1,5 @@
22 ---- break_filelist.old 2013-10-14 17:23:01.523330534 +0800
23 -+++ break_filelist 2004-08-01 12:17:28.000000000 +0800
24 +--- a/break_filelist
25 ++++ b/break_filelist
26 @@ -177,7 +177,7 @@
27 "p" => "pascal", "pas" => "pascal", "pp" => "pascal", "dpr" => "pascal",
28 "py" => "python",
29 @@ -18,3 +18,65 @@
30 ($firstline =~
31 m~^#!\s*\@_?(SCRIPT_)?(PATH_)?(BA|K)?SH(ELL)?(\d+)?\@?(\s|\Z)~)) {
32 # Note: wish(1) uses a funny trick; see wish(1) for more info.
33 +--- a/makefile
34 ++++ b/makefile
35 +@@ -37,7 +37,7 @@
36 + # Set this to your C compiler, if it's not "gcc"; a likely alternative is "cc".
37 + # The "-Wall" option turns on warnings in gcc. gcc users might also want
38 + # to consider using "-Werror", which turns warnings into errors.
39 +-CC=gcc -Wall
40 ++CFLAGS+= -Wall
41 +
42 + # Set this to the name of your "install" program. On some systems,
43 + # "install -C" would be useful (so unchanged files won't be modified),
44 +@@ -124,34 +124,34 @@
45 +
46 + MANPAGES=sloccount.1.gz
47 +
48 +-MYDOCS=sloccount.html README TODO ChangeLog
49 ++MYDOCS=README TODO ChangeLog
50 +
51 +
52 + all: $(COMPILED_EXECUTABLES)
53 +
54 + lexcount1$(EXE_SUFFIX): lexcount1.c
55 +- $(CC) lexcount1.c -o lexcount1$(EXE_SUFFIX)
56 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) lexcount1.c -o lexcount1$(EXE_SUFFIX)
57 +
58 + c_count$(EXE_SUFFIX): c_count.c
59 +- $(CC) c_count.c -o c_count$(EXE_SUFFIX)
60 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) c_count.c -o c_count$(EXE_SUFFIX)
61 +
62 + php_count$(EXE_SUFFIX): php_count.c
63 +- $(CC) php_count.c -o php_count$(EXE_SUFFIX)
64 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) php_count.c -o php_count$(EXE_SUFFIX)
65 +
66 + pascal_count.c: pascal_count.l driver.c driver.h
67 + flex -Cfe -t pascal_count.l > pascal_count.c
68 +
69 + pascal_count$(EXE_SUFFIX): pascal_count.c
70 +- $(CC) pascal_count.c -o pascal_count$(EXE_SUFFIX)
71 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) pascal_count.c -o pascal_count$(EXE_SUFFIX)
72 +
73 + jsp_count.c: jsp_count.l driver.c driver.h
74 + flex -Cfe -t jsp_count.l > jsp_count.c
75 +
76 + jsp_count$(EXE_SUFFIX): jsp_count.c
77 +- $(CC) jsp_count.c -o jsp_count$(EXE_SUFFIX)
78 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) jsp_count.c -o jsp_count$(EXE_SUFFIX)
79 +
80 + ml_count$(EXE_SUFFIX): ml_count.c
81 +- $(CC) ml_count.c -o ml_count$(EXE_SUFFIX)
82 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) ml_count.c -o ml_count$(EXE_SUFFIX)
83 +
84 + sloccount.1.gz: sloccount.1
85 + gzip -c sloccount.1 > sloccount.1.gz
86 +@@ -162,7 +162,7 @@
87 +
88 + # This is USC's code counter, not built by default:
89 + c_lines: C_LINES.C
90 +- $(CC) C_LINES.C -o c_lines$(EXE_SUFFIX)
91 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) C_LINES.C -o c_lines$(EXE_SUFFIX)
92 +
93 + install_prefix:
94 + $(INSTALL_A_DIR) $(PREFIX)
95
96 diff --git a/app-text/sloccount/sloccount-2.26-r3.ebuild b/app-text/sloccount/sloccount-2.26-r3.ebuild
97 index 0c1bc3de2f7..6b6eb673050 100644
98 --- a/app-text/sloccount/sloccount-2.26-r3.ebuild
99 +++ b/app-text/sloccount/sloccount-2.26-r3.ebuild
100 @@ -1,9 +1,9 @@
101 -# Copyright 1999-2014 Gentoo Foundation
102 +# Copyright 1999-2020 Gentoo Authors
103 # Distributed under the terms of the GNU General Public License v2
104
105 -EAPI="4"
106 +EAPI=7
107
108 -inherit eutils toolchain-funcs
109 +inherit toolchain-funcs
110
111 DESCRIPTION="Tools for counting Source Lines of Code (SLOC) for a large number of languages"
112 HOMEPAGE="http://www.dwheeler.com/sloccount/"
113 @@ -12,39 +12,41 @@ SRC_URI="http://www.dwheeler.com/sloccount/${P}.tar.gz"
114 LICENSE="GPL-2"
115 SLOT="0"
116 KEYWORDS="~alpha amd64 ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
117 -IUSE=""
118 -RDEPEND="dev-lang/perl
119 - >=sys-apps/sed-4
120 - app-shells/bash"
121 +
122 +RDEPEND="dev-lang/perl"
123 DEPEND="${RDEPEND}"
124
125 +PATCHES=(
126 + "${FILESDIR}"/${P}-libexec.patch
127 + "${FILESDIR}"/${P}-coreutils-tail-n-fix.patch
128 + # support for
129 + # 1) .ebuild
130 + # 2) #!/sbin/openrc-run
131 + # 3) CFLAGS/CPPFLAGS/LDFLAGS
132 + "${FILESDIR}"/${P}-gentoo.patch
133 +)
134 +
135 src_prepare() {
136 - epatch "${FILESDIR}"/${P}-libexec.patch
137 - epatch "${FILESDIR}"/${P}-coreutils-tail-n-fix.patch
138 - # support for .ebuild and #!/sbin/openrc-run:
139 - epatch "${FILESDIR}"/${P}-gentoo.patch
140 -
141 - sed -i \
142 - -e 's|^CC=gcc|CFLAGS+=|g' \
143 - -e 's|$(CC)|& $(CFLAGS) $(LDFLAGS)|g' \
144 - -e '/^DOC_DIR/ { s/-$(RPM_VERSION)//g }' \
145 - -e '/^MYDOCS/ { s/[^ =]\+\.html//g }' \
146 - makefile || die "sed makefile failed"
147 -
148 - #fixed hard-codes libexec_dir in sloccount
149 + default
150 +
151 + # fix hard-coded libexec_dir in sloccount
152 sed -i "s|libexec_dir=|&\"${EPREFIX}\"|" sloccount || die
153 }
154
155 -src_compile() {
156 - emake CC=$(tc-getCC)
157 +src_configure() {
158 + tc-export CC
159 }
160
161 src_test() {
162 - PATH+=":${S}"
163 - emake test
164 + PATH="${PATH}:${S}" emake test
165 }
166
167 src_install() {
168 - emake PREFIX="${ED}/usr" DOC_DIR="${ED}/usr/share/doc/${PF}/" install
169 - dohtml *html
170 + emake PREFIX="${ED}"/usr DOC_DIR="${ED}"/usr/share/doc/${PF}/ install
171 +
172 + HTML_DOCS=( *.html )
173 + einstalldocs
174 +
175 + # avoid QA warning
176 + gunzip "${ED}"/usr/share/man/man1/sloccount.1.gz || die
177 }