commit:     f44cea0d934b73cd532a524bbcae38055b89c63b
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 17 21:18:32 2024 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 17:49:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f44cea0d

sys-fs/ncdu: add 2.4

Closes: https://bugs.gentoo.org/933721
Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 sys-fs/ncdu/Manifest        |   2 +
 sys-fs/ncdu/ncdu-2.4.ebuild | 129 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 131 insertions(+)

diff --git a/sys-fs/ncdu/Manifest b/sys-fs/ncdu/Manifest
index 82b19943b1c5..517abebb0ec5 100644
--- a/sys-fs/ncdu/Manifest
+++ b/sys-fs/ncdu/Manifest
@@ -4,3 +4,5 @@ DIST ncdu-1.20.tar.gz 150835 BLAKE2B 
0bb6576ecbb3df281c67a48409db2118521760f378d
 DIST ncdu-1.20.tar.gz.asc 833 BLAKE2B 
487e3b4b1e83a2211e91307ff1ca1778059cc3f923e04b57bc5d4780d0108589a062861a25bafa58c357ad4495edce814a58eeb24087e06b958d8e23a02bbf22
 SHA512 
168bcc4255bbb7a576af39422797804726f84134dc342f59abfc825f93c5ee4e9fcaa9e0c18626ee87b96b2d19a7c57beaa8e1b3dc57eff2bd659add18027140
 DIST ncdu-2.3.tar.gz 56608 BLAKE2B 
9fd73fba83c57195f8ffbad5b954140a776d1cd1d7b3e458f832255ee9c07eb8af9888a23ed3c671f508d6ba3795e2361f79e64b4b24630d744470efc5bfaded
 SHA512 
283f78761b225883e090c4d0d1325bffc70049477087df3e8d1afcebc3136930c2636b2bba4aa6e43d53626668519c26a1528ba5c75489d3b5924e8974184e47
 DIST ncdu-2.3.tar.gz.asc 833 BLAKE2B 
fd5b6b4b6e14b8bf66f5053c637598c3a0a9ad16d29c20805d62418fb69a22fa1155c8591dac35514d088c57853043c7d6c8b94abdff793a3f7b0a53cb41fd65
 SHA512 
698d8f1c0a7e0267fdfcfc7823803012ab7faae6eee75af406ecc9a73244463521de851c3f2b116ae7f6d7e567ea17a7ef6aae75e135a8efbb02333525455b20
+DIST ncdu-2.4.tar.gz 51648 BLAKE2B 
cbe2db51b86a6ac624d3a0300bb41337ff0c8ce63165dc0f471872c0fa646406bf190d4f0605130d55d981c0a694a6bbbb9092c8857c45f362dd4bf0016b0617
 SHA512 
0bbc4400d05831528415c7e22d1e4b5c43cb8682c2bc35439e150763bcbc159664fee887d0fce89d28fb4199378972ffeb54c694e27b5f58d2ddaef890b055a7
+DIST ncdu-2.4.tar.gz.asc 833 BLAKE2B 
a0a0f3c8652242c1b3a7bab2e8eb03901bd0d8a0ecb2079ee914a08aeacda7e7c706eccef70f43a90d7190f32a3bc0eea2e3d46a9b3c29621a9e952328271cb7
 SHA512 
8eb6be85e7e33b2fcda3ce4c34bc4ff4a0c438b70a8d40ed91fababc728b77f0a83e0e07d70a7528821c774262a6d30cbbf73c56624d61ce3f4e93f27f1d5c31

diff --git a/sys-fs/ncdu/ncdu-2.4.ebuild b/sys-fs/ncdu/ncdu-2.4.ebuild
new file mode 100644
index 000000000000..2ee5dced948e
--- /dev/null
+++ b/sys-fs/ncdu/ncdu-2.4.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit verify-sig edo
+
+DESCRIPTION="NCurses Disk Usage"
+HOMEPAGE="https://dev.yorhel.nl/ncdu";
+SRC_URI="
+       https://dev.yorhel.nl/download/${P}.tar.gz
+       verify-sig? ( https://dev.yorhel.nl/download/${P}.tar.gz.asc )
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+EZIG_MIN="0.12"
+EZIG_MAX_EXCLUSIVE="0.13"
+
+DEPEND="sys-libs/ncurses:=[unicode(+)]"
+RDEPEND="${DEPEND}"
+BDEPEND="
+       || ( dev-lang/zig:${EZIG_MIN} dev-lang/zig-bin:${EZIG_MIN} )
+       virtual/pkgconfig
+       dev-lang/perl
+       verify-sig? ( sec-keys/openpgp-keys-yorhel )
+"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/yoranheling.asc
+
+# see https://github.com/ziglang/zig/issues/3382
+# For now, Zig doesn't support CFLAGS/LDFLAGS/etc.
+QA_FLAGS_IGNORED="usr/bin/ncdu"
+
+# Many thanks to Florian Schmaus (Flowdalic)!
+# Adapted from https://github.com/gentoo/gentoo/pull/28986
+# Set the EZIG environment variable.
+zig-set_EZIG() {
+       [[ -n ${EZIG} ]] && return
+
+       if [[ -n ${EZIG_OVERWRITE} ]]; then
+               export EZIG="${EZIG_OVERWRITE}"
+               return
+       fi
+
+       local candidate selected selected_ver ver
+
+       for candidate in "${BROOT}"/usr/bin/zig-*; do
+               if [[ ! -L ${candidate} || ${candidate} != 
*/zig?(-bin)-+([0-9.]) ]]; then
+                       continue
+               fi
+
+               ver=${candidate##*-}
+
+               if [[ -n ${EZIG_EXACT_VER} ]]; then
+                       ver_test "${ver}" -ne "${EZIG_EXACT_VER}" && continue
+
+                       selected="${candidate}"
+                       selected_ver="${ver}"
+                       break
+               fi
+
+               if [[ -n ${EZIG_MIN} ]] \
+                          && ver_test "${ver}" -lt "${EZIG_MIN}"; then
+                       # Candidate does not satisfy EZIG_MIN condition.
+                       continue
+               fi
+
+               if [[ -n ${EZIG_MAX_EXCLUSIVE} ]] \
+                          && ver_test "${ver}" -ge "${EZIG_MAX_EXCLUSIVE}"; 
then
+                       # Candidate does not satisfy EZIG_MAX_EXCLUSIVE 
condition.
+                       continue
+               fi
+
+               if [[ -n ${selected_ver} ]] \
+                          && ver_test "${selected_ver}" -gt "${ver}"; then
+                       # Candidate is older than the currently selected 
candidate.
+                       continue
+               fi
+
+               selected="${candidate}"
+               selected_ver="${ver}"
+       done
+
+       if [[ -z ${selected} ]]; then
+               die "Could not find (suitable) zig installation in 
${BROOT}/usr/bin"
+       fi
+
+       export EZIG="${selected}"
+       export EZIG_VER="${selected_ver}"
+}
+
+# Invoke zig with the optionally provided arguments.
+ezig() {
+       zig-set_EZIG
+
+       # Unfortunately, we cannot add more args here, since syntax is different
+       # for every subcommands. Yes, even target/cpu :( f.i. :
+       # -target/-mcpu for zig build-exe vs -Dtarget/-Dcpu for zig build-
+       # -OReleaseSafe for zig build-exe vs -DReleaseSafe for zig build
+       # (or even none, if hardcoded by upstream so choice is 
-Drelease=true/false)
+       # Ofc we can patch this, but still...
+
+       edo "${EZIG}" "${@}"
+}
+
+src_unpack() {
+       if use verify-sig; then
+               verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc}
+       fi
+       default
+}
+
+src_configure() {
+       zig-set_EZIG
+       export ZIG=${EZIG}
+}
+
+src_test() {
+       ezig build test -Doptimize=ReleaseFast
+}
+
+src_install() {
+       emake PREFIX="${ED}"/usr install
+
+       dodoc README.md ChangeLog
+}

Reply via email to