rzls: init at 9.0.0-preview.25052.3

fix
This commit is contained in:
bretek
2025-01-17 16:31:15 +00:00
committed by bretek
parent 56a034bda4
commit a058588d6c
3 changed files with 1360 additions and 0 deletions
+1250
View File
File diff suppressed because it is too large Load Diff
+68
View File
@@ -0,0 +1,68 @@
{
lib,
fetchFromGitHub,
buildDotnetModule,
dotnetCorePackages,
jq,
}:
let
pname = "rzls";
dotnet-sdk =
with dotnetCorePackages;
sdk_9_0
// {
inherit (sdk_8_0)
packages
targetPackages
;
};
dotnet-runtime = dotnetCorePackages.runtime_9_0;
in
buildDotnetModule {
inherit pname dotnet-sdk dotnet-runtime;
src = fetchFromGitHub {
owner = "dotnet";
repo = "razor";
rev = "dd64bf78c16a7e8fa1900da060100e9338383dea";
hash = "sha256-C5/Mc5HxxAVGLO6IPhyyBNLcjvjmF8sKg1KpIdN0/KQ=";
};
version = "9.0.0-preview.25052.3";
projectFile = "src/Razor/src/rzls/rzls.csproj";
useDotnetFromEnv = true;
nugetDeps = ./deps.json;
nativeBuildInputs = [ jq ];
postPatch = ''
# Upstream uses rollForward = latestPatch, which pins to an *exact* .NET SDK version.
jq '.sdk.rollForward = "latestMinor"' < global.json > global.json.tmp
mv global.json.tmp global.json
'';
dotnetFlags = [
# this removes the Microsoft.WindowsDesktop.App.Ref dependency
"-p:EnableWindowsTargeting=false"
];
dotnetInstallFlags = [
"-p:InformationalVersion=$version"
];
passthru = {
updateScript = ./update.sh;
};
meta = {
homepage = "https://github.com/dotnet/razor";
description = "Razor language server";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
bretek
tris203
];
mainProgram = "rzls";
};
}
+42
View File
@@ -0,0 +1,42 @@
#! /usr/bin/env nix-shell
#! nix-shell -I nixpkgs=./. --pure -i bash -p curl cacert gnused jq common-updater-scripts dotnet-sdk_8 exiftool nix
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
old_rzls_version="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./package.nix)"
apiUrl="https://feeds.dev.azure.com/azure-public/vside/_apis/packaging/Feeds/msft_consumption/packages/577084ea-e5be-4fad-951b-00d0b05fb170?api-version=7.2-preview.1"
new_rzls_version="$(curl -s $apiUrl | jq -r '.versions[0].version')"
echo $old_rzls_version
echo $new_rzls_version
if [[ "$new_rzls_version" == "$old_rzls_version" ]]; then
echo "Already up to date!"
exit 0
fi
buildDir=$(mktemp -d)
cat > $buildDir/Server.csproj <<EOF
<Project Sdk="Microsoft.Build.NoTargets/1.0.80">
<PropertyGroup>
<RestorePackagesPath>out</RestorePackagesPath>
<TargetFramework>net8.0</TargetFramework>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<AutomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssemblyPackages>
</PropertyGroup>
<ItemGroup>
<PackageDownload Include="rzls.linux-x64" version="[${new_rzls_version}]" />
</ItemGroup>
</Project>
EOF
dotnet restore -s "https://pkgs.dev.azure.com/azure-public/vside/_packaging/msft_consumption/nuget/v3/index.json" "$buildDir/Server.csproj"
version_commit="$(exiftool -ProductVersion -s3 $buildDir/out/rzls.linux-x64/$new_rzls_version/content/LanguageServer/linux-x64/rzls.dll | grep -Po '(?<=\+).*')"
cd ../../../..
update-source-version rzls "${new_rzls_version}" --rev=$version_commit
$(nix-build -A rzls.fetch-deps --no-out-link)