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";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "5.7.0";
|
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}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-GvORAPbQOdVpz4yY66b3OObewU98V26cZ6nrJ35nlkg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cargoHash = "sha256-b7v3ODOjY5BQCzVqlLCNUOaZS95AvIvyjOeas2XfRjM=";
|
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:
|
2023-07-15 17:15:38 +00:00
|
|
|
# https://github.com/latex-lsp/texlab/blob/v5.6.0/.github/workflows/publish.yml#L127-L131
|
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";
|
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
|
|
|
};
|
|
|
|
}
|