commit:     7302c17e5cbdda9aa10fa35f36554426b0a1b591
Author:     Mark Wright <gienah <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 24 07:15:34 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct  3 00:34:28 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7302c17e

media-gfx/freecad: Unbundle pycxx, avoid qt conflict

Patch (by me) to avoid https://github.com/pybind/pybind11/issues/5788

See-also: https://github.com/pybind/pybind11/issues/5788
Signed-off-by: Mark Wright <gienah <AT> gentoo.org>
Part-of: https://github.com/gentoo/gentoo/pull/43984
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...nd11-latent-slots-macro-conflicts-with-Qt.patch | 39 ++++++++++++++++++++++
 media-gfx/freecad/freecad-1.0.2.ebuild             |  8 +++++
 media-gfx/freecad/freecad-9999.ebuild              |  7 ++++
 3 files changed, 54 insertions(+)

diff --git 
a/media-gfx/freecad/files/freecad-1.0.2-pybind11-latent-slots-macro-conflicts-with-Qt.patch
 
b/media-gfx/freecad/files/freecad-1.0.2-pybind11-latent-slots-macro-conflicts-with-Qt.patch
new file mode 100644
index 000000000000..96e46cea35e2
--- /dev/null
+++ 
b/media-gfx/freecad/files/freecad-1.0.2-pybind11-latent-slots-macro-conflicts-with-Qt.patch
@@ -0,0 +1,39 @@
+From 9e10e873affcadbad27b0b71a7a4bb9bb7644ba4 Mon Sep 17 00:00:00 2001
+From: Mark Wright <[email protected]>
+Date: Mon, 14 Jul 2025 15:18:26 +0200
+Subject: [PATCH] avoid latent slots macro conflicts with Qt project
+
+See-also: https://github.com/pybind/pybind11/issues/5788
+Signed-off-by: Mark Wright <[email protected]>
+
+--- a/src/Mod/MeshPart/App/MeshFlatteningPy.cpp        2025-08-06 
06:19:07.000000000 +1000
++++ b/src/Mod/MeshPart/App/MeshFlatteningPy.cpp        2025-08-22 
13:04:15.420426450 +1000
+@@ -35,13 +35,6 @@
+ # include <TopoDS_Face.hxx>
+ #endif
+ 
+-// necessary for the feature despite not all are necessary for compilation
+-#include <pybind11/eigen.h>
+-#include <pybind11/numpy.h>
+-#include <pybind11/operators.h>
+-#include <pybind11/pybind11.h>
+-#include <pybind11/stl.h>
+-
+ #include <Mod/Part/App/TopoShapeFacePy.h>
+ #include <Mod/Part/App/TopoShapeEdgePy.h>
+ 
+@@ -49,6 +42,14 @@
+ #include "MeshFlatteningLscmRelax.h"
+ #include "MeshFlatteningNurbs.h"
+ 
++// necessary for the feature despite not all are necessary for compilation
++// https://github.com/pybind/pybind11/issues/5788 fixed in 3.0.1
++#undef slots
++#include <pybind11/eigen.h>
++#include <pybind11/numpy.h>
++#include <pybind11/operators.h>
++#include <pybind11/pybind11.h>
++#include <pybind11/stl.h>
+ 
+ namespace py = pybind11;
+ 

