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 9284A159C9B for ; Sun, 4 Aug 2024 09:52:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C913AE2AA4; Sun, 4 Aug 2024 09:52:38 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 9FD6AE2AA4 for ; Sun, 4 Aug 2024 09:52:38 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5E1A134069F for ; Sun, 4 Aug 2024 09:52:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9376D1DCC for ; Sun, 4 Aug 2024 09:52:35 +0000 (UTC) From: "Eric Joldasov" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Eric Joldasov" Message-ID: <1722764721.a68366316366517a3e9b9409911c00226dccf0dd.bratishkaerik@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: gui-wm/river/ X-VCS-Repository: repo/proj/guru X-VCS-Files: gui-wm/river/river-0.3.5.ebuild X-VCS-Directories: gui-wm/river/ X-VCS-Committer: bratishkaerik X-VCS-Committer-Name: Eric Joldasov X-VCS-Revision: a68366316366517a3e9b9409911c00226dccf0dd X-VCS-Branch: dev Date: Sun, 4 Aug 2024 09:52:35 +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: 98dbc395-1174-4aac-bb49-7b9c944a341a X-Archives-Hash: 30c07f456cac093150f7f3d981a64488 commit: a68366316366517a3e9b9409911c00226dccf0dd Author: Eric Joldasov landless-city net> AuthorDate: Sun Aug 4 09:45:21 2024 +0000 Commit: Eric Joldasov getgoogleoff me> CommitDate: Sun Aug 4 09:45:21 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a6836631 gui-wm/river: fix Zig version detection in 0.3.5 It used zig version selected by user in `eselect-zig` previously, which is incorrect, as ebuild should use own, detected Zig version. Seems like this logic is also copy-pasted from https://github.com/bsd-ac/wayland-desktop/blob/2724ddc7532e81ba553f17e6bd2df861ccb442ee/gui-wm/river/river-0.3.2.ebuild , which, in its turn, has old logic from sys-fs/ncdu. Not critical, but fixed this too. Signed-off-by: Eric Joldasov landless-city.net> gui-wm/river/river-0.3.5.ebuild | 76 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/gui-wm/river/river-0.3.5.ebuild b/gui-wm/river/river-0.3.5.ebuild index 86665f2cc..068cdf626 100644 --- a/gui-wm/river/river-0.3.5.ebuild +++ b/gui-wm/river/river-0.3.5.ebuild @@ -28,6 +28,7 @@ KEYWORDS="~amd64" IUSE="+llvm +man pie xwayland bash-completion zsh-completion fish-completion" EZIG_MIN="0.12" +EZIG_MAX_EXCLUSIVE="0.13" DEPEND=" || ( dev-lang/zig-bin:${EZIG_MIN} dev-lang/zig:${EZIG_MIN} ) @@ -39,12 +40,69 @@ DEPEND=" " RDEPEND="${DEPEND}" +DOCS=( README.md ) + # https://github.com/ziglang/zig/issues/3382 QA_FLAGS_IGNORED="usr/bin/*" -ezig_build() { - EZIG=zig - edo "${EZIG}" build "${ZIG_BUILD_ARGS[@]}" "${@}" +# 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 + + 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 + + edo "${EZIG}" "${@}" } src_unpack() { @@ -58,7 +116,8 @@ src_unpack() { } src_configure() { - export ZIG_BUILD_ARGS=( + export ZBS_ARGS=( + --prefix usr/ -Doptimize=ReleaseSafe -Dpie=$(usex pie true false) @@ -72,17 +131,16 @@ src_configure() { } src_compile() { - ezig_build + ezig build "${ZBS_ARGS[@]}" } src_test() { - ezig_build test + ezig build test "${ZBS_ARGS[@]}" } src_install() { - ezig_build install --prefix "${ED}/usr" - - dodoc README.md + DESTDIR="${ED}" ezig build install "${ZBS_ARGS[@]}" + einstalldocs insinto /usr/share/wayland-sessions doins contrib/river.desktop