2019-08-21 22:56:11 +02:00
|
|
|
{ stdenv, fetchFromGitHub
|
2019-02-26 12:45:54 +01:00
|
|
|
, cmake, llvmPackages, rapidjson, runtimeShell }:
|
2018-12-26 09:53:41 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "ccls";
|
2019-11-01 19:12:48 +01:00
|
|
|
version = "0.20190823.4";
|
2018-12-26 09:53:41 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MaskRay";
|
|
|
|
repo = "ccls";
|
|
|
|
rev = version;
|
2019-11-01 19:12:48 +01:00
|
|
|
sha256 = "1aq8q32jdkhrdrsghk8sdb8y4si36hfavf7jq2yzbqinjx03y1n4";
|
2018-12-26 09:53:41 +01:00
|
|
|
};
|
|
|
|
|
2019-08-21 22:56:11 +02:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2018-12-26 09:53:41 +01:00
|
|
|
buildInputs = with llvmPackages; [ clang-unwrapped llvm rapidjson ];
|
|
|
|
|
2019-03-02 09:42:54 +01:00
|
|
|
cmakeFlags = [
|
2019-08-21 22:56:11 +02:00
|
|
|
"-DCCLS_VERSION=${version}"
|
2019-03-02 09:42:54 +01:00
|
|
|
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12"
|
|
|
|
];
|
2018-12-26 09:53:41 +01:00
|
|
|
|
2019-05-13 09:58:22 +02:00
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
|
|
|
|
'';
|
|
|
|
|
2019-02-26 12:45:54 +01:00
|
|
|
shell = runtimeShell;
|
2018-12-26 09:53:41 +01:00
|
|
|
postFixup = ''
|
|
|
|
# We need to tell ccls where to find the standard library headers.
|
|
|
|
|
|
|
|
standard_library_includes="\\\"-isystem\\\", \\\"${stdenv.lib.getDev stdenv.cc.libc}/include\\\""
|
|
|
|
standard_library_includes+=", \\\"-isystem\\\", \\\"${llvmPackages.libcxx}/include/c++/v1\\\""
|
|
|
|
export standard_library_includes
|
|
|
|
|
|
|
|
wrapped=".ccls-wrapped"
|
|
|
|
export wrapped
|
|
|
|
|
|
|
|
mv $out/bin/ccls $out/bin/$wrapped
|
|
|
|
substituteAll ${./wrapper} $out/bin/ccls
|
|
|
|
chmod --reference=$out/bin/$wrapped $out/bin/ccls
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A c/c++ language server powered by clang";
|
|
|
|
homepage = https://github.com/MaskRay/ccls;
|
|
|
|
license = licenses.asl20;
|
2019-03-02 09:42:54 +01:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2019-09-26 13:16:41 +02:00
|
|
|
maintainers = with maintainers; [ mic92 tobim ];
|
2018-12-26 09:53:41 +01:00
|
|
|
};
|
|
|
|
}
|