diff --git a/media-gfx/freecad/freecad-1.0.2.ebuild 
b/media-gfx/freecad/freecad-1.0.2.ebuild
index a3f8aae46261..714a8404cc18 100644
--- a/media-gfx/freecad/freecad-1.0.2.ebuild
+++ b/media-gfx/freecad/freecad-1.0.2.ebuild
@@ -75,6 +75,7 @@ RDEPEND="
        $(python_gen_cond_dep '
                dev-python/numpy[${PYTHON_USEDEP}]
                dev-python/pybind11[${PYTHON_USEDEP}]
+               dev-python/pycxx[${PYTHON_USEDEP}]
                dev-python/pyyaml[${PYTHON_USEDEP}]
        ')
        assembly? ( sci-libs/ondselsolver )
@@ -138,6 +139,7 @@ BDEPEND="
 PATCHES=(
        "${FILESDIR}"/${PN}-1.0.0-r1-Gentoo-specific-don-t-check-vcs.patch
        
"${FILESDIR}"/${PN}-1.0.1-tests-src-Qt-only-build-test-for-BUILD_GUI-ON.patch
+       
"${FILESDIR}/${PN}-1.0.2-pybind11-latent-slots-macro-conflicts-with-Qt.patch" # 
fixed in pybind-3.0.1
        "${DISTDIR}/${PN}-20710.patch" # DESTDIR in env
        "${DISTDIR}/${PN}-21433.patch" # FindHDF5 fails to find HDF5 after a 
failing pkg_search_module
 )
@@ -266,6 +268,9 @@ src_prepare() {
        # d9e731ca94abc14808ebeed208617116f6d5ea4a
        sed -e 's#pcl/point_traits.h#pcl/type_traits.h#g' -i 
src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp || die
 
+       # removed bundled pycxx
+       rm -rf src/CXX
+
        cmake_src_prepare
 }
 
@@ -289,6 +294,9 @@ src_configure() {
                -DCMAKE_POLICY_DEFAULT_CMP0175="OLD" # add_custom_command
                -DCMAKE_POLICY_DEFAULT_CMP0153="OLD" # exec_program
 
+               
-DPYCXX_INCLUDE_DIR="${EPREFIX}/usr/include/${PYTHON_SINGLE_TARGET/_/.}"
+               
-DPYCXX_SOURCE_DIR="${EPREFIX}/usr/share/${PYTHON_SINGLE_TARGET/_/.}/CXX"
+
                -DBUILD_DESIGNER_PLUGIN=$(usex designer)
                -DBUILD_FORCE_DIRECTORY=ON                              # force 
building in a dedicated directory
                -DBUILD_GUI=$(usex gui)

diff --git a/media-gfx/freecad/freecad-9999.ebuild 
b/media-gfx/freecad/freecad-9999.ebuild
index 38922248e20b..8c3377ce97c9 100644
--- a/media-gfx/freecad/freecad-9999.ebuild
+++ b/media-gfx/freecad/freecad-9999.ebuild
@@ -73,6 +73,7 @@ RDEPEND="
        $(python_gen_cond_dep '
                dev-python/numpy[${PYTHON_USEDEP}]
                dev-python/pybind11[${PYTHON_USEDEP}]
+               dev-python/pycxx[${PYTHON_USEDEP}]
                dev-python/pyyaml[${PYTHON_USEDEP}]
        ')
        assembly? ( sci-libs/ondselsolver )
@@ -268,6 +269,9 @@ src_prepare() {
        sed -e 's/vtkVersion.GetVTKMajorVersion() > 
9/vtkVersion.GetVTKMajorVersion() >= 9/g' \
                -i src/Mod/Fem/femguiutils/data_extraction.py || die
 
+       # removed bundled pycxx
+       rm -rf src/CXX
+
        cmake_src_prepare
 }
 
@@ -291,6 +295,9 @@ src_configure() {
                -DCMAKE_POLICY_DEFAULT_CMP0175="OLD" # add_custom_command
                -DCMAKE_POLICY_DEFAULT_CMP0153="OLD" # exec_program
 
+               
-DPYCXX_INCLUDE_DIR="${EPREFIX}/usr/include/${PYTHON_SINGLE_TARGET/_/.}"
+               
-DPYCXX_SOURCE_DIR="${EPREFIX}/usr/share/${PYTHON_SINGLE_TARGET/_/.}/CXX"
+
                -DBUILD_DESIGNER_PLUGIN=$(usex designer)
                -DBUILD_FORCE_DIRECTORY=ON                              # force 
building in a dedicated directory
                -DBUILD_GUI=$(usex gui)

Reply via email to