Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, rustPlatform
4, fetchFromGitHub
5, help2man
6, installShellFiles
7, libiconv
8, Security
9, CoreServices
10, nix-update-script
11}:
12
13let
14 isCross = stdenv.hostPlatform != stdenv.buildPlatform;
15in
16rustPlatform.buildRustPackage rec {
17 pname = "texlab";
18 version = "5.6.0";
19
20 src = fetchFromGitHub {
21 owner = "latex-lsp";
22 repo = "texlab";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-3s8Nn3jLj39LWRb3jPbNAx0IcNUxGlvzybm+7+M5FRU=";
25 };
26
27 cargoHash = "sha256-fHw8ulW7VsgxexY+hbZ+2MXwrzz77Ku7vQtsFRAO/JA=";
28
29 outputs = [ "out" ] ++ lib.optional (!isCross) "man";
30
31 nativeBuildInputs = [ installShellFiles ]
32 ++ lib.optional (!isCross) help2man;
33
34 buildInputs = lib.optionals stdenv.isDarwin [
35 libiconv
36 Security
37 CoreServices
38 ];
39
40 # When we cross compile we cannot run the output executable to
41 # generate the man page
42 postInstall = lib.optionalString (!isCross) ''
43 # TexLab builds man page separately in CI:
44 # https://github.com/latex-lsp/texlab/blob/v5.6.0/.github/workflows/publish.yml#L127-L131
45 help2man --no-info "$out/bin/texlab" > texlab.1
46 installManPage texlab.1
47 '';
48
49 passthru.updateScript = nix-update-script { };
50
51 meta = with lib; {
52 description = "An implementation of the Language Server Protocol for LaTeX";
53 homepage = "https://github.com/latex-lsp/texlab";
54 license = licenses.mit;
55 maintainers = with maintainers; [ doronbehar kira-bruneau ];
56 platforms = platforms.all;
57 };
58}