48 lines
1.2 KiB
Nix
Raw Normal View History

2021-01-07 11:09:48 -05:00
{ lib
, stdenv
2019-09-02 20:45:26 -04:00
, rustPlatform
, fetchFromGitHub
2020-05-27 18:18:18 -05:00
, installShellFiles
2021-05-18 19:15:41 +03:00
, libiconv
2019-09-02 20:45:26 -04:00
, Security
2021-05-18 19:15:41 +03:00
, CoreServices
2019-09-02 20:45:26 -04:00
}:
rustPlatform.buildRustPackage rec {
pname = "texlab";
version = "3.0.0";
2019-09-02 20:45:26 -04:00
src = fetchFromGitHub {
owner = "latex-lsp";
repo = pname;
2020-02-13 22:35:02 -05:00
rev = "v${version}";
hash = "sha256-jOxneMqeyvMQWKPNha59H6qWSFmx+Z71SU2+M5VWMsA=";
2019-09-02 20:45:26 -04:00
};
cargoHash = "sha256-H6czxSTw93RNTaN0OJyv0RfwmGAiFkpDgUtXHCD+jrY=";
outputs = [ "out" "man" ];
2019-09-02 20:45:26 -04:00
2020-05-27 18:18:18 -05:00
nativeBuildInputs = [ installShellFiles ];
2021-05-18 19:15:41 +03:00
buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security CoreServices ];
2019-09-02 20:45:26 -04:00
2020-05-27 18:18:18 -05:00
postInstall = ''
installManPage texlab.1
# Remove generated dylib of html2md dependency. TexLab statically
# links to the generated rlib and doesn't reference the dylib. I
# couldn't find any way to prevent building this by passing cargo flags.
# See https://gitlab.com/Kanedias/html2md/-/blob/0.2.10/Cargo.toml#L20
2021-05-18 19:15:41 +03:00
rm "$out/lib/libhtml2md${stdenv.hostPlatform.extensions.sharedLibrary}"
rmdir "$out/lib"
2021-05-18 19:15:41 +03:00
'';
2020-05-27 18:18:18 -05:00
2021-01-07 11:09:48 -05:00
meta = with lib; {
2019-09-02 20:45:26 -04:00
description = "An implementation of the Language Server Protocol for LaTeX";
2021-01-07 11:09:48 -05:00
homepage = "https://texlab.netlify.app";
2019-09-02 20:45:26 -04:00
license = licenses.mit;
maintainers = with maintainers; [ doronbehar kira-bruneau ];
2019-09-02 20:45:26 -04:00
};
}