python312Packages.icontract: relax deps (#380554)
[NixPkgs.git] / pkgs / by-name / er / erlang-language-platform / package.nix
blobd106725a4067288fe2c900c8c48b632c7abdebf3
2   stdenv,
3   lib,
4   fetchurl,
5   autoPatchelfHook,
6 }:
7 let
8   arch = if stdenv.hostPlatform.isAarch64 then "aarch64" else "x86_64";
9   release =
10     if stdenv.hostPlatform.isDarwin then
11       "macos-${arch}-apple-darwin"
12     else
13       "linux-${arch}-unknown-linux-gnu";
15   hashes = {
16     linux-aarch64-unknown-linux-gnu = "sha256-Fte7oZD5+aFph5xGrKtbSimb3aHewkjsJRXB+64IW5A=";
17     linux-x86_64-unknown-linux-gnu = "sha256-slnXUEtHJjq6wRQTt1EwqlOO/2zIGmGwa/HCi3F0YMA=";
18     macos-aarch64-apple-darwin = "sha256-3K3sPizBR/+DJIX67GsYqm2X5k7kq3kBRg8P2WALTZs=";
19     macos-x86_64-apple-darwin = "sha256-j+AVmLfe/yCvKvYhL5ikhXA1g+zQ1CDlMl1FYO6q1yA=";
20   };
22 stdenv.mkDerivation rec {
23   pname = "erlang-language-platform";
24   version = "2025-01-21";
26   src = fetchurl {
27     url = "https://github.com/WhatsApp/erlang-language-platform/releases/download/${version}/elp-${release}-otp-26.2.tar.gz";
28     hash = hashes.${release};
29   };
31   nativeBuildInputs = lib.optionals stdenv.hostPlatform.isElf [ autoPatchelfHook ];
33   buildInputs = lib.optionals stdenv.hostPlatform.isElf [ (lib.getLib stdenv.cc.cc) ];
35   sourceRoot = ".";
37   installPhase = ''
38     runHook preInstall
39     install -m755 -D elp $out/bin/elp
40     runHook postInstall
41   '';
43   meta = {
44     description = "An IDE-first library for the semantic analysis of Erlang code, including LSP server, linting and refactoring tools.";
45     homepage = "https://github.com/WhatsApp/erlang-language-platform/";
46     license = with lib.licenses; [
47       mit
48       asl20
49     ];
50     platforms = [
51       "aarch64-linux"
52       "x86_64-linux"
53       "aarch64-darwin"
54       "x86_64-darwin"
55     ];
56     maintainers = with lib.maintainers; [ offsetcyan ];
57     sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
58   };