nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 104 lines 2.6 kB view raw
1{ 2 lib, 3 mkCoqDerivation, 4 coq, 5 serapi, 6 makeWrapper, 7 version ? null, 8}: 9 10(mkCoqDerivation rec { 11 pname = "coq-lsp"; 12 owner = "ejgallego"; 13 namePrefix = [ ]; 14 15 useDune = true; 16 17 release."0.1.8+8.16".sha256 = "sha256-dEEAK5IXGjHB8D/fYJRQG/oCotoXJuWLxXB0GQlY2eo="; 18 release."0.2.3+8.17".sha256 = "sha256-s7GXRYxuCMXm0XpKAyEwYqolsVFcKHhM71uabqqK5BY="; 19 release."0.2.3+8.18".sha256 = "sha256-0cEuMWuNJwfiPdc0aHKk3EQbkVRIbVukS586EWSHCgo="; 20 release."0.2.3+8.19".sha256 = "sha256-0eQQheY2yjS7shifhUlVPLXvTmyvgNpx7deLWXBRTfA="; 21 release."0.2.3+8.20".sha256 = "sha256-TUVS8jkgf1MMOOx5y70OaeZkdIgdgmyGQ2/zKxeplEk="; 22 release."0.2.3+9.0".sha256 = "sha256-eZMM4gYRXQroEIKz6XlffyHNYryEF5dIeIoVbEulh6M="; 23 24 inherit version; 25 defaultVersion = 26 with lib.versions; 27 lib.switch coq.coq-version [ 28 { 29 case = isEq "8.16"; 30 out = "0.1.8+8.16"; 31 } 32 { 33 case = isEq "8.17"; 34 out = "0.2.3+8.17"; 35 } 36 { 37 case = isEq "8.18"; 38 out = "0.2.3+8.18"; 39 } 40 { 41 case = isEq "8.19"; 42 out = "0.2.3+8.19"; 43 } 44 { 45 case = isEq "8.20"; 46 out = "0.2.3+8.20"; 47 } 48 { 49 case = isEq "9.0"; 50 out = "0.2.3+9.0"; 51 } 52 ] null; 53 54 nativeBuildInputs = [ makeWrapper ]; 55 56 installPhase = '' 57 runHook preInstall 58 dune install -p ${pname} --prefix=$out --libdir $OCAMLFIND_DESTDIR 59 wrapProgram $out/bin/coq-lsp --prefix OCAMLPATH : $OCAMLPATH 60 runHook postInstall 61 ''; 62 63 propagatedBuildInputs = with coq.ocamlPackages; [ 64 dune-build-info 65 menhir 66 result 67 uri 68 yojson 69 ]; 70 71 meta = with lib; { 72 description = "Language Server Protocol and VS Code Extension for Coq"; 73 homepage = "https://github.com/ejgallego/coq-lsp"; 74 changelog = "https://github.com/ejgallego/coq-lsp/blob/${defaultVersion}/CHANGES.md"; 75 maintainers = with maintainers; [ alizter ]; 76 license = licenses.lgpl21Only; 77 }; 78}).overrideAttrs 79 ( 80 o: with coq.ocamlPackages; { 81 propagatedBuildInputs = 82 o.propagatedBuildInputs 83 ++ ( 84 if o.version != null && lib.versions.isLe "0.1.9+8.19" o.version && o.version != "dev" then 85 [ 86 camlp-streams 87 serapi 88 ] 89 else 90 [ 91 cmdliner 92 ppx_deriving 93 ppx_deriving_yojson 94 ppx_import 95 ppx_sexp_conv 96 ppx_compare 97 ppx_hash 98 sexplib 99 ] 100 ); 101 102 patches = lib.optional (lib.versions.isEq "0.1.8" o.version) ./coq-loader.patch; 103 } 104 )