1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/tools/misc/ccls/default.nix

51 lines
1.4 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, makeWrapper
, cmake, llvmPackages, rapidjson, runtimeShell }:
stdenv.mkDerivation rec {
name = "ccls-${version}";
2019-05-13 08:58:22 +01:00
version = "0.20190314.1";
src = fetchFromGitHub {
owner = "MaskRay";
repo = "ccls";
rev = version;
2019-05-13 08:58:22 +01:00
sha256 = "1yvxliryqx2bc7r6ri4iafbrjx19jk8hnfbvq5xla72q0gqb97lf";
};
nativeBuildInputs = [ cmake makeWrapper ];
buildInputs = with llvmPackages; [ clang-unwrapped llvm rapidjson ];
2019-03-02 08:42:54 +00:00
cmakeFlags = [
"-DSYSTEM_CLANG=ON"
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12"
];
2019-05-13 08:58:22 +01:00
preConfigure = ''
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
'';
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;
2019-03-02 08:42:54 +00:00
platforms = platforms.linux ++ platforms.darwin;
maintainers = [ maintainers.mic92 ];
};
}