summaryrefslogtreecommitdiff
path: root/app-text/sloccount
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /app-text/sloccount
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'app-text/sloccount')
-rw-r--r--app-text/sloccount/Manifest1
-rw-r--r--app-text/sloccount/files/sloccount-2.26-coreutils-tail-n-fix.patch12
-rw-r--r--app-text/sloccount/files/sloccount-2.26-gentoo.patch82
-rw-r--r--app-text/sloccount/files/sloccount-2.26-libexec.patch81
-rw-r--r--app-text/sloccount/metadata.xml8
-rw-r--r--app-text/sloccount/sloccount-2.26-r3.ebuild52
6 files changed, 236 insertions, 0 deletions
diff --git a/app-text/sloccount/Manifest b/app-text/sloccount/Manifest
new file mode 100644
index 000000000000..a03e3daade48
--- /dev/null
+++ b/app-text/sloccount/Manifest
@@ -0,0 +1 @@
+DIST sloccount-2.26.tar.gz 190948 BLAKE2B 060cba3796ba4edc5f64ca3cc16de6f7dd8d1d18e45f9ccc0abe7a27e37daa6c02dd7a3f31b124b5e9ccc81ab59a7c4c6405b86ebb17ca9853c1ac1dafcba095 SHA512 ed6ab315a56dbdc86c654b94e790c9ea9e2dcad0db26b63c0973c33eb7fa634b4ade0a1f3c6ccfd5172ea95f648c1dd3b0ae2575b0aa44b3fec708c24a6aca54
diff --git a/app-text/sloccount/files/sloccount-2.26-coreutils-tail-n-fix.patch b/app-text/sloccount/files/sloccount-2.26-coreutils-tail-n-fix.patch
new file mode 100644
index 000000000000..caf30cf894de
--- /dev/null
+++ b/app-text/sloccount/files/sloccount-2.26-coreutils-tail-n-fix.patch
@@ -0,0 +1,12 @@
+diff -Nur sloccount-2.22/compute_sloc_lang sloccount-2.22-new/compute_sloc_lang
+--- sloccount-2.22/compute_sloc_lang 2002-02-28 13:34:09.000000000 +0100
++++ sloccount-2.22-new/compute_sloc_lang 2004-10-23 12:36:56.295312577 +0200
+@@ -30,7 +30,7 @@
+ *) ${language}_count -f ${language}_list.dat > ${language}_outfile.dat
+ ;;
+ esac
+- tail -1 < ${language}_outfile.dat
++ tail -n 1 < ${language}_outfile.dat
+
+ else
+ rm -f ${language}_outfile.dat
diff --git a/app-text/sloccount/files/sloccount-2.26-gentoo.patch b/app-text/sloccount/files/sloccount-2.26-gentoo.patch
new file mode 100644
index 000000000000..5e4010b81f32
--- /dev/null
+++ b/app-text/sloccount/files/sloccount-2.26-gentoo.patch
@@ -0,0 +1,82 @@
+--- a/break_filelist
++++ b/break_filelist
+@@ -177,7 +177,7 @@
+ "p" => "pascal", "pas" => "pascal", "pp" => "pascal", "dpr" => "pascal",
+ "py" => "python",
+ "s" => "asm", "S" => "asm", "asm" => "asm",
++ "sh" => "sh", "bash" => "sh", "ebuild" => "sh",
+- "sh" => "sh", "bash" => "sh",
+ "csh" => "csh", "tcsh" => "csh",
+ "java" => "java",
+ "lisp" => "lisp", "el" => "lisp", "scm" => "lisp", "sc" => "lisp",
+@@ -879,7 +879,7 @@
+ $command = $2;
+ }
+
++ if ( ($command =~ m/^(bash|ksh|zsh|pdksh|sh|runscript)[0-9\.]*(\.exe)?$/i) ||
+- if ( ($command =~ m/^(bash|ksh|zsh|pdksh|sh)[0-9\.]*(\.exe)?$/i) ||
+ ($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/files/sloccount-2.26-libexec.patch b/app-text/sloccount/files/sloccount-2.26-libexec.patch
new file mode 100644
index 000000000000..cb8250f68cf6
--- /dev/null
+++ b/app-text/sloccount/files/sloccount-2.26-libexec.patch
@@ -0,0 +1,81 @@
+Files sloccount-2.26.orig/.makefile.swp and sloccount-2.26/.makefile.swp differ
+Files sloccount-2.26.orig/.sloccount.swp and sloccount-2.26/.sloccount.swp differ
+diff -ruN sloccount-2.26.orig/makefile sloccount-2.26/makefile
+--- sloccount-2.26.orig/makefile 2005-02-20 21:26:00.000000000 +0100
++++ sloccount-2.26/makefile 2005-02-20 21:32:58.000000000 +0100
+@@ -70,6 +70,7 @@
+ ARCH=i386
+ VERSIONEDNAME=$(NAME)-$(VERSION)
+ INSTALL_DIR=$(PREFIX)/bin
++LIBEXEC_DIR=$(PREFIX)/libexec/$(NAME)
+ MAN_DIR=$(PREFIX)/share/man
+ MAN_DIR_MAN1=$(MAN_DIR)/man1
+ DOC_DIR=$(PREFIX)/share/doc/$(VERSIONEDNAME)-$(RPM_VERSION)
+@@ -115,11 +116,12 @@
+ sed_count \
+ sh_count \
+ show_filecount \
+- sloccount \
+ sql_count \
+ tcl_count \
+ $(COMPILED_EXECUTABLES)
+
++MAIN_EXECUTABLE=sloccount
++
+ MANPAGES=sloccount.1.gz
+
+ MYDOCS=sloccount.html README TODO ChangeLog
+@@ -162,12 +164,24 @@
+ c_lines: C_LINES.C
+ $(CC) C_LINES.C -o c_lines$(EXE_SUFFIX)
+
++install_prefix:
++ $(INSTALL_A_DIR) $(PREFIX)
+
+-install_programs: all
+- $(INSTALL) $(EXECUTABLES) $(INSTALL_DIR)
++install_program:
++ $(INSTALL_A_DIR) $(INSTALL_DIR)
++ $(INSTALL) $(MAIN_EXECUTABLE) $(INSTALL_DIR)
++
++uninstall_program:
++ cd $(INSTALL_DIR) && rm -f $(MAIN_EXECUTABLE)
++
++install_libexec: all
++ $(INSTALL_A_DIR) $(LIBEXEC_DIR)
++ $(INSTALL) $(EXECUTABLES) $(LIBEXEC_DIR)
++
++uninstall_libexec:
++ cd $(LIBEXEC_DIR) && rm -f $(EXECUTABLES)
++ rmdir $(LIBEXEC_DIR)
+
+-uninstall_programs:
+- cd $(INSTALL_DIR) && rm -f $(EXECUTABLES)
+
+ install_man: $(MANPAGES)
+ $(INSTALL_A_DIR) $(MAN_DIR_MAN1)
+@@ -184,9 +198,9 @@
+ rm -fr $(DOC_DIR)
+
+
+-install: install_programs install_man install_docs
++install: install_prefix install_program install_libexec install_man install_docs
+
+-uninstall: uninstall_programs uninstall_docs uninstall_man
++uninstall: uninstall_program uninstall_libexec uninstall_docs uninstall_man
+
+
+ clean:
+diff -ruN sloccount-2.26.orig/sloccount sloccount-2.26/sloccount
+--- sloccount-2.26.orig/sloccount 2005-02-20 21:26:00.000000000 +0100
++++ sloccount-2.26/sloccount 2005-02-20 21:33:25.000000000 +0100
+@@ -39,6 +39,9 @@
+
+ startingdir=`pwd`
+
++libexec_dir=/usr/libexec/sloccount
++export PATH=$PATH:$libexec_dir
++
+
+ # "datadir" is some suitable safe place for the data; here's the default:
+ datadir=${HOME}/.slocdata
diff --git a/app-text/sloccount/metadata.xml b/app-text/sloccount/metadata.xml
new file mode 100644
index 000000000000..5d08ae950a93
--- /dev/null
+++ b/app-text/sloccount/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/app-text/sloccount/sloccount-2.26-r3.ebuild b/app-text/sloccount/sloccount-2.26-r3.ebuild
new file mode 100644
index 000000000000..2a576c296451
--- /dev/null
+++ b/app-text/sloccount/sloccount-2.26-r3.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Tools for counting Source Lines of Code (SLOC) for a large number of languages"
+HOMEPAGE="http://www.dwheeler.com/sloccount/"
+SRC_URI="http://www.dwheeler.com/sloccount/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ppc ~ppc64 ~riscv ~sparc x86"
+
+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() {
+ default
+
+ # fix hard-coded libexec_dir in sloccount
+ sed -i "s|libexec_dir=|&\"${EPREFIX}\"|" sloccount || die
+}
+
+src_configure() {
+ tc-export CC
+}
+
+src_test() {
+ PATH="${PATH}:${S}" emake test
+}
+
+src_install() {
+ 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
+}