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 (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6EFCF15802D for ; Sun, 15 Dec 2024 12:20:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 93952E0ABF; Sun, 15 Dec 2024 12:20:54 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 5845DE0AC4 for ; Sun, 15 Dec 2024 12:20:52 +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 D1086342FB0 for ; Sun, 15 Dec 2024 12:20:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0D9921DF4 for ; Sun, 15 Dec 2024 12:20:50 +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: <1734265191.773340b253418f0fdc9998bb441533bddf343853.bratishkaerik@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-zig/zls/ X-VCS-Repository: repo/proj/guru X-VCS-Files: dev-zig/zls/zls-9999.ebuild X-VCS-Directories: dev-zig/zls/ X-VCS-Committer: bratishkaerik X-VCS-Committer-Name: Eric Joldasov X-VCS-Revision: 773340b253418f0fdc9998bb441533bddf343853 X-VCS-Branch: dev Date: Sun, 15 Dec 2024 12:20:50 +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: 39145400-f67f-4081-b8a2-634ce46718a6 X-Archives-Hash: ec338202858ee977a932cc6575a37940 commit: 773340b253418f0fdc9998bb441533bddf343853 Author: Eric Joldasov landless-city net> AuthorDate: Sun Dec 15 12:19:26 2024 +0000 Commit: Eric Joldasov getgoogleoff me> CommitDate: Sun Dec 15 12:19:51 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=773340b2 dev-zig/zls: sync 9999 with 0.13.0-r1, port to `zig.eclass` Signed-off-by: Eric Joldasov landless-city.net> dev-zig/zls/zls-9999.ebuild | 149 +++++++++----------------------------------- 1 file changed, 29 insertions(+), 120 deletions(-) diff --git a/dev-zig/zls/zls-9999.ebuild b/dev-zig/zls/zls-9999.ebuild index 4966ee4a7..40f7c46cb 100644 --- a/dev-zig/zls/zls-9999.ebuild +++ b/dev-zig/zls/zls-9999.ebuild @@ -3,155 +3,64 @@ EAPI=8 -inherit edo - DESCRIPTION="The officially unofficial Ziglang language server" -HOMEPAGE="https://github.com/zigtools/zls" +HOMEPAGE="https://zigtools.org/zls/ https://github.com/zigtools/zls" + +declare -g -r -A ZBS_DEPENDENCIES=( + [diffz-1220102cb2c669d82184fb1dc5380193d37d68b54e8d75b76b2d155b9af7d7e2e76d.tar.gz]='https://github.com/ziglibs/diffz/archive/ef45c00d655e5e40faf35afbbde81a1fa5ed7ffb.tar.gz' + [known_folders-12209cde192558f8b3dc098ac2330fc2a14fdd211c5433afd33085af75caa9183147.tar.gz]='https://github.com/ziglibs/known-folders/archive/0ad514dcfb7525e32ae349b9acc0a53976f3a9fa.tar.gz' +) if [[ ${PV} == 9999 ]]; then + ZIG_SLOT="9999" + EGIT_REPO_URI="https://github.com/zigtools/zls" inherit git-r3 - - EZIG_MIN="9999" - EZIG_MAX_EXCLUSIVE="99991" - BDEPEND="dev-lang/zig:9999" else + ZIG_SLOT="0.13" + SRC_URI=" https://github.com/zigtools/zls/archive/refs/tags/${PV}.tar.gz -> zls-${PV}.tar.gz - https://codeberg.org/BratishkaErik/distfiles/releases/download/zls-${PV}/zls-${PV}-deps.tar.xz https://codeberg.org/BratishkaErik/distfiles/releases/download/zls-${PV}/zls-${PV}-version_data.tar.xz " KEYWORDS="~amd64" - - EZIG_MIN="0.13" - EZIG_MAX_EXCLUSIVE="0.14" - BDEPEND="|| ( dev-lang/zig:${EZIG_MIN} dev-lang/zig-bin:${EZIG_MIN} )" fi +inherit zig +SRC_URI+="${ZBS_DEPENDENCIES_SRC_URI}" + LICENSE="MIT" SLOT="0" -RDEPEND="${BDEPEND}" - -DOCS=( README.md ) - -# see https://github.com/ziglang/zig/issues/3382 -# For now, Zig Build System doesn't support CFLAGS/LDFLAGS/etc. -QA_FLAGS_IGNORED="usr/bin/zls" - -# : copied from sys-fs/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... +# Sync with "minimum_runtime_zig_version" from upstream's "build.zig". +RDEPEND=" + || ( + >=dev-lang/zig-0.12.0 + >=dev-lang/zig-bin-0.12.0 + ) +" - edo "${EZIG}" "${@}" -} +DOCS=( "README.md" ) src_unpack() { if [[ ${PV} == 9999 ]]; then git-r3_src_unpack - - cd "${S}" || die - ezig build --fetch --global-cache-dir "${WORKDIR}/zig-eclass/" || die "Pre-fetching Zig modules failed" + zig_live_fetch -Denable_tracy=false else - default_src_unpack + zig_src_unpack fi } src_configure() { - export ZBS_ARGS=( - --prefix usr/ - -Doptimize=ReleaseSafe - --system "${WORKDIR}/zig-eclass/p/" - --verbose + local my_zbs_args=( + -Dpie=true + -Denable_tracy=false ) -} - -src_compile() { - ezig build "${ZBS_ARGS[@]}" -} - -src_test() { - ezig build test "${ZBS_ARGS[@]}" -} -src_install() { - DESTDIR="${ED}" ezig build install "${ZBS_ARGS[@]}" - einstalldocs + zig_src_configure } pkg_postinst() { - elog "You can find more information about options here: https://github.com/zigtools/zls/wiki/Configuration" + elog "You can find configuration guide here:" + elog "https://zigtools.org/zls/" }