2021-01-09 10:05:03 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2022-08-12 12:06:08 +00:00
|
|
|
, help2man
|
2020-05-29 06:06:01 +00:00
|
|
|
, installShellFiles
|
2021-05-20 23:08:51 +00:00
|
|
|
, libiconv
|
2020-04-24 23:36:52 +00:00
|
|
|
, Security
|
2021-05-20 23:08:51 +00:00
|
|
|
, CoreServices
|
2021-12-06 16:07:01 +00:00
|
|
|
, nix-update-script
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
let
|
|
|
|
isCross = stdenv.hostPlatform != stdenv.buildPlatform;
|
2022-11-04 12:27:35 +00:00
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "texlab";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "5.12.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "latex-lsp";
|
2022-11-04 12:27:35 +00:00
|
|
|
repo = "texlab";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-kLf0EG6jKJeKowNZ21cwE0a9w630GoljNwRckHrkajg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
cargoHash = "sha256-5vEoreDRHRxsVNPwZpgmeClEFZ0SzLjb5EZLfmlqEJM=";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
outputs = [ "out" ] ++ lib.optional (!isCross) "man";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ]
|
2022-11-04 12:27:35 +00:00
|
|
|
++ lib.optional (!isCross) help2man;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
libiconv
|
|
|
|
Security
|
|
|
|
CoreServices
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# When we cross compile we cannot run the output executable to
|
|
|
|
# generate the man page
|
2022-11-04 12:27:35 +00:00
|
|
|
postInstall = lib.optionalString (!isCross) ''
|
2022-08-12 12:06:08 +00:00
|
|
|
# TexLab builds man page separately in CI:
|
2024-01-02 11:29:13 +00:00
|
|
|
# https://github.com/latex-lsp/texlab/blob/v5.12.0/.github/workflows/publish.yml#L117-L121
|
2022-08-12 12:06:08 +00:00
|
|
|
help2man --no-info "$out/bin/texlab" > texlab.1
|
|
|
|
installManPage texlab.1
|
2020-05-29 06:06:01 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An implementation of the Language Server Protocol for LaTeX";
|
2023-04-29 16:46:19 +00:00
|
|
|
homepage = "https://github.com/latex-lsp/texlab";
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/latex-lsp/texlab/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-05-28 09:39:13 +00:00
|
|
|
maintainers = with maintainers; [ doronbehar kira-bruneau ];
|
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|