summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pybind11')
-rw-r--r--dev-python/pybind11/files/pybind11-2.10.4_macOS-GCC.patch23
-rw-r--r--dev-python/pybind11/pybind11-2.10.4.ebuild3
2 files changed, 25 insertions, 1 deletions
diff --git a/dev-python/pybind11/files/pybind11-2.10.4_macOS-GCC.patch b/dev-python/pybind11/files/pybind11-2.10.4_macOS-GCC.patch
new file mode 100644
index 000000000000..5bfa88348110
--- /dev/null
+++ b/dev-python/pybind11/files/pybind11-2.10.4_macOS-GCC.patch
@@ -0,0 +1,23 @@
+Break the toolchain assumption of LLVM on Prefix/macOS.
+
+At Prefix/macOS, the system compiler is GCC with libstdc++.
+
+This patch is only useful to Gentoo Prefix. We don't have plans to
+forward it upstream.
+
+Signed-off-by: Benda Xu <heroxbd@gentoo.org>
+
+Index: pybind11-2.10.4/pybind11/setup_helpers.py
+===================================================================
+--- pybind11-2.10.4.orig/pybind11/setup_helpers.py
++++ pybind11-2.10.4/pybind11/setup_helpers.py
+@@ -154,9 +154,6 @@ class Pybind11Extension(_Extension): #
+ c_cpp_flags = shlex.split(env_cflags) + shlex.split(env_cppflags)
+ if not any(opt.startswith("-g") for opt in c_cpp_flags):
+ cflags += ["-g0"]
+- if MACOS:
+- cflags += ["-stdlib=libc++"]
+- ldflags += ["-stdlib=libc++"]
+ self._add_cflags(cflags)
+ self._add_ldflags(ldflags)
+
diff --git a/dev-python/pybind11/pybind11-2.10.4.ebuild b/dev-python/pybind11/pybind11-2.10.4.ebuild
index ade4adbcd5e1..cea97d04299f 100644
--- a/dev-python/pybind11/pybind11-2.10.4.ebuild
+++ b/dev-python/pybind11/pybind11-2.10.4.ebuild
@@ -21,7 +21,7 @@ SRC_URI="
LICENSE="BSD"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ppc ppc64 ~riscv ~s390 sparc x86"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ppc ppc64 ~riscv ~s390 sparc x86 ~arm64-macos ~x64-macos"
RDEPEND="
dev-cpp/eigen:3
@@ -38,6 +38,7 @@ distutils_enable_tests pytest
python_prepare_all() {
export PYBIND11_USE_CMAKE=1
cmake_src_prepare
+ PATCHES=( "${FILESDIR}"/pybind11-2.10.4_macOS-GCC.patch )
distutils-r1_python_prepare_all
}