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

48 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub
, cmake, llvmPackages, rapidjson, runtimeShell }:
stdenv.mkDerivation rec {
pname = "ccls";
2020-10-27 20:54:39 +00:00
version = "0.20201025";
src = fetchFromGitHub {
owner = "MaskRay";
repo = "ccls";
rev = version;
2020-10-27 20:54:39 +00:00
sha256 = "13v00q1bz8g0ckw1sv0zyicbc44irc00vhwxdv3vvwlvylm7s21p";
};
2019-08-21 21:56:11 +01:00
nativeBuildInputs = [ cmake ];
buildInputs = with llvmPackages; [ clang-unwrapped llvm rapidjson ];
cmakeFlags = [ "-DCCLS_VERSION=${version}" ];
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\\\", \\\"${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 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;
2019-09-26 12:16:41 +01:00
maintainers = with maintainers; [ mic92 tobim ];
};
}