@@ -27,14 +27,20 @@ stdenv.mkDerivation rec {
2727 "-DCLANG_CXX=ON"
2828 ];
2929
30+ shell = stdenv.shell;
3031 postFixup = ''
3132 # We need to tell cquery where to find the standard library headers.
3233
33− args="\"-isystem\", \"${if (stdenv.hostPlatform.libc == "glibc") then stdenv.cc.libc.dev else stdenv.cc.libc}/include\""
34− args+=", \"-isystem\", \"${llvmPackages.libcxx}/include/c++/v1\""
34+ standard_library_includes="\\\"-isystem\\\", \\\"${if (stdenv.hostPlatform.libc == "glibc") then stdenv.cc.libc.dev else stdenv.cc.libc}/include\\\""
35+ standard_library_includes+=", \\\"-isystem\\\", \\\"${llvmPackages.libcxx}/include/c++/v1\\\""
36+ export standard_library_includes
3537
36− wrapProgram $out/bin/cquery \
37− --add-flags "'"'--init={"extraClangArguments": ['"''${args}"']}'"'"
38+ wrapped=".cquery-wrapped"
39+ export wrapped
40+
41+ mv $out/bin/cquery $out/bin/$wrapped
42+ substituteAll ${./wrapper} $out/bin/cquery
43+ chmod --reference=$out/bin/$wrapped $out/bin/cquery
3844 '';
3945
4046 doInstallCheck = true;
@@ -50,5 +56,6 @@ stdenv.mkDerivation rec {
5056 license = licenses.mit;
5157 platforms = platforms.linux ++ platforms.darwin;
5258 maintainers = [ maintainers.tobim ];
59+ priority = 3;
5360 };
5461}