You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-dotnet/csharp-language-server/csharp-language-server-0.5....

77 lines
1.6 KiB

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DOTNET_COMPAT=6.0
inherit edo
DESCRIPTION="Roslyn-based LSP language server for C#"
HOMEPAGE="https://github.com/razzmatazz/csharp-language-server/"
SRC_URI="
https://github.com/razzmatazz/${PN}/archive/${PV}.tar.gz
-> ${P}.tar.gz
https://dev.gentoo.org/~xgqt/distfiles/deps/${P}-prebuilt.tar.xz
"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="debug"
RDEPEND="virtual/dotnet-sdk:${DOTNET_COMPAT}"
BDEPEND="${RDEPEND}"
# Generated by dotnet.
QA_PREBUILT=".*"
src_prepare() {
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_NOLOGO=1
export DOTNET_CONFIGURATION=$(usex debug Debug Release)
export DOTNET_OUTPUT="${WORKDIR}"/${P}_net${DOTNET_COMPAT}_${DOTNET_CONFIGURATION}/${PN}
export NUGET_PACKAGES="${WORKDIR}"/nuget_packages
default
}
src_configure() {
edob dotnet restore "${S}"/src \
--source "${NUGET_PACKAGES}" \
-p:TargetFramework=net${DOTNET_COMPAT}
}
src_compile() {
local myopts=(
--configuration ${DOTNET_CONFIGURATION}
--no-restore
--no-self-contained
--nologo
--output "${DOTNET_OUTPUT}"
-maxCpuCount:1
-p:TargetFramework=net${DOTNET_COMPAT}
)
edob dotnet build ${myopts[@]} "${S}"/src
}
src_test() {
local myopts=(
--configuration ${DOTNET_CONFIGURATION}
--no-restore
--nologo
-maxCpuCount:1
-p:TargetFramework=net${DOTNET_COMPAT}
)
edob dotnet test ${myopts[@]} "${S}"/src
}
src_install() {
dodir /usr/share
cp -r "${DOTNET_OUTPUT}" "${ED}"/usr/share/ || die
dosym -r /usr/share/${PN}/CSharpLanguageServer /usr/bin/csharp-ls
dodoc CHANGELOG.md README.md
}