dev-zig/zls: add unkeyworded 0.14.0-r1 with improvements

Changes in diff order:
- remove github as the second HOMEPAGE (it's already in remote-id)
- simplify & automatize ZIG_SLOT assignment
  - also moved comment there so it's clearer
- simplify SRC_URI assignment
- use ZIG_SLOT in SLOT
- introduce minimum_runtime_zig_version
- unquote DOCS contents
- remove obsolete pkg_postinst

Signed-off-by: Filip Kobierski <fkobi@pm.me>
This commit is contained in:
Filip Kobierski
2025-04-05 22:50:35 +02:00
parent 87647bb209
commit 1261a8a8e3
2 changed files with 67 additions and 13 deletions

View File

@@ -0,0 +1,61 @@
# Copyright 2022-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="The officially unofficial Ziglang language server"
HOMEPAGE="https://zigtools.org/zls/"
declare -g -r -A ZBS_DEPENDENCIES=(
[known_folders-0.0.0-Fy-PJtLDAADGDOwYwMkVydMSTp_aN-nfjCZw6qPQ2ECL.tar.gz]='https://github.com/ziglibs/known-folders/archive/aa24df42183ad415d10bc0a33e6238c437fc0f59.tar.gz'
[lsp_codegen-0.1.0-CMjjo0ZXCQB-rAhPYrlfzzpU0u0u2MeGvUucZ-_g32eg.tar.gz]='https://github.com/zigtools/zig-lsp-codegen/archive/063a98c13a2293d8654086140813bdd1de6501bc.tar.gz'
[N-V-__8AABhrAQAQLLLGadghhPsdxTgBk9N9aLVOjXW3ay0V.tar.gz]='https://github.com/ziglibs/diffz/archive/ef45c00d655e5e40faf35afbbde81a1fa5ed7ffb.tar.gz'
)
if [[ ${PV} == 9999 ]]; then
ZIG_SLOT="${PV}"
EGIT_REPO_URI="https://github.com/zigtools/zls"
inherit git-r3
else
# Sync with "minimum_build_zig_version" from upstream's "build.zig".
ZIG_SLOT="$(ver_cut 1-2)" # works only for releases, but that's okay
SRC_URI="https://github.com/zigtools/zls/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
# KEYWORDS="~amd64" uncomment to approve the changes
fi
inherit zig
SRC_URI+="${ZBS_DEPENDENCIES_SRC_URI}"
LICENSE="MIT"
SLOT="0/${ZIG_SLOT}"
# Sync with upstream's build.zig. Seems to be the latest zig release
minimum_runtime_zig_version="0.14.0"
RDEPEND="
|| (
>=dev-lang/zig-${minimum_runtime_zig_version}
>=dev-lang/zig-bin-${minimum_runtime_zig_version}
)
"
DOCS=( README.md )
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
zig_live_fetch -Denable-tracy=false
else
zig_src_unpack
fi
}
src_configure() {
local my_zbs_args=(
-Dpie=true
-Denable-tracy=false
)
zig_src_configure
}

View File

@@ -4,7 +4,7 @@
EAPI=8
DESCRIPTION="The officially unofficial Ziglang language server"
HOMEPAGE="https://zigtools.org/zls/ https://github.com/zigtools/zls"
HOMEPAGE="https://zigtools.org/zls/"
declare -g -r -A ZBS_DEPENDENCIES=(
[known_folders-0.0.0-Fy-PJtLDAADGDOwYwMkVydMSTp_aN-nfjCZw6qPQ2ECL.tar.gz]='https://github.com/ziglibs/known-folders/archive/aa24df42183ad415d10bc0a33e6238c437fc0f59.tar.gz'
@@ -14,16 +14,14 @@ declare -g -r -A ZBS_DEPENDENCIES=(
# Sync with "minimum_build_zig_version" from upstream's "build.zig".
if [[ ${PV} == 9999 ]]; then
ZIG_SLOT="9999"
ZIG_SLOT="${PV}"
EGIT_REPO_URI="https://github.com/zigtools/zls"
inherit git-r3
else
ZIG_SLOT="0.14"
ZIG_SLOT="$(ver_cut 1-2)"
SRC_URI="
https://github.com/zigtools/zls/archive/refs/tags/${PV}.tar.gz -> zls-${PV}.tar.gz
"
SRC_URI="https://github.com/zigtools/zls/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
fi
@@ -31,7 +29,7 @@ inherit zig
SRC_URI+="${ZBS_DEPENDENCIES_SRC_URI}"
LICENSE="MIT"
SLOT="0"
SLOT="0/${ZIG_SLOT}"
# Sync with "minimum_runtime_zig_version" from upstream's "build.zig".
RDEPEND="
@@ -41,7 +39,7 @@ RDEPEND="
)
"
DOCS=( "README.md" )
DOCS=( README.md )
src_unpack() {
if [[ ${PV} == 9999 ]]; then
@@ -60,8 +58,3 @@ src_configure() {
zig_src_configure
}
pkg_postinst() {
elog "You can find configuration guide here:"
elog "https://zigtools.org/zls/"
}