summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Joldasov <bratishkaerik@getgoogleoff.me>2023-08-04 21:46:28 +0600
committerJakov Smolić <jsmolic@gentoo.org>2023-08-25 05:58:01 +0200
commit26ff8c49e9e214ce28d06e3dd2128c1d29b54b3a (patch)
tree167016c2180146ea58fdb03bd97803289930c028 /sys-fs/ncdu
parentdev-lang/zig: add 0.11.0 (diff)
downloadgentoo-26ff8c49e9e214ce28d06e3dd2128c1d29b54b3a.tar.gz
gentoo-26ff8c49e9e214ce28d06e3dd2128c1d29b54b3a.tar.bz2
gentoo-26ff8c49e9e214ce28d06e3dd2128c1d29b54b3a.zip
sys-fs/ncdu: add 2.3
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me> Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>
Diffstat (limited to 'sys-fs/ncdu')
-rw-r--r--sys-fs/ncdu/Manifest2
-rw-r--r--sys-fs/ncdu/ncdu-2.3.ebuild129
2 files changed, 131 insertions, 0 deletions
diff --git a/sys-fs/ncdu/Manifest b/sys-fs/ncdu/Manifest
index 471c26088fb2..8cefaf0320dd 100644
--- a/sys-fs/ncdu/Manifest
+++ b/sys-fs/ncdu/Manifest
@@ -4,3 +4,5 @@ DIST ncdu-1.18.tar.gz 159781 BLAKE2B c590424ed6d18b898d88fa405459f5d8988317d336f
DIST ncdu-1.18.tar.gz.asc 833 BLAKE2B 2695e3f2a26026f5fc56db3d2e0f15288fdff118e12275333f1db3e85d9d7b0290477670153dbd752e14fbeecc4207410fe55ad39fc7b2daa5d697920ac406c3 SHA512 35f0f3f7f61a49cd2ea020b6207551a953c23bb47f5f6483017fc961f857ef0283932386826707137d857377d0ae5e26ed4a4da26d47042977999e95fe389d38
DIST ncdu-2.2.2.tar.gz 56096 BLAKE2B fca41e74e4eb2509496276aa964ecf6a20db860d0b1d6bab9a169d8d6c5c7c2d41f088241cf57c92d7cf51bb5d84642c2a3a6db99410e6332061e6d35efa94e6 SHA512 5742b4abca1168256b6a7afa24d25e709bc3b490181d85fc070ddce4aad9d41fa3acb5c5a63676d804d082918fdf2bf0c98a27d8d07a56abeef0574c1b598da6
DIST ncdu-2.2.2.tar.gz.asc 833 BLAKE2B 5c6e886853aefec7615774b0c10e4a873d4e51da6d4d66ebd78318a40e7ce1a1d98c948ffd30eaa473cf50f9529dfe150d5831744e62f6762ae471b1abcbc4bb SHA512 494b8e08e2b8a87b31db08c5dcbb922c181fcef188974def2ad5550de16b16b281bbd5d8e401327276a07af8bd5979bdc46f84fde10a7e8601f9559cf452a77c
+DIST ncdu-2.3.tar.gz 56608 BLAKE2B 9fd73fba83c57195f8ffbad5b954140a776d1cd1d7b3e458f832255ee9c07eb8af9888a23ed3c671f508d6ba3795e2361f79e64b4b24630d744470efc5bfaded SHA512 283f78761b225883e090c4d0d1325bffc70049477087df3e8d1afcebc3136930c2636b2bba4aa6e43d53626668519c26a1528ba5c75489d3b5924e8974184e47
+DIST ncdu-2.3.tar.gz.asc 833 BLAKE2B fd5b6b4b6e14b8bf66f5053c637598c3a0a9ad16d29c20805d62418fb69a22fa1155c8591dac35514d088c57853043c7d6c8b94abdff793a3f7b0a53cb41fd65 SHA512 698d8f1c0a7e0267fdfcfc7823803012ab7faae6eee75af406ecc9a73244463521de851c3f2b116ae7f6d7e567ea17a7ef6aae75e135a8efbb02333525455b20
diff --git a/sys-fs/ncdu/ncdu-2.3.ebuild b/sys-fs/ncdu/ncdu-2.3.ebuild
new file mode 100644
index 000000000000..55dbebc9a84c
--- /dev/null
+++ b/sys-fs/ncdu/ncdu-2.3.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2023 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.11"
+EZIG_MAX_EXCLUSIVE="0.12"
+
+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="${BROOT}"/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
+}