2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, cmake, llvmPackages, rapidjson, runtimeShell }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ccls";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "0.20240505";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MaskRay";
|
|
|
|
repo = "ccls";
|
|
|
|
rev = version;
|
2024-10-04 16:56:33 +00:00
|
|
|
sha256 = "sha256-YZeP6sHYLNvlf49mvtymxHuH1lmIkqcanpqVMzeLeFQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [ cmake llvmPackages.llvm.dev ];
|
|
|
|
buildInputs = with llvmPackages; [ libclang llvm rapidjson ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [ "-DCCLS_VERSION=${version}" ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
|
|
|
|
'';
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
clang = llvmPackages.clang;
|
2020-04-24 23:36:52 +00:00
|
|
|
shell = runtimeShell;
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
postFixup = ''
|
|
|
|
export wrapped=".ccls-wrapped"
|
2020-04-24 23:36:52 +00:00
|
|
|
mv $out/bin/ccls $out/bin/$wrapped
|
|
|
|
substituteAll ${./wrapper} $out/bin/ccls
|
|
|
|
chmod --reference=$out/bin/$wrapped $out/bin/ccls
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "C/c++ language server powered by clang";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "ccls";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/MaskRay/ccls";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
maintainers = with maintainers; [ mic92 tobim ];
|
|
|
|
};
|
|
|
|
}
|