2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2019-02-26 11:45:54 +00:00
|
|
|
, cmake, llvmPackages, rapidjson, runtimeShell }:
|
2018-12-26 08:53:41 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "ccls";
|
2021-04-10 07:19:39 +01:00
|
|
|
version = "0.20210330";
|
2018-12-26 08:53:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MaskRay";
|
|
|
|
repo = "ccls";
|
|
|
|
rev = version;
|
2021-04-10 07:19:39 +01:00
|
|
|
sha256 = "sha256-jipSipgD0avd7XODlpxnqjHK3s6nacaxbIQIddix7X8=";
|
2018-12-26 08:53:41 +00:00
|
|
|
};
|
|
|
|
|
2021-05-07 23:09:45 +01:00
|
|
|
nativeBuildInputs = [ cmake llvmPackages.llvm.dev ];
|
|
|
|
buildInputs = with llvmPackages; [ libclang llvm rapidjson ];
|
2018-12-26 08:53:41 +00:00
|
|
|
|
2020-01-14 11:10:32 +00:00
|
|
|
cmakeFlags = [ "-DCCLS_VERSION=${version}" ];
|
2018-12-26 08:53:41 +00:00
|
|
|
|
2019-05-13 08:58:22 +01:00
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
|
|
|
|
'';
|
|
|
|
|
2021-05-24 11:39:15 +01:00
|
|
|
clang = llvmPackages.clang;
|
2019-02-26 11:45:54 +00:00
|
|
|
shell = runtimeShell;
|
2018-12-26 08:53:41 +00:00
|
|
|
|
2021-05-24 11:39:15 +01:00
|
|
|
postFixup = ''
|
|
|
|
export wrapped=".ccls-wrapped"
|
2018-12-26 08:53:41 +00:00
|
|
|
mv $out/bin/ccls $out/bin/$wrapped
|
|
|
|
substituteAll ${./wrapper} $out/bin/ccls
|
|
|
|
chmod --reference=$out/bin/$wrapped $out/bin/ccls
|
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2018-12-26 08:53:41 +00:00
|
|
|
description = "A c/c++ language server powered by clang";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/MaskRay/ccls";
|
2018-12-26 08:53:41 +00:00
|
|
|
license = licenses.asl20;
|
2019-03-02 08:42:54 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2019-09-26 12:16:41 +01:00
|
|
|
maintainers = with maintainers; [ mic92 tobim ];
|
2018-12-26 08:53:41 +00:00
|
|
|
};
|
|
|
|
}
|