From a1b84f8898fc23e1cde3a27bc40f2ccc890e9ff4 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Tue, 2 Jan 2018 14:53:46 +0100 Subject: [PATCH] sys-devel/clang: add prefix includes patch for darwin too Like for older llvm versions, ensure clang uses the prefix include paths on Darwin. Closes: https://bugs.gentoo.org/642644 Package-Manager: Portage-2.3.13, Repoman-2.3.3 --- sys-devel/clang/clang-5.0.1.ebuild | 11 +++++++++-- .../5.0.0/darwin_prefix-include-paths.patch | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 sys-devel/clang/files/5.0.0/darwin_prefix-include-paths.patch diff --git a/sys-devel/clang/clang-5.0.1.ebuild b/sys-devel/clang/clang-5.0.1.ebuild index 9aeef0ecf6d4..2e3b5d39486f 100644 --- a/sys-devel/clang/clang-5.0.1.ebuild +++ b/sys-devel/clang/clang-5.0.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 @@ -9,7 +9,7 @@ CMAKE_MIN_VERSION=3.7.0-r1 PYTHON_COMPAT=( python2_7 ) inherit cmake-utils eapi7-ver flag-o-matic llvm \ - multilib-minimal pax-utils python-single-r1 toolchain-funcs + multilib-minimal pax-utils prefix python-single-r1 toolchain-funcs MY_P=cfe-${PV/_/}.src EXTRA_P=clang-tools-extra-${PV/_/}.src @@ -68,6 +68,8 @@ CMAKE_BUILD_TYPE=RelWithDebInfo PATCHES=( # fix finding compiler-rt libs "${FILESDIR}"/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch + # add Prefix include paths for Darwin + "${FILESDIR}"/5.0.0/darwin_prefix-include-paths.patch ) # Multilib notes: @@ -110,6 +112,11 @@ src_unpack() { fi } +src_prepare() { + default + eprefixify lib/Frontend/InitHeaderSearch.cpp +} + multilib_src_configure() { local llvm_version=$(llvm-config --version) || die local clang_version=$(ver_cut 1-3 "${llvm_version}") diff --git a/sys-devel/clang/files/5.0.0/darwin_prefix-include-paths.patch b/sys-devel/clang/files/5.0.0/darwin_prefix-include-paths.patch new file mode 100644 index 000000000000..7744b942d0e5 --- /dev/null +++ b/sys-devel/clang/files/5.0.0/darwin_prefix-include-paths.patch @@ -0,0 +1,18 @@ +--- a/lib/Frontend/InitHeaderSearch.cpp ++++ b/lib/Frontend/InitHeaderSearch.cpp +@@ -233,6 +233,7 @@ + case llvm::Triple::Bitrig: + break; + default: ++ AddPath("@GENTOO_PORTAGE_EPREFIX@/usr/include", System, false); + // FIXME: temporary hack: hard-coded paths. + AddPath("/usr/local/include", System, false); + break; +@@ -505,6 +506,7 @@ + // Add the default framework include paths on Darwin. + if (HSOpts.UseStandardSystemIncludes) { + if (triple.isOSDarwin()) { ++ AddPath("@GENTOO_PORTAGE_EPREFIX@/Frameworks", System, true); + AddPath("/System/Library/Frameworks", System, true); + AddPath("/Library/Frameworks", System, true); + } -- 2.26.2