nixpkgs/pkgs/by-name/ti/tinymist/package.nix
2024-08-13 13:31:54 +02:00

84 lines
2.0 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
libgit2,
openssl,
zlib,
stdenv,
darwin,
nix-update-script,
testers,
tinymist,
vscode-extensions,
}:
rustPlatform.buildRustPackage rec {
pname = "tinymist";
# Please update the corresponding vscode extension when updating
# this derivation.
version = "0.11.19";
src = fetchFromGitHub {
owner = "Myriad-Dreamin";
repo = "tinymist";
rev = "refs/tags/v${version}";
hash = "sha256-ejumGfG98l3N3mA7UX86GYa46hIwxjEB2/jvAW9rv0I=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"typst-0.11.1" = "sha256-dQf4qYaOni/jwIjRVXXCZLTn6ox3v6EyhCbaONqNtcw=";
"typst-syntax-0.7.0" = "sha256-yrtOmlFAKOqAmhCP7n0HQCOQpU3DWyms5foCdUb9QTg=";
"typstfmt_lib-0.2.7" = "sha256-LBYsTCjZ+U+lgd7Z3H1sBcWwseoHsuepPd66bWgfvhI=";
};
};
nativeBuildInputs = [ pkg-config ];
buildInputs =
[
libgit2
openssl
zlib
]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk_11_0.frameworks.CoreFoundation
darwin.apple_sdk_11_0.frameworks.CoreServices
darwin.apple_sdk_11_0.frameworks.Security
darwin.apple_sdk_11_0.frameworks.SystemConfiguration
];
checkFlags = [
"--skip=e2e"
# Fails because of missing `creation_timestamp` field
# https://github.com/NixOS/nixpkgs/pull/328756#issuecomment-2241322796
"--skip=test_config_update"
];
passthru = {
updateScript = nix-update-script { };
tests = {
vscode-extension = vscode-extensions.myriad-dreamin.tinymist;
version = testers.testVersion {
command = "${meta.mainProgram} -V";
package = tinymist;
};
};
};
meta = {
changelog = "https://github.com/Myriad-Dreamin/tinymist/blob/${src.rev}/CHANGELOG.md";
description = "Tinymist is an integrated language service for Typst";
homepage = "https://github.com/Myriad-Dreamin/tinymist";
license = lib.licenses.asl20;
mainProgram = "tinymist";
maintainers = with lib.maintainers; [
GaetanLepage
lampros
];
};
}