14 isCross = stdenv.hostPlatform != stdenv.buildPlatform;
16 rustPlatform.buildRustPackage rec {
20 src = fetchFromGitHub {
23 rev = "refs/tags/v${version}";
24 hash = "sha256-V2+2fiQsU55Ig6GoxDJB0RCTh8nhuiGIYM3NeR4pU+k=";
27 cargoHash = "sha256-MPhG+YZ52fvv3+cKNebIkWwvruUsaRnOqPI1fs3osNI=";
29 outputs = [ "out" ] ++ lib.optional (!isCross) "man";
31 nativeBuildInputs = [ installShellFiles ]
32 ++ lib.optional (!isCross) help2man;
34 buildInputs = lib.optionals stdenv.isDarwin [
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.15.0/.github/workflows/publish.yml#L117-L121
45 help2man --no-info "$out/bin/texlab" > texlab.1
46 installManPage texlab.1
49 passthru.updateScript = nix-update-script { };
52 description = "An implementation of the Language Server Protocol for LaTeX";
53 homepage = "https://github.com/latex-lsp/texlab";
54 changelog = "https://github.com/latex-lsp/texlab/blob/v${version}/CHANGELOG.md";
55 license = licenses.mit;
56 maintainers = with maintainers; [ doronbehar kira-bruneau ];
57 platforms = platforms.all;
58 mainProgram = "texlab";