nixpkgs/pkgs/development/tools/misc/ccls/default.nix
Jörg Thalheim fc3f98bb7d
Merge pull request #57217 from r-ryantm/auto-update/ccls
ccls: 0.20181225.8 -> 0.20190301
2019-03-10 09:43:39 +00:00

48 lines
1.4 KiB
Nix

{ stdenv, fetchFromGitHub, makeWrapper
, cmake, llvmPackages, rapidjson, runtimeShell }:
stdenv.mkDerivation rec {
name = "ccls-${version}";
version = "0.20190301";
src = fetchFromGitHub {
owner = "MaskRay";
repo = "ccls";
rev = version;
sha256 = "1n60mly993czq3mnb82k8yqjrbfnsnx5v5dmr8ylqif3awcsk04i";
};
nativeBuildInputs = [ cmake makeWrapper ];
buildInputs = with llvmPackages; [ clang-unwrapped llvm rapidjson ];
cmakeFlags = [
"-DSYSTEM_CLANG=ON"
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12"
"-DCMAKE_CXX_FLAGS=-fvisibility=hidden"
];
shell = runtimeShell;
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;
platforms = platforms.linux ++ platforms.darwin;
maintainers = [ maintainers.mic92 ];
};
}