dev-zig/zls: add 0.10.0-r2

* Now bundles data for 0.10.1 since this is the only 0.10 Zig version
  in "::gentoo".
* Data part is separated from patch and moved to distfiles, thus
  avoiding SizeViolation error in this revision.

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
This commit is contained in:
Eric Joldasov
2024-08-01 18:32:22 +05:00
parent ecd9070090
commit de6b8018d0
3 changed files with 175 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
DIST known-folders-24845b0103e611c108d6bc334231c464e699742c.tar.gz 6618 BLAKE2B cdfe56329edcf50a07eea919b1a753ce965eeaa3c1d9e08289d74704809e489a7a674fb41c0fa16115a406512477cfa99953d434d44c52429c241df7e7bb4f1d SHA512 4ac156ad51793a733d8fd5a24936bd7b0bb8a527b9d19d9cb7d43c9ec7ac983f37dfc00fdfec23147964689201cdbee213e66b4af0917b0bb324b02e8a3a7151
DIST tracy-f493d4aa8ba8141d9680473fad007d8a6348628e.tar.gz 5401470 BLAKE2B 8a027bfe82842d6d3caeddcf03499a3671a99f2210a40b434e9893a60da88775c19738230e8d55cb1de020fe9f0d7d414df76f36f4a55b04a0c41c8c0de8232b SHA512 e8a844ff015b4c7a261e3251be33deced4f4a29a8fc8254244c125b391266e7a38bdf8d988ff4aac10bd0ee5538fca1e274a0d91dcde08d0bd021006cb326e6f
DIST zls-0.10.0-data-for-0.10.1.tar.xz 16668 BLAKE2B 76d6381ad09f050bccb468f2bbe3973d2059a8f09a22b39a76f0d959b46e5b72871e24267e03ae58d149628a5af728ed058e7be15c992dffc1f4072195b4beb4 SHA512 fe2ab662feee8e687a03497f7f383cf9edb2b2de7fce614f5138ead6fc45f337fd85e8cba0e352e6905618df43bae737977d70a783d4a3339e9df1f6bbe714c0
DIST zls-0.10.0.tar.gz 320226 BLAKE2B fc9c7c6e37d9347710520ddf0bc90b704ff6115210e044e68a973a2edefe024d14cf410ed0fe74400c1bed8b57f8316dc4298561f78de3abe112bc38df70404b SHA512 16a55ef0ecfac1bf43c4d917741db8389dc835cfdd9e78e9853180dad7218656c6a09b67b7185e7d87ccb2196a4deb457c3d476300eff01ce8c9bfab597576ad
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

View File

@@ -0,0 +1,20 @@
diff --git a/src/data/data.zig b/src/data/data.zig
index f6e3b04..ea2c46a 100644
--- a/src/data/data.zig
+++ b/src/data/data.zig
@@ -7,4 +7,5 @@ pub usingnamespace switch (build_options.data_version) {
.@"0.8.0" => @import("0.8.0.zig"),
.@"0.8.1" => @import("0.8.1.zig"),
.@"0.9.0" => @import("0.9.0.zig"),
+ .@"0.10.1" => @import("0.10.1.zig"),
};
diff --git a/src/shared.zig b/src/shared.zig
index 2521220..da751aa 100644
--- a/src/shared.zig
+++ b/src/shared.zig
@@ -7,4 +7,5 @@ pub const ZigVersion = enum {
@"0.8.0",
@"0.8.1",
@"0.9.0",
+ @"0.10.1",
};

View File

@@ -0,0 +1,154 @@
# 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"
KF_COMMIT="24845b0103e611c108d6bc334231c464e699742c"
TRACY_COMMIT="f493d4aa8ba8141d9680473fad007d8a6348628e"
SRC_URI="
https://github.com/ziglibs/known-folders/archive/${KF_COMMIT}.tar.gz -> known-folders-${KF_COMMIT}.tar.gz
https://github.com/wolfpld/tracy/archive/${TRACY_COMMIT}.tar.gz -> tracy-${TRACY_COMMIT}.tar.gz
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}-data-for-0.10.1.tar.xz
"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
EZIG_MIN="0.10"
EZIG_MAX_EXCLUSIVE="0.11"
DEPEND="|| ( dev-lang/zig:${EZIG_MIN} dev-lang/zig-bin:${EZIG_MIN} )"
RDEPEND="${DEPEND}"
# 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"
PATCHES=(
"${FILESDIR}/zls-0.10.0-add-0.10.1-tag.patch"
)
# : 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_prepare() {
rm -r src/known-folders || die
mv "../known-folders-${KF_COMMIT}" src/known-folders || die
rm -r src/tracy || die
mv "../tracy-${TRACY_COMMIT}" src/zinput || die
default
}
src_configure() {
# Set supported version to 0.10.1 since this is the only package
# from 0.10.x series we have in main repo (0.10.0 was removed long time ago).
export ZBS_ARGS=(
--prefix usr/
-Drelease-safe
-Ddata_version=0.10.1
--verbose
)
}
src_compile() {
ezig build "${ZBS_ARGS[@]}" || die
}
src_test() {
ezig build test "${ZBS_ARGS[@]}" || die
}
src_install() {
DESTDIR="${ED}" ezig build install "${ZBS_ARGS[@]}" || die
dodoc README.md
}
pkg_postinst() {
elog "You can find more information about options here: "
elog "https://github.com/zigtools/zls/blob/0.10.0/README.md#configuration-options"
}