git.iko.soy/typeable/nixpkgs
on master help sign in
rtags: fix for clang/libc++ 4

This also fixes a missing header in the SDK that rtags needs to work properly. The underlying cause is that C++ headers got shuffled around a lot in libc++ 3.8 (I believe) and became more standards-compliant, which led to a lot of C-compatible passthrough header files being added to it like math.h, which defines some C++-compatible versions of standard functions like signbit, while #include_next'ing the system math.h. In this case, including the SDK was stuffing another math.h in front of the libc++ shim, which led to all sorts of mysterious failures.

commit3a9c217804688668404ebfe9a199e6e85297a3a7 authorDan Peebles <pumpkin@me.com> dateTue 4 Apr 2017, 08:07 (10 years ago) parent35dbcbb
2 files changed+5−8
pkgs/development/tools/rtags/default.nix+4−8 pkgs/os-specific/darwin/apple-sdk/default.nix+1
pkgs/development/tools/rtags/default.nix+4−8
@@ -5,15 +5,11 @@ stdenv.mkDerivation rec {
55 version = "2.8-p1";
66
77 buildInputs = [ cmake llvmPackages.llvm openssl llvmPackages.clang emacs ]
8− ++ lib.optionals stdenv.isDarwin [ apple_sdk.sdk apple_sdk.frameworks.CoreServices ];
8+ ++ lib.optionals stdenv.isDarwin [ apple_sdk.libs.xpc apple_sdk.frameworks.CoreServices ];
99
1010 preConfigure = ''
1111 export LIBCLANG_CXXFLAGS="-isystem ${llvmPackages.clang.cc}/include $(llvm-config --cxxflags) -fexceptions" \
12− LIBCLANG_LIBDIR="${llvmPackages.clang.cc}/lib" \
13−
14− '' + lib.optionalString stdenv.isDarwin ''
15− export CXXFLAGS="-isysroot ${apple_sdk.sdk}/" \
16− MACOSX_DEPLOYMENT_TARGET="10.9"
12+ LIBCLANG_LIBDIR="${llvmPackages.clang.cc}/lib"
1713 '';
1814
1915 src = fetchgit {
@@ -24,11 +20,11 @@ stdenv.mkDerivation rec {
2420 sha256 = "0g9sgc763c5d695hjffhis19sbaqk8z4884szljf7kbrjxl17y78";
2521 };
2622
23+ enableParallelBuilding = true;
24+
2725 meta = {
2826 description = "C/C++ client-server indexer based on clang";
29−
3027 homepage = https://github.com/andersbakken/rtags;
31−
3228 license = stdenv.lib.licenses.gpl3;
3329 platforms = stdenv.lib.platforms.allBut [ "i686-linux" ];
3430 };
pkgs/os-specific/darwin/apple-sdk/default.nix+1
@@ -157,6 +157,7 @@ in rec {
157157 mkdir -p $out/include
158158 pushd $out/include >/dev/null
159159 ln -s "${sdk}/include/xpc"
160+ ln -s "${sdk}/include/launch.h"
160161 popd >/dev/null
161162 '';
162163 };