depot/third_party/nixpkgs/pkgs/development/tools/language-servers/ccls/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

42 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub
, cmake, llvmPackages, rapidjson, runtimeShell }:
stdenv.mkDerivation rec {
pname = "ccls";
version = "0.20240202";
src = fetchFromGitHub {
owner = "MaskRay";
repo = "ccls";
rev = version;
sha256 = "sha256-xVx3+cnmIdoA7R1S31EaiPj+DOTqkINoQeMgauW61Ys=";
};
nativeBuildInputs = [ cmake llvmPackages.llvm.dev ];
buildInputs = with llvmPackages; [ libclang llvm rapidjson ];
cmakeFlags = [ "-DCCLS_VERSION=${version}" ];
preConfigure = ''
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
'';
clang = llvmPackages.clang;
shell = runtimeShell;
postFixup = ''
export wrapped=".ccls-wrapped"
mv $out/bin/ccls $out/bin/$wrapped
substituteAll ${./wrapper} $out/bin/ccls
chmod --reference=$out/bin/$wrapped $out/bin/ccls
'';
meta = with lib; {
description = "C/c++ language server powered by clang";
mainProgram = "ccls";
homepage = "https://github.com/MaskRay/ccls";
license = licenses.asl20;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ mic92 tobim ];
};
}