public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Eric Joldasov" <bratishkaerik@getgoogleoff.me>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-zig/zls/
Date: Wed,  7 Aug 2024 09:09:13 +0000 (UTC)	[thread overview]
Message-ID: <1723021585.f6910ff72fb20cf5200972b1f053ef40eaecd432.bratishkaerik@gentoo> (raw)

commit:     f6910ff72fb20cf5200972b1f053ef40eaecd432
Author:     Eric Joldasov <bratishkaerik <AT> landless-city <DOT> net>
AuthorDate: Wed Aug  7 09:06:25 2024 +0000
Commit:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
CommitDate: Wed Aug  7 09:06:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=f6910ff7

dev-zig/zls: add 0.13.0

Signed-off-by: Eric Joldasov <bratishkaerik <AT> landless-city.net>

 dev-zig/zls/Manifest          |   3 +
 dev-zig/zls/zls-0.13.0.ebuild | 138 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 141 insertions(+)

diff --git a/dev-zig/zls/Manifest b/dev-zig/zls/Manifest
index fad748f47..f5690dd7d 100644
--- a/dev-zig/zls/Manifest
+++ b/dev-zig/zls/Manifest
@@ -5,3 +5,6 @@ DIST zls-0.10.0.tar.gz 320226 BLAKE2B fc9c7c6e37d9347710520ddf0bc90b704ff6115210
 DIST zls-0.12.0-deps.tar.xz 20804 BLAKE2B 94a01028a56a4e5f692301435619c9132a70bd28b1ec78d381519108c6b6878fcf0d085080406b6855cdc68f5ac79b7e5eb0320747579b752cb2f2d79f89b89a SHA512 786dca28b56ffedf7a52cb2527f3fbc2b7e8207f6cec4667447ac30fa9237dca7e926fd3c6bb43d7868676e363a8a508775ef218a8050034bd1bc836ba64bf23
 DIST zls-0.12.0-version_data.tar.xz 16104 BLAKE2B 70a0a9933e3e9897537f048231117f1b151334af9d4d3ff5400f2b740e872f6c3df2b2e387a2f5c27bb5f20165e3632c90955b694de80e9cefc2d463f73d7647 SHA512 fda868da04daebd7b163e155049ed14af55373b09e546208100537b9827ff7a37ae3d02325cc06aa76db6f8e3fdf6ec26c9872f6c89bbe5c4a3a1aa230803000
 DIST zls-0.12.0.tar.gz 341927 BLAKE2B e347bb166f4b784dfaa154cac7459418a0fd6833823db843b3e83d351ff20d8fb0ce0e15c9d00d84c81d819710332bc95b7d59ee1a2c3930b2bfa12f65e250c1 SHA512 d27653ae57c89f5fea03ecaaefa4c273a6a3694db24a1ebdf735c7ef0ca145e2d61c8f19d18bd5434659ac8ed0f5f715e6d15e4252db87ad89ac9402f580a860
+DIST zls-0.13.0-deps.tar.xz 20824 BLAKE2B 8bb7a54311c3eeb38127bc7c2c3e961790d93d5d3bc00ddc725eac5a8bcbf338e58bea53224e857d7281b8ffd426976e9365c994479e5ca57cd0b1f5a234d896 SHA512 81da5f9d8abf7c20e00c3a326ac64e9fb36188404e632e3fc2b4cbab0632a03266745b7cb3e64ccea7b938af6ef0197d8ab2ef6f1211e487efd1b72651bbff60
+DIST zls-0.13.0-version_data.tar.xz 14080 BLAKE2B af304ba9c6e1aa370a49254b88aa3209957c94b363bb9c2252bd7b066b6c2782c568bf2b61164d75e7aa08260dd3187e9417c583738ca41be0d2c0afd3b18cdf SHA512 8a79a5608d98619e6228bacdf929e1443814c7b37e131279ffc89066a1ae5ca00fa9edb8fe57145bd4044fc7d870893067605ec3ec0bc7fafb3145e6af159186
+DIST zls-0.13.0.tar.gz 352025 BLAKE2B e244763f7270f25680b17f1c525f8ae7a268857d60393672ca1003518cf6d5ae243f384cf9d5d84f4eb27545f02dfe389c3068c5e6f91a2b3fa49df0fc4d89a9 SHA512 92b20418d1410f013ac3d4cbe432ab1b748454d013a2d1be5abd47b91ea7d2340d55b775a66eb116f4641e9f2fc3baf84a44ba8f58b1a774254e7428449bb088

diff --git a/dev-zig/zls/zls-0.13.0.ebuild b/dev-zig/zls/zls-0.13.0.ebuild
new file mode 100644
index 000000000..691fe9037
--- /dev/null
+++ b/dev-zig/zls/zls-0.13.0.ebuild
@@ -0,0 +1,138 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit edo
+
+DESCRIPTION="The officially unofficial Ziglang language server"
+HOMEPAGE="https://github.com/zigtools/zls"
+
+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
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+EZIG_MIN="0.13"
+EZIG_MAX_EXCLUSIVE="0.14"
+
+DEPEND="|| ( dev-lang/zig:${EZIG_MIN} dev-lang/zig-bin:${EZIG_MIN} )"
+RDEPEND="${DEPEND}"
+
+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...
+
+	edo "${EZIG}" "${@}"
+}
+
+src_configure() {
+	export ZBS_ARGS=(
+		--prefix usr/
+		-Doptimize=ReleaseSafe
+		--system "${WORKDIR}/zig-eclass/p/"
+		-Dversion_data_file_path=version_data.zig
+		--verbose
+	)
+}
+
+src_compile() {
+	ezig build "${ZBS_ARGS[@]}"
+}
+
+src_test() {
+	ezig build test "${ZBS_ARGS[@]}"
+}
+
+src_install() {
+	DESTDIR="${ED}" ezig build install "${ZBS_ARGS[@]}"
+	einstalldocs
+}
+
+pkg_postinst() {
+	elog "You can find more information about options here: https://github.com/zigtools/zls/wiki/Configuration"
+}


             reply	other threads:[~2024-08-07  9:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07  9:09 Eric Joldasov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-07 14:50 [gentoo-commits] repo/proj/guru:dev commit in: dev-zig/zls/ Eric Joldasov
2024-12-27 19:21 Eric Joldasov
2024-12-17 20:59 Eric Joldasov
2024-12-15 12:20 Eric Joldasov
2024-12-15 12:20 Eric Joldasov
2024-08-24 11:16 Eric Joldasov
2024-08-09 17:04 Eric Joldasov
2024-08-07 10:16 Eric Joldasov
2024-08-07 10:15 Eric Joldasov
2024-08-07  9:17 Eric Joldasov
2024-08-01  6:25 Eric Joldasov
2024-07-31 19:33 Eric Joldasov
2024-07-31 19:09 Eric Joldasov
2023-10-10  2:48 Eric Joldasov
2023-08-26 17:01 Eric Joldasov
2023-03-09 14:14 Eric Joldasov
2023-03-09 14:14 Eric Joldasov
2023-03-07  8:43 Eric Joldasov
2023-02-05 11:56 Eric Joldasov
2022-11-04 17:22 Eric Joldasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1723021585.f6910ff72fb20cf5200972b1f053ef40eaecd432.bratishkaerik@gentoo \
    --to=bratishkaerik@getgoogleoff.me \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox