From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id ADB5115806A for ; Thu, 9 Mar 2023 10:54:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C86F4E090F; Thu, 9 Mar 2023 10:54:10 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9E001E090F for ; Thu, 9 Mar 2023 10:54:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A0D563402D6 for ; Thu, 9 Mar 2023 10:54:09 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 56B178DA for ; Thu, 9 Mar 2023 10:54:07 +0000 (UTC) From: "Florian Schmaus" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Florian Schmaus" Message-ID: <1678359238.195bde1f0ccb747b72a492cfdbe6be0270e5caf8.flow@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/ncdu/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/ncdu/ncdu-2.2.2-r1.ebuild X-VCS-Directories: sys-fs/ncdu/ X-VCS-Committer: flow X-VCS-Committer-Name: Florian Schmaus X-VCS-Revision: 195bde1f0ccb747b72a492cfdbe6be0270e5caf8 X-VCS-Branch: master Date: Thu, 9 Mar 2023 10:54:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 766c5f32-de56-4b30-9873-76bba18c3e99 X-Archives-Hash: 13c588eac890ba2093dda0fab447c430 commit: 195bde1f0ccb747b72a492cfdbe6be0270e5caf8 Author: Eric Joldasov getgoogleoff me> AuthorDate: Wed Jan 25 07:58:00 2023 +0000 Commit: Florian Schmaus gentoo org> CommitDate: Thu Mar 9 10:53:58 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=195bde1f sys-fs/ncdu: adjust ebuild for slotted Zig Closes: https://github.com/gentoo/gentoo/pull/29257 Signed-off-by: Eric Joldasov getgoogleoff.me> Signed-off-by: Florian Schmaus gentoo.org> sys-fs/ncdu/ncdu-2.2.2-r1.ebuild | 136 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/sys-fs/ncdu/ncdu-2.2.2-r1.ebuild b/sys-fs/ncdu/ncdu-2.2.2-r1.ebuild new file mode 100644 index 000000000000..22518d804b8f --- /dev/null +++ b/sys-fs/ncdu/ncdu-2.2.2-r1.ebuild @@ -0,0 +1,136 @@ +# 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.10.0" +EZIG_MAX_EXCLUSIVE="0.11.0" + +DEPEND="sys-libs/ncurses:=[unicode(+)]" +RDEPEND="${DEPEND}" +BDEPEND=" + || ( dev-lang/zig:0.10 dev-lang/zig-bin:0.10 ) + 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 candidates candidate selected selected_ver + + candidates=$(compgen -c zig-) + + for candidate in ${candidates}; do + if [[ ! ${candidate} =~ zig(-bin)?-([.0-9]+) ]]; then + continue + fi + + local ver + if (( ${#BASH_REMATCH[@]} == 3 )); then + ver="${BASH_REMATCH[2]}" + else + ver="${BASH_REMATCH[1]}" + fi + + 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 PATH" + fi + + export EZIG="${selected}" + export EZIG_VER="${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_compile() { + ezig build -Drelease-fast + edo pod2man --center "ncdu manual" --release "ncdu-${PV}" ncdu.pod >ncdu.1 +} + +src_test() { + ezig build test -Drelease-fast +} + +src_install() { + emake PREFIX="${ED}"/usr install + + dodoc README.md ChangeLog +}