From 097122d2fdabde011188fa5067c2e30823c81381 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 10 Apr 2019 22:42:01 -0400 Subject: [PATCH] clang8: apply patch to disable xpc --- .../compilers/llvm/8/clang/clang-xpc.patch | 41 +++++++++++++++++++ .../compilers/llvm/8/clang/default.nix | 6 ++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/llvm/8/clang/clang-xpc.patch diff --git a/pkgs/development/compilers/llvm/8/clang/clang-xpc.patch b/pkgs/development/compilers/llvm/8/clang/clang-xpc.patch new file mode 100644 index 000000000000..eb57d3458228 --- /dev/null +++ b/pkgs/development/compilers/llvm/8/clang/clang-xpc.patch @@ -0,0 +1,41 @@ +From 61c9b97d7b81cc2c013b423bf1763a92b14fcae3 Mon Sep 17 00:00:00 2001 +From: Jan Korous +Date: Tue, 26 Mar 2019 03:48:25 +0000 +Subject: [PATCH] [clangd][xpc][cmake] Respect explicit value of + CLANGD_BUILD_XPC + +We shouldn't prevent user from disabling XPC framework build on Darwin. +However, by keeping it on by default our CI systems also test +it by default on macOS. + +Based on user request: +http://lists.llvm.org/pipermail/cfe-dev/2019-March/061778.html + +Differential Revision: https://reviews.llvm.org/D59808 + +git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@356974 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + CMakeLists.txt | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 66ebeaeeaa..514b17fb3c 100644 +--- a/tools/extra/CMakeLists.txt ++++ b/tools/extra/CMakeLists.txt +@@ -1,6 +1,13 @@ +-option(CLANGD_BUILD_XPC "Build XPC Support For Clangd." OFF) +-if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +- set(CLANGD_BUILD_XPC ON CACHE BOOL "" FORCE) ++if (NOT DEFINED CLANGD_BUILD_XPC) ++ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ++ set(CLANGD_BUILD_XPC_DEFAULT ON) ++ else () ++ set(CLANGD_BUILD_XPC_DEFAULT OFF) ++ endif () ++ ++ set(CLANGD_BUILD_XPC ${CLANGD_BUILD_XPC_DEFAULT} CACHE BOOL "Build XPC Support For Clangd." FORCE) ++ ++ unset(CLANGD_BUILD_XPC_DEFAULT) + endif () + + add_subdirectory(clang-apply-replacements) \ No newline at end of file diff --git a/pkgs/development/compilers/llvm/8/clang/default.nix b/pkgs/development/compilers/llvm/8/clang/default.nix index 44ec6c376cdb..353e113ddb9a 100644 --- a/pkgs/development/compilers/llvm/8/clang/default.nix +++ b/pkgs/development/compilers/llvm/8/clang/default.nix @@ -24,6 +24,7 @@ let cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" + "-DCLANGD_BUILD_XPC=OFF" ] ++ stdenv.lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" @@ -35,7 +36,10 @@ let "-DLINK_POLLY_INTO_TOOLS=ON" ]; - patches = [ ./purity.patch ]; + patches = [ + ./purity.patch + ./clang-xpc.patch + ]; postPatch = '' sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \