From b7b3801835881669f212218234508522f56bab16 Mon Sep 17 00:00:00 2001 From: David Seifert Date: Tue, 21 Jan 2020 22:50:59 +0100 Subject: app-text/sloccount: Port to EAPI 7 Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: David Seifert --- .../sloccount/files/sloccount-2.26-gentoo.patch | 66 +++++++++++++++++++++- app-text/sloccount/sloccount-2.26-r3.ebuild | 54 +++++++++--------- 2 files changed, 92 insertions(+), 28 deletions(-) (limited to 'app-text') diff --git a/app-text/sloccount/files/sloccount-2.26-gentoo.patch b/app-text/sloccount/files/sloccount-2.26-gentoo.patch index c3a031190a36..5e4010b81f32 100644 --- a/app-text/sloccount/files/sloccount-2.26-gentoo.patch +++ b/app-text/sloccount/files/sloccount-2.26-gentoo.patch @@ -1,5 +1,5 @@ ---- break_filelist.old 2013-10-14 17:23:01.523330534 +0800 -+++ break_filelist 2004-08-01 12:17:28.000000000 +0800 +--- a/break_filelist ++++ b/break_filelist @@ -177,7 +177,7 @@ "p" => "pascal", "pas" => "pascal", "pp" => "pascal", "dpr" => "pascal", "py" => "python", @@ -18,3 +18,65 @@ ($firstline =~ m~^#!\s*\@_?(SCRIPT_)?(PATH_)?(BA|K)?SH(ELL)?(\d+)?\@?(\s|\Z)~)) { # Note: wish(1) uses a funny trick; see wish(1) for more info. +--- a/makefile ++++ b/makefile +@@ -37,7 +37,7 @@ + # Set this to your C compiler, if it's not "gcc"; a likely alternative is "cc". + # The "-Wall" option turns on warnings in gcc. gcc users might also want + # to consider using "-Werror", which turns warnings into errors. +-CC=gcc -Wall ++CFLAGS+= -Wall + + # Set this to the name of your "install" program. On some systems, + # "install -C" would be useful (so unchanged files won't be modified), +@@ -124,34 +124,34 @@ + + MANPAGES=sloccount.1.gz + +-MYDOCS=sloccount.html README TODO ChangeLog ++MYDOCS=README TODO ChangeLog + + + all: $(COMPILED_EXECUTABLES) + + lexcount1$(EXE_SUFFIX): lexcount1.c +- $(CC) lexcount1.c -o lexcount1$(EXE_SUFFIX) ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) lexcount1.c -o lexcount1$(EXE_SUFFIX) + + c_count$(EXE_SUFFIX): c_count.c +- $(CC) c_count.c -o c_count$(EXE_SUFFIX) ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) c_count.c -o c_count$(EXE_SUFFIX) + + php_count$(EXE_SUFFIX): php_count.c +- $(CC) php_count.c -o php_count$(EXE_SUFFIX) ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) php_count.c -o php_count$(EXE_SUFFIX) + + pascal_count.c: pascal_count.l driver.c driver.h + flex -Cfe -t pascal_count.l > pascal_count.c + + pascal_count$(EXE_SUFFIX): pascal_count.c +- $(CC) pascal_count.c -o pascal_count$(EXE_SUFFIX) ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) pascal_count.c -o pascal_count$(EXE_SUFFIX) + + jsp_count.c: jsp_count.l driver.c driver.h + flex -Cfe -t jsp_count.l > jsp_count.c + + jsp_count$(EXE_SUFFIX): jsp_count.c +- $(CC) jsp_count.c -o jsp_count$(EXE_SUFFIX) ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) jsp_count.c -o jsp_count$(EXE_SUFFIX) + + ml_count$(EXE_SUFFIX): ml_count.c +- $(CC) ml_count.c -o ml_count$(EXE_SUFFIX) ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) ml_count.c -o ml_count$(EXE_SUFFIX) + + sloccount.1.gz: sloccount.1 + gzip -c sloccount.1 > sloccount.1.gz +@@ -162,7 +162,7 @@ + + # This is USC's code counter, not built by default: + c_lines: C_LINES.C +- $(CC) C_LINES.C -o c_lines$(EXE_SUFFIX) ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) C_LINES.C -o c_lines$(EXE_SUFFIX) + + install_prefix: + $(INSTALL_A_DIR) $(PREFIX) diff --git a/app-text/sloccount/sloccount-2.26-r3.ebuild b/app-text/sloccount/sloccount-2.26-r3.ebuild index 0c1bc3de2f75..6b6eb6730501 100644 --- a/app-text/sloccount/sloccount-2.26-r3.ebuild +++ b/app-text/sloccount/sloccount-2.26-r3.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI="4" +EAPI=7 -inherit eutils toolchain-funcs +inherit toolchain-funcs DESCRIPTION="Tools for counting Source Lines of Code (SLOC) for a large number of languages" HOMEPAGE="http://www.dwheeler.com/sloccount/" @@ -12,39 +12,41 @@ SRC_URI="http://www.dwheeler.com/sloccount/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha amd64 ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" -IUSE="" -RDEPEND="dev-lang/perl - >=sys-apps/sed-4 - app-shells/bash" + +RDEPEND="dev-lang/perl" DEPEND="${RDEPEND}" +PATCHES=( + "${FILESDIR}"/${P}-libexec.patch + "${FILESDIR}"/${P}-coreutils-tail-n-fix.patch + # support for + # 1) .ebuild + # 2) #!/sbin/openrc-run + # 3) CFLAGS/CPPFLAGS/LDFLAGS + "${FILESDIR}"/${P}-gentoo.patch +) + src_prepare() { - epatch "${FILESDIR}"/${P}-libexec.patch - epatch "${FILESDIR}"/${P}-coreutils-tail-n-fix.patch - # support for .ebuild and #!/sbin/openrc-run: - epatch "${FILESDIR}"/${P}-gentoo.patch - - sed -i \ - -e 's|^CC=gcc|CFLAGS+=|g' \ - -e 's|$(CC)|& $(CFLAGS) $(LDFLAGS)|g' \ - -e '/^DOC_DIR/ { s/-$(RPM_VERSION)//g }' \ - -e '/^MYDOCS/ { s/[^ =]\+\.html//g }' \ - makefile || die "sed makefile failed" - - #fixed hard-codes libexec_dir in sloccount + default + + # fix hard-coded libexec_dir in sloccount sed -i "s|libexec_dir=|&\"${EPREFIX}\"|" sloccount || die } -src_compile() { - emake CC=$(tc-getCC) +src_configure() { + tc-export CC } src_test() { - PATH+=":${S}" - emake test + PATH="${PATH}:${S}" emake test } src_install() { - emake PREFIX="${ED}/usr" DOC_DIR="${ED}/usr/share/doc/${PF}/" install - dohtml *html + emake PREFIX="${ED}"/usr DOC_DIR="${ED}"/usr/share/doc/${PF}/ install + + HTML_DOCS=( *.html ) + einstalldocs + + # avoid QA warning + gunzip "${ED}"/usr/share/man/man1/sloccount.1.gz || die } -- cgit v1.2.3-65-gdbad