tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
ccls: fix libc++ header path
Gabriel Ebner
4 years ago
eef236e8
6e72346f
+8
-17
2 changed files
expand all
collapse all
unified
split
pkgs
development
tools
misc
ccls
default.nix
wrapper
+3
-9
pkgs/development/tools/misc/ccls/default.nix
···
21
21
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
22
22
'';
23
23
24
24
+
clang = llvmPackages.clang;
24
25
shell = runtimeShell;
25
25
-
postFixup = ''
26
26
-
# We need to tell ccls where to find the standard library headers.
27
26
28
28
-
standard_library_includes="\\\"-isystem\\\", \\\"${lib.getDev stdenv.cc.libc}/include\\\""
29
29
-
standard_library_includes+=", \\\"-isystem\\\", \\\"${llvmPackages.libcxx}/include/c++/v1\\\""
30
30
-
export standard_library_includes
31
31
-
32
32
-
wrapped=".ccls-wrapped"
33
33
-
export wrapped
34
34
-
27
27
+
postFixup = ''
28
28
+
export wrapped=".ccls-wrapped"
35
29
mv $out/bin/ccls $out/bin/$wrapped
36
30
substituteAll ${./wrapper} $out/bin/ccls
37
31
chmod --reference=$out/bin/$wrapped $out/bin/ccls
+5
-8
pkgs/development/tools/misc/ccls/wrapper
···
1
1
#! @shell@ -e
2
2
3
3
-
initString="--init={\"clang\":{\"extraArgs\": [@standard_library_includes@"
4
4
-
5
5
-
if [ "${NIX_CFLAGS_COMPILE}" != "" ]; then
6
6
-
read -a cflags_array <<< ${NIX_CFLAGS_COMPILE}
7
7
-
initString+=$(printf ', \"%s\"' "${cflags_array[@]}")
8
8
-
fi
9
9
-
10
10
-
initString+="]}}"
3
3
+
printf -v extraArgs ',\"%s\"' \
4
4
+
$(cat @clang@/nix-support/libc-cflags \
5
5
+
@clang@/nix-support/libcxx-cxxflags) \
6
6
+
${NIX_CFLAGS_COMPILE}
7
7
+
initString="--init={\"clang\":{\"extraArgs\":[${extraArgs:1}]}}"
11
8
12
9
exec -a "$0" "@out@/bin/@wrapped@" "${initString}" "$@"