From 184aefa3c48826038c9c618487f62ccf127b54c9 Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Sat, 5 Nov 2016 17:14:41 +0100 Subject: [PATCH] rtags: fix darwin build Adds dependency to MacOS_SDK 10.9 and accordingly to the macosx deployment target to configure SDK-based deployment in rtags. In detail, rtags makes use of launch_activate_socket() which is available in launchd.h >10.9. Latter is still not available through apple-opensource-releases, if ever. Thus, the deployment target and build input have to be added to let rtags build scripts make use of MAC_OS_X_VERSION_MAX_ALLOWED correctly. --- pkgs/development/tools/rtags/default.nix | 14 ++++++++++---- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/rtags/default.nix b/pkgs/development/tools/rtags/default.nix index 959681c7e1a8..e0475bdad761 100644 --- a/pkgs/development/tools/rtags/default.nix +++ b/pkgs/development/tools/rtags/default.nix @@ -1,14 +1,20 @@ -{ stdenv, fetchgit, cmake, llvmPackages, openssl, writeScript, bash, emacs }: +{ stdenv, lib, fetchgit, cmake, llvmPackages, openssl, writeScript, apple_sdk, bash, emacs }: stdenv.mkDerivation rec { name = "rtags-${version}"; version = "2.3"; - buildInputs = [ cmake llvmPackages.llvm openssl llvmPackages.clang emacs ]; + buildInputs = [ cmake llvmPackages.llvm openssl llvmPackages.clang emacs ] + ++ lib.optional stdenv.isDarwin apple_sdk.sdk; preConfigure = '' - export LIBCLANG_CXXFLAGS="-isystem ${llvmPackages.clang.cc}/include $(llvm-config --cxxflags)" \ - LIBCLANG_LIBDIR="${llvmPackages.clang.cc}/lib" + export LIBCLANG_CXXFLAGS="-isystem ${llvmPackages.clang.cc}/include $(llvm-config --cxxflags) " \ + + LIBCLANG_LIBDIR="${llvmPackages.clang.cc}/lib" \ + + '' + lib.optionalString stdenv.isDarwin '' + export CXXFLAGS="-isysroot ${apple_sdk.sdk}/" \ + MACOSX_DEPLOYMENT_TARGET="10.9" ''; src = fetchgit { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a38f1c00ffb7..db1ef6faca03 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5130,7 +5130,9 @@ in rgbds = callPackage ../development/compilers/rgbds { }; - rtags = callPackage ../development/tools/rtags/default.nix {}; + rtags = callPackage ../development/tools/rtags/default.nix { + inherit (darwin) apple_sdk; + }; rust = rustStable; rustStable = callPackage ../development/compilers/rust {};