Merge pull request #336523 from GaetanLepage/typst-lsp

typst-lsp: fix by updating dependencies
This commit is contained in:
Pol Dellaiera 2024-08-22 16:58:25 +02:00 committed by GitHub
commit 363da5289e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 550 additions and 479 deletions

View File

@ -0,0 +1,82 @@
{
lib,
rustPlatform,
fetchFromGitHub,
stdenv,
darwin,
nix-update-script,
vscode-extensions,
testers,
typst-lsp,
}:
rustPlatform.buildRustPackage rec {
pname = "typst-lsp";
# Please update the corresponding vscode extension when updating
# this derivation.
version = "0.13.0";
src = fetchFromGitHub {
owner = "nvarner";
repo = "typst-lsp";
rev = "refs/tags/v${version}";
hash = "sha256-OubKtSHw9L4GzVzZY0AVdHY7LzKg/XQIhUfUc2OYAG0=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"typst-syntax-0.7.0" = "sha256-yrtOmlFAKOqAmhCP7n0HQCOQpU3DWyms5foCdUb9QTg=";
"typstfmt_lib-0.2.7" = "sha256-LBYsTCjZ+U+lgd7Z3H1sBcWwseoHsuepPd66bWgfvhI=";
};
};
# In order to make typst-lsp build with rust >= 1.80, we use the patched Cargo.lock from
# https://github.com/nvarner/typst-lsp/pull/515
# TODO remove once the PR will have been merged upstream
postPatch = ''
rm Cargo.lock
ln -s ${./Cargo.lock} Cargo.lock
'';
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ];
checkFlags =
[
# requires internet access
"--skip=workspace::package::external::remote_repo::test::full_download"
]
++ lib.optionals stdenv.isDarwin [
# both tests fail on darwin with 'Attempted to create a NULL object.'
"--skip=workspace::fs::local::test::read"
"--skip=workspace::package::external::manager::test::local_package"
];
# workspace::package::external::manager::test::local_package tries to access the data directory
preCheck = ''
export HOME=$(mktemp -d)
'';
passthru = {
updateScript = nix-update-script { };
tests = {
vscode-extension = vscode-extensions.nvarner.typst-lsp;
version = testers.testVersion { package = typst-lsp; };
};
};
meta = {
description = "Brand-new language server for Typst";
homepage = "https://github.com/nvarner/typst-lsp";
mainProgram = "typst-lsp";
changelog = "https://github.com/nvarner/typst-lsp/releases/tag/${src.rev}";
license = with lib.licenses; [
asl20
mit
];
maintainers = with lib.maintainers; [
figsoda
GaetanLepage
];
};
}

View File

@ -1,58 +0,0 @@
{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "typst-lsp";
# Please update the corresponding vscode extension when updating
# this derivation.
version = "0.13.0";
src = fetchFromGitHub {
owner = "nvarner";
repo = "typst-lsp";
rev = "v${version}";
hash = "sha256-OubKtSHw9L4GzVzZY0AVdHY7LzKg/XQIhUfUc2OYAG0=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"typst-syntax-0.7.0" = "sha256-yrtOmlFAKOqAmhCP7n0HQCOQpU3DWyms5foCdUb9QTg=";
"typstfmt_lib-0.2.7" = "sha256-LBYsTCjZ+U+lgd7Z3H1sBcWwseoHsuepPd66bWgfvhI=";
};
};
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
checkFlags = [
# requires internet access
"--skip=workspace::package::external::remote_repo::test::full_download"
] ++ lib.optionals stdenv.isDarwin [
# both tests fail on darwin with 'Attempted to create a NULL object.'
"--skip=workspace::fs::local::test::read"
"--skip=workspace::package::external::manager::test::local_package"
];
# workspace::package::external::manager::test::local_package tries to access the data directory
preCheck = ''
export HOME=$(mktemp -d)
'';
meta = {
description = "Brand-new language server for Typst";
homepage = "https://github.com/nvarner/typst-lsp";
mainProgram = "typst-lsp";
changelog = "https://github.com/nvarner/typst-lsp/releases/tag/${src.rev}";
license = with lib.licenses; [ asl20 mit ];
maintainers = with lib.maintainers; [ figsoda GaetanLepage ];
# Incompatible with Rust >= 1.80
# Fix to be merged upstream: https://github.com/nvarner/typst-lsp/pull/515
broken = true;
};
}

View File

@ -17353,8 +17353,6 @@ with pkgs;
svls = callPackage ../development/tools/language-servers/svls { };
typst-lsp = callPackage ../development/tools/language-servers/typst-lsp { };
vala-language-server = callPackage ../development/tools/language-servers/vala-language-server { };
vscode-langservers-extracted = callPackage ../development/tools/language-servers/vscode-langservers-extracted { };