summaryrefslogtreecommitdiff
path: root/www-apps/cgit
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
commitbfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch)
tree0d7a74b4463ee387f9cf9368ceb1b757f694f72a /www-apps/cgit
parentf716a9fe6455d39eef01e718aae68dae61c19704 (diff)
downloadbaldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'www-apps/cgit')
-rw-r--r--www-apps/cgit/Manifest4
-rw-r--r--www-apps/cgit/cgit-1.3.1.ebuild126
-rw-r--r--www-apps/cgit/cgit-1.3.ebuild128
-rw-r--r--www-apps/cgit/files/cgit-highlight.patch16
-rw-r--r--www-apps/cgit/files/cgitrc130
-rw-r--r--www-apps/cgit/files/postinstall-en.txt45
-rw-r--r--www-apps/cgit/metadata.xml30
7 files changed, 479 insertions, 0 deletions
diff --git a/www-apps/cgit/Manifest b/www-apps/cgit/Manifest
new file mode 100644
index 000000000000..f83de5654053
--- /dev/null
+++ b/www-apps/cgit/Manifest
@@ -0,0 +1,4 @@
+DIST cgit-1.3.1.tar.xz 92432 BLAKE2B cfc16776b53cbcb79dfc73a0079444a6c4094b2c38090885f927283a9ff01cce7e897a348ab6b489386eded05d7956800897db05f14ef639d8e8c4d6ab9534c2 SHA512 aa5104f6597e67373af960ab9bbdf7f60b0bf9b19f7ca97ba71fa106709ae9e85b614f2a93302b09c50abdffd47e265bff18d3671fe704c9985efd38284a6b15
+DIST cgit-1.3.tar.xz 92248 BLAKE2B 5c5d68f6e20edb86c8a79a50c9b9baf255d8528f4a956a7f4be0f445985376ffd525f455b90a52d44f5d9e375a0146ce83807caf8d99ec26a395f3e3c09aa50f SHA512 28b7e1867809cafed6190e1984b059a7aaac3a92d8eb38bc925a58fd344347b86662309be44b6ce6625312cb127540aadd7a22b7561e96c8440144ea5eade02e
+DIST git-2.53.0.tar.xz 7993096 BLAKE2B a23ccb2f793d37347e892f6094ad589510c93011a53fb2c14cdcbfbe6d87413edb4585a98253e4ca5124217f66ad783f4fa584f38dc25ffa34772da01dc45f02 SHA512 f9c0c0f527e10fe3eb524e368b1a24088bfd41097d8cac7854dae7ff21ab8ab2a1716384be53ea6174023ca5a2af3eeddca1d9feb57e447713f82e061df55c8d
+DIST git-2.54.0.tar.xz 8126372 BLAKE2B 68ee0623ff5a695a35dae2f31e3f410ebd4b6a8296c7c9fd03f53668878e9164b78ca82869c8a0719b3fae981f514f2022c45b39df7174b5e883348bdd269a82 SHA512 cb363917124edc245c9f6745e6e0c4093990275b4d57f9d2213c655b304ac81b05ece8d88546122727495ebc48a5ae19ab166a3ee43b6b8c68da488ac0270064
diff --git a/www-apps/cgit/cgit-1.3.1.ebuild b/www-apps/cgit/cgit-1.3.1.ebuild
new file mode 100644
index 000000000000..6decbfad8906
--- /dev/null
+++ b/www-apps/cgit/cgit-1.3.1.ebuild
@@ -0,0 +1,126 @@
+# Copyright 2021-2026 Liguros Authors
+# Distributed under the terms of the GNU General Public License v2
+EAPI=8
+
+LUA_COMPAT=( lua5-{1,3,4} luajit )
+PYTHON_COMPAT=( python3_{13..14} )
+WEBAPP_MANUAL_SLOT="yes"
+
+inherit flag-o-matic lua-single python-single-r1 tmpfiles toolchain-funcs webapp
+
+[[ -z "${CGIT_CACHEDIR}" ]] && CGIT_CACHEDIR="/var/cache/${PN}/"
+
+GIT_V="2.54.0"
+
+DESCRIPTION="A fast web-interface for Git repositories"
+HOMEPAGE="https://git.zx2c4.com/cgit/about/"
+SRC_URI="https://www.kernel.org/pub/software/scm/git/git-${GIT_V}.tar.xz
+ https://git.zx2c4.com/cgit/snapshot/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~riscv ~x86"
+
+IUSE="doc +highlight +lua test"
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} ) ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ acct-group/cgit
+ acct-user/cgit
+ dev-libs/openssl:0=
+
+ dev-vcs/git
+ highlight? (
+ $(python_gen_cond_dep '
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/markdown[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+ ')
+ sys-apps/groff
+ )
+ lua? ( ${LUA_DEPS} )
+ virtual/zlib:=
+ virtual/httpd-cgi
+"
+# ebuilds without WEBAPP_MANUAL_SLOT="yes" are broken
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? (
+ app-text/docbook-xsl-stylesheets
+ >=app-text/asciidoc-8.5.1
+ )
+"
+
+PATCHES=( "${FILESDIR}"/${PN}-highlight.patch )
+
+pkg_setup() {
+ python_setup
+ webapp_pkg_setup
+ use lua && lua-single_pkg_setup
+}
+
+src_configure() {
+ if ! [[ ${PV} =~ 9999* ]]; then
+ rmdir git || die
+ mv "${WORKDIR}"/git-"${GIT_V}" git || die
+ fi
+
+ # bug #951555
+ append-cflags -std=gnu17
+
+ echo "prefix = ${EPREFIX}/usr" >> cgit.conf || die "echo prefix failed"
+ echo "libdir = ${EPREFIX}/usr/$(get_libdir)" >> cgit.conf || die "echo libdir failed"
+ echo "CGIT_SCRIPT_PATH = ${MY_CGIBINDIR}" >> cgit.conf || die "echo CGIT_SCRIPT_PATH failed"
+ echo "CGIT_DATA_PATH = ${MY_HTDOCSDIR}" >> cgit.conf || die "echo CGIT_DATA_PATH failed"
+ echo "CACHE_ROOT = ${CGIT_CACHEDIR}" >> cgit.conf || die "echo CACHE_ROOT failed"
+ if use lua; then
+ echo "LUA_PKGCONFIG = ${ELUA}" >> cgit.conf || die "echo LUA_PKGCONFIG failed"
+ else
+ echo "NO_LUA = 1" >> cgit.conf || die "echo NO_LUA failed"
+ fi
+}
+
+src_compile() {
+ emake V=1 AR="$(tc-getAR)" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+ use doc && emake V=1 doc-man
+}
+
+src_install() {
+ webapp_src_preinst
+
+ emake V=1 AR="$(tc-getAR)" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" DESTDIR="${D}" install
+
+ insinto /etc
+ doins "${FILESDIR}"/cgitrc
+
+ dodoc README
+ use doc && doman cgitrc.5
+
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
+ webapp_src_install
+
+ cat > cgit.conf <<-EOT || die
+ d ${CGIT_CACHEDIR} 0700 cgit cgit -
+ EOT
+ dotmpfiles cgit.conf
+
+ python_fix_shebang .
+}
+
+src_test() {
+ emake V=1 AR="$(tc-getAR)" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" test
+}
+
+pkg_postinst() {
+ webapp_pkg_postinst
+ tmpfiles_process cgit.conf
+ ewarn "The cgit cache is enabled using the cache-size setting in cgitrc."
+ ewarn "If enabling the cache and running cgit using the web server's user"
+ ewarn "you should copy ${EROOT}/usr/lib/tmpfiles.d/cgit.conf"
+ ewarn "to ${EROOT}/etc/tmpfiles.d/ and edit, changing the ownership fields."
+ ewarn "If you use the cache-root setting in cgitrc to specify a cache directory"
+ ewarn "other than ${CGIT_CACHEDIR} edit the path in cgit.conf."
+}
diff --git a/www-apps/cgit/cgit-1.3.ebuild b/www-apps/cgit/cgit-1.3.ebuild
new file mode 100644
index 000000000000..f7af5a1f9869
--- /dev/null
+++ b/www-apps/cgit/cgit-1.3.ebuild
@@ -0,0 +1,128 @@
+# Copyright 2021-2026 Liguros Authors
+# Distributed under the terms of the GNU General Public License v2
+EAPI=8
+
+LUA_COMPAT=( lua5-{1,3,4} luajit )
+
+PYTHON_COMPAT=( python3_{13..14} )
+
+WEBAPP_MANUAL_SLOT="yes"
+
+inherit flag-o-matic lua-single python-single-r1 tmpfiles toolchain-funcs webapp
+
+[[ -z "${CGIT_CACHEDIR}" ]] && CGIT_CACHEDIR="/var/cache/${PN}/"
+
+GIT_V="2.53.0"
+
+DESCRIPTION="A fast web-interface for Git repositories"
+HOMEPAGE="https://git.zx2c4.com/cgit/about/"
+SRC_URI="https://www.kernel.org/pub/software/scm/git/git-${GIT_V}.tar.xz
+ https://git.zx2c4.com/cgit/snapshot/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~riscv ~x86"
+
+IUSE="doc +highlight +lua test"
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} ) ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ acct-group/cgit
+ acct-user/cgit
+ dev-libs/openssl:0=
+
+ dev-vcs/git
+ highlight? (
+ $(python_gen_cond_dep '
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/markdown[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+ ')
+ sys-apps/groff
+ )
+ lua? ( ${LUA_DEPS} )
+ virtual/zlib:=
+ virtual/httpd-cgi
+"
+# ebuilds without WEBAPP_MANUAL_SLOT="yes" are broken
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? (
+ app-text/docbook-xsl-stylesheets
+ >=app-text/asciidoc-8.5.1
+ )
+"
+
+PATCHES=( "${FILESDIR}"/${PN}-highlight.patch )
+
+pkg_setup() {
+ python_setup
+ webapp_pkg_setup
+ use lua && lua-single_pkg_setup
+}
+
+src_configure() {
+ if ! [[ ${PV} =~ 9999* ]]; then
+ rmdir git || die
+ mv "${WORKDIR}"/git-"${GIT_V}" git || die
+ fi
+
+ # bug #951555
+ append-cflags -std=gnu17
+
+ echo "prefix = ${EPREFIX}/usr" >> cgit.conf || die "echo prefix failed"
+ echo "libdir = ${EPREFIX}/usr/$(get_libdir)" >> cgit.conf || die "echo libdir failed"
+ echo "CGIT_SCRIPT_PATH = ${MY_CGIBINDIR}" >> cgit.conf || die "echo CGIT_SCRIPT_PATH failed"
+ echo "CGIT_DATA_PATH = ${MY_HTDOCSDIR}" >> cgit.conf || die "echo CGIT_DATA_PATH failed"
+ echo "CACHE_ROOT = ${CGIT_CACHEDIR}" >> cgit.conf || die "echo CACHE_ROOT failed"
+ if use lua; then
+ echo "LUA_PKGCONFIG = ${ELUA}" >> cgit.conf || die "echo LUA_PKGCONFIG failed"
+ else
+ echo "NO_LUA = 1" >> cgit.conf || die "echo NO_LUA failed"
+ fi
+}
+
+src_compile() {
+ emake V=1 AR="$(tc-getAR)" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+ use doc && emake V=1 doc-man
+}
+
+src_install() {
+ webapp_src_preinst
+
+ emake V=1 AR="$(tc-getAR)" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" DESTDIR="${D}" install
+
+ insinto /etc
+ doins "${FILESDIR}"/cgitrc
+
+ dodoc README
+ use doc && doman cgitrc.5
+
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
+ webapp_src_install
+
+ cat > cgit.conf <<-EOT || die
+ d ${CGIT_CACHEDIR} 0700 cgit cgit -
+ EOT
+ dotmpfiles cgit.conf
+
+ python_fix_shebang .
+}
+
+src_test() {
+ emake V=1 AR="$(tc-getAR)" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" test
+}
+
+pkg_postinst() {
+ webapp_pkg_postinst
+ tmpfiles_process cgit.conf
+ ewarn "The cgit cache is enabled using the cache-size setting in cgitrc."
+ ewarn "If enabling the cache and running cgit using the web server's user"
+ ewarn "you should copy ${EROOT}/usr/lib/tmpfiles.d/cgit.conf"
+ ewarn "to ${EROOT}/etc/tmpfiles.d/ and edit, changing the ownership fields."
+ ewarn "If you use the cache-root setting in cgitrc to specify a cache directory"
+ ewarn "other than ${CGIT_CACHEDIR} edit the path in cgit.conf."
+}
diff --git a/www-apps/cgit/files/cgit-highlight.patch b/www-apps/cgit/files/cgit-highlight.patch
new file mode 100644
index 000000000000..9d03f2b0df70
--- /dev/null
+++ b/www-apps/cgit/files/cgit-highlight.patch
@@ -0,0 +1,16 @@
+cgit's highlighter script supports newer highlight versions, but the config has
+to be patched to enable that instead of the legacy version, which does not ship
+with Gentoo any more. See: https://bugs.gentoo.org/962035
+
+--- a/filters/syntax-highlighting.sh
++++ b/filters/syntax-highlighting.sh
+@@ -115,7 +115,7 @@
+ # found (for example) on EPEL 6.
+ #
+ # This is for version 2
+-exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null
++#exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null
+
+ # This is for version 3
+-#exec highlight --force -f -I -O xhtml -S "$EXTENSION" 2>/dev/null
++exec highlight --force -f -I -O xhtml -S "$EXTENSION" 2>/dev/null
diff --git a/www-apps/cgit/files/cgitrc b/www-apps/cgit/files/cgitrc
new file mode 100644
index 000000000000..a1d9f2f572b9
--- /dev/null
+++ b/www-apps/cgit/files/cgitrc
@@ -0,0 +1,130 @@
+# Enable caching of up to 1000 output entriess
+#cache-size=1000
+
+
+# Specify some default clone prefixes
+#clone-prefix=git://foobar.com ssh://foobar.com/pub/git http://foobar.com/git
+
+# Specify the css url
+#css=/css/cgit.css
+
+
+# Show extra links for each repository on the index page
+#enable-index-links=1
+
+
+# Enable ASCII art commit history graph on the log pages
+#enable-commit-graph=1
+
+
+# Show number of affected files per commit on the log pages
+#enable-log-filecount=1
+
+
+# Show number of added/removed lines per commit on the log pages
+#enable-log-linecount=1
+
+
+# Add a cgit favicon
+#favicon=/favicon.ico
+
+
+# Use a custom logo
+#logo=/img/mylogo.png
+
+
+# Enable statistics per week, month and quarter
+#max-stats=quarter
+
+
+# Set the title and heading of the repository index page
+#root-title=foobar.com git repositories
+
+
+# Set a subheading for the repository index page
+#root-desc=tracking the foobar development
+
+
+# Include some more info about foobar.com on the index page
+#root-readme=/var/www/htdocs/about.html
+
+
+# Allow download of tar.gz, tar.bz2 and zip-files
+#snapshots=tar.gz tar.bz2 zip
+
+
+##
+## List of common mimetypes
+##
+
+# Instead of defining mime types ourselves, grab it from etc
+#mimetype-file=/etc/mime.types
+
+# Or do it manually here
+#mimetype.gif=image/gif
+#mimetype.html=text/html
+#mimetype.jpg=image/jpeg
+#mimetype.jpeg=image/jpeg
+#mimetype.pdf=application/pdf
+#mimetype.png=image/png
+#mimetype.svg=image/svg+xml
+
+
+##
+## List of repositories.
+## PS: Any repositories listed when section is unset will not be
+## displayed under a section heading
+## PPS: This list could be kept in a different file (e.g. '/etc/cgitrepos')
+## and included like this:
+## include=/etc/cgitrepos
+##
+
+
+#repo.url=foo
+#repo.path=/pub/git/foo.git
+#repo.desc=the master foo repository
+#repo.owner=fooman@foobar.com
+#repo.readme=info/web/about.html
+
+
+#repo.url=bar
+#repo.path=/pub/git/bar.git
+#repo.desc=the bars for your foo
+#repo.owner=barman@foobar.com
+#repo.readme=info/web/about.html
+
+
+# The next repositories will be displayed under the 'extras' heading
+#section=extras
+
+
+#repo.url=baz
+#repo.path=/pub/git/baz.git
+#repo.desc=a set of extensions for bar users
+
+#repo.url=wiz
+#repo.path=/pub/git/wiz.git
+#repo.desc=the wizard of foo
+
+
+# Add some mirrored repositories
+#section=mirrors
+
+
+#repo.url=git
+#repo.path=/pub/git/git.git
+#repo.desc=the dscm
+
+
+#repo.url=linux
+#repo.path=/pub/git/linux.git
+#repo.desc=the kernel
+
+# Disable adhoc downloads of this repo
+#repo.snapshots=0
+
+# Disable line-counts for this repo
+#repo.enable-log-linecount=0
+
+# Restrict the max statistics period for this repo
+#repo.max-stats=month
diff --git a/www-apps/cgit/files/postinstall-en.txt b/www-apps/cgit/files/postinstall-en.txt
new file mode 100644
index 000000000000..f7c5c8cfae90
--- /dev/null
+++ b/www-apps/cgit/files/postinstall-en.txt
@@ -0,0 +1,45 @@
+There is a few variants of configuration:
+1) Via global config file: /etc/cgitrc
+2) Or via local config file, shipped in ./conf dir into webapp_dir. It has to
+ be explicitly specified with CGIT_CONFIG env variable in your web server
+ configuration.
+
+If you would like to update the list of git repositories in cgit automatically,
+you might consider adding something similar to the following as a cronjob:
+
+"${MY_CGIBINDIR}/cgit.cgi --scan-tree=/git/repo-parent-path > /etc/cgit-repos"
+
+Then add "include=/etc/cgit-repos" in /etc/cgitrc. This way it's simpler and
+more convenient. You won't need to update your cgitrc every time you add a new
+repository.
+
+===============================================================================
+ Apache HowTo
+===============================================================================
+
+With a default apache vhost config you can now access your repository at
+http://<vhostname>/cgi-bin/cgit.cgi/
+
+If you wish to access your repository starting from the root and don't want
+'cgi-bin/cgit.cgi' to be invisible, 2 things are needed.
+
+In your apache vhost configuration file for your domain, add the following
+rewrite rules to your
+<Directory /var/www/<vhostname>/htdocs> section.
+<snip>
+ RewriteEngine On
+ # Redirect all non-existant urls to cgit
+ RewriteCond %%{REQUEST_FILENAME} !-f
+ RewriteCond %%{REQUEST_FILENAME} !-d
+ RewriteRule ^.* /cgi-bin/cgit.cgi/\$0 [L,PT]
+
+ # Redirect the empty url to cgit
+ RewriteRule ^$ /cgi-bin/cgit.cgi/ [L,PT]
+<snip>
+
+To make cgit create the correct URL's internally add to /etc/cgitrc (or your
+local config file)
+Enable virtual-root=/
+
+After these rules, you can now access cgit via http://<vhostname>/ to get the
+listing, and http://<vhostname>/repository to go directly to repository.
diff --git a/www-apps/cgit/metadata.xml b/www-apps/cgit/metadata.xml
new file mode 100644
index 000000000000..cae3a3bf45de
--- /dev/null
+++ b/www-apps/cgit/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>dev@liguros.net</email>
+ <name>Development</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>bman@gentoo.org</email>
+ <name>Aaron Bauman</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>web-apps@gentoo.org</email>
+ <name>Gentoo Webapps</name>
+ </maintainer>
+ <longdescription lang="en">
+ cgit - cgi for git
+
+ This is an attempt to create a fast web interface for the git scm, using a
+ builtin cache to decrease server io-pressure.
+ </longdescription>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:cgit_project:cgit</remote-id>
+ </upstream>
+ <use>
+ <flag name="highlight">Enable source code highlighting</flag>
+ <flag name="lua">Enable support for Lua scripting</flag>
+ </use>
+ <origin>ports</origin>
+</pkgmetadata> \ No newline at end of file