1 |
commit: 7b5a3b73f36cafd3274ad495028bfae3c573d049 |
2 |
Author: Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net> |
3 |
AuthorDate: Sun Jun 20 12:09:03 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jun 21 22:25:56 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b5a3b73 |
7 |
|
8 |
media-gfx/freecad: update dependencies |
9 |
|
10 |
support >=sci-libs/opencascade-7.5.2 |
11 |
support >=sci-libs/vtk-9 |
12 |
|
13 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
14 |
Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net> |
15 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
16 |
|
17 |
media-gfx/freecad/Manifest | 1 + |
18 |
...6-add-boost-serialization-to-find_package.patch | 53 ++++ |
19 |
...-fix-build-failure-with-opencascade-7.5.2.patch | 30 ++ |
20 |
media-gfx/freecad/freecad-0.19.2-r2.ebuild | 339 +++++++++++++++++++++ |
21 |
4 files changed, 423 insertions(+) |
22 |
|
23 |
diff --git a/media-gfx/freecad/Manifest b/media-gfx/freecad/Manifest |
24 |
index 486f8202d98..e67bfab4a78 100644 |
25 |
--- a/media-gfx/freecad/Manifest |
26 |
+++ b/media-gfx/freecad/Manifest |
27 |
@@ -1,2 +1,3 @@ |
28 |
DIST freecad-0.19.1.tar.gz 296983463 BLAKE2B de6592474c34c5643ba7f63d6223bf7b2fcee87ebf226727e242ff3f56f363562dd0bae8cb6b3203d978d998b70985777ca93b938c0fc01822e8927cd79f6118 SHA512 5134fba99448c509f0761d62b07f1bbd3183108761f41178b38f24d5ba26558608d7d7b00009d03ba097a50cc6fe047bbd57872b32a1d55b3526d18c19ae6393 |
29 |
+DIST freecad-0.19.2-0005-Make-smesh-compile-with-vtk9.patch.xz 5368 BLAKE2B 69bafefd049effe3c31719bb2c23d32e8ba7ad58235c58ac8279ba6c036feaf1b97d5751cf2d68896e7489803103b2d0f92f76e61b3ccc97ef05a95b337ca5c2 SHA512 66585cc13fb3b0b026cf9dbd761c8ba1c1fe4d4f7db2e144ddd97706e02ccd78f4a43ac7cd93ddcae6e73933bf41d4cbd4d94bcdff8804b81378a6d946c7b070 |
30 |
DIST freecad-0.19.2.tar.gz 296987961 BLAKE2B 3c21359c71f7ac5a49cc4b4be437dfce02f2af73dfc526a3955547718ee41c461fc787d029a9a77374d58516d7c56fec6982fe6d38ab17fbc30c0a94929136bf SHA512 420f00e696725cbd31c936c47b6ac226d866a17c7b7683ad381b8dd5edaffc7dfb1a3c4238c08e8b4fd34ef0c08d7c244cb7797012e596df1ce0a4f6e3be6b72 |
31 |
|
32 |
diff --git a/media-gfx/freecad/files/freecad-0.19.2-0006-add-boost-serialization-to-find_package.patch b/media-gfx/freecad/files/freecad-0.19.2-0006-add-boost-serialization-to-find_package.patch |
33 |
new file mode 100644 |
34 |
index 00000000000..f9120e05191 |
35 |
--- /dev/null |
36 |
+++ b/media-gfx/freecad/files/freecad-0.19.2-0006-add-boost-serialization-to-find_package.patch |
37 |
@@ -0,0 +1,53 @@ |
38 |
+From fc4ae2ff217c67eae39947ed6b655b8afaa83859 Mon Sep 17 00:00:00 2001 |
39 |
+From: Bernd Waibel <waebbl-gentoo@××××××.net> |
40 |
+Date: Sun, 20 Jun 2021 15:38:45 +0200 |
41 |
+Subject: [PATCH] add boost::serialization to find_package |
42 |
+ |
43 |
+Swaps SetupBoost() after SetupSalomeSMESH() has been called. |
44 |
+SetupSalomeSMESH() looks for vtk, which searches for boost::serialization |
45 |
+overriding the default libraries detected by SetupBoost(). |
46 |
+ |
47 |
+Signed-off-by: Bernd Waibel <waebbl-gentoo@××××××.net> |
48 |
+--- |
49 |
+ CMakeLists.txt | 4 +++- |
50 |
+ cMake/FreeCAD_Helpers/SetupBoost.cmake | 2 +- |
51 |
+ 2 files changed, 4 insertions(+), 2 deletions(-) |
52 |
+ |
53 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
54 |
+index 5b17736..c241ebe 100644 |
55 |
+--- a/CMakeLists.txt |
56 |
++++ b/CMakeLists.txt |
57 |
+@@ -45,7 +45,6 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) |
58 |
+ SetupPython() |
59 |
+ SetupPCL() |
60 |
+ SetupPybind11() |
61 |
+- SetupBoost() |
62 |
+ SetupXercesC() |
63 |
+ find_package(ZLIB REQUIRED) |
64 |
+ find_package(PyCXX REQUIRED) |
65 |
+@@ -57,6 +56,9 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER) |
66 |
+ SetupOpenGL() |
67 |
+ endif(BUILD_GUI) |
68 |
+ SetupSalomeSMESH() |
69 |
++ # needs to be called after SMESH which pulls in VTK, which only add boost::serialization |
70 |
++ # overriding the values of SetupBoost() |
71 |
++ SetupBoost() |
72 |
+ if (BUILD_FEM_NETGEN) |
73 |
+ find_package(NETGEN) |
74 |
+ endif(BUILD_FEM_NETGEN) |
75 |
+diff --git a/cMake/FreeCAD_Helpers/SetupBoost.cmake b/cMake/FreeCAD_Helpers/SetupBoost.cmake |
76 |
+index 76c6d64..77c415b 100644 |
77 |
+--- a/cMake/FreeCAD_Helpers/SetupBoost.cmake |
78 |
++++ b/cMake/FreeCAD_Helpers/SetupBoost.cmake |
79 |
+@@ -3,7 +3,7 @@ macro(SetupBoost) |
80 |
+ |
81 |
+ set(_boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS}) |
82 |
+ |
83 |
+- set (BOOST_COMPONENTS filesystem program_options regex system thread) |
84 |
++ set (BOOST_COMPONENTS filesystem program_options regex serialization system thread) |
85 |
+ find_package(Boost ${BOOST_MIN_VERSION} |
86 |
+ COMPONENTS ${BOOST_COMPONENTS} REQUIRED) |
87 |
+ |
88 |
+-- |
89 |
+2.32.0 |
90 |
+ |
91 |
|
92 |
diff --git a/media-gfx/freecad/files/freecad-0.19.2-0007-fix-build-failure-with-opencascade-7.5.2.patch b/media-gfx/freecad/files/freecad-0.19.2-0007-fix-build-failure-with-opencascade-7.5.2.patch |
93 |
new file mode 100644 |
94 |
index 00000000000..46c69326129 |
95 |
--- /dev/null |
96 |
+++ b/media-gfx/freecad/files/freecad-0.19.2-0007-fix-build-failure-with-opencascade-7.5.2.patch |
97 |
@@ -0,0 +1,30 @@ |
98 |
+From bbbaf3e27d39767ba0b3de998b9d8d5fd42a681f Mon Sep 17 00:00:00 2001 |
99 |
+From: Bernd Waibel <waebbl-gentoo@××××××.net> |
100 |
+Date: Sun, 20 Jun 2021 16:24:04 +0200 |
101 |
+Subject: [PATCH] fix build failure with opencascade-7.5.2 |
102 |
+ |
103 |
+For patch, see |
104 |
+https://forum.freecadweb.org/viewtopic.php?f=4&t=58090&sid=07aca55f0513162234c40bc4bd6e4044#p503286 |
105 |
+ |
106 |
+Upstream issue at https://tracker.dev.opencascade.org/view.php?id=32328 |
107 |
+ |
108 |
+Signed-off-by: Bernd Waibel <waebbl-gentoo@××××××.net> |
109 |
+--- |
110 |
+ src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPyImp.cpp | 1 + |
111 |
+ 1 file changed, 1 insertion(+) |
112 |
+ |
113 |
+diff --git a/src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPyImp.cpp b/src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPyImp.cpp |
114 |
+index a268fce..3def142 100644 |
115 |
+--- a/src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPyImp.cpp |
116 |
++++ b/src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPyImp.cpp |
117 |
+@@ -27,6 +27,7 @@ |
118 |
+ # include <Standard_Failure.hxx> |
119 |
+ #endif |
120 |
+ |
121 |
++#include <TopoDS_Edge.hxx> |
122 |
+ #include "ShapeUpgrade/UnifySameDomainPy.h" |
123 |
+ #include "ShapeUpgrade/UnifySameDomainPy.cpp" |
124 |
+ #include "TopoShapePy.h" |
125 |
+-- |
126 |
+2.32.0 |
127 |
+ |
128 |
|
129 |
diff --git a/media-gfx/freecad/freecad-0.19.2-r2.ebuild b/media-gfx/freecad/freecad-0.19.2-r2.ebuild |
130 |
new file mode 100644 |
131 |
index 00000000000..8dd3ab78ae3 |
132 |
--- /dev/null |
133 |
+++ b/media-gfx/freecad/freecad-0.19.2-r2.ebuild |
134 |
@@ -0,0 +1,339 @@ |
135 |
+# Copyright 1999-2021 Gentoo Authors |
136 |
+# Distributed under the terms of the GNU General Public License v2 |
137 |
+ |
138 |
+EAPI=7 |
139 |
+ |
140 |
+PYTHON_COMPAT=( python3_{7,8,9} ) |
141 |
+ |
142 |
+inherit check-reqs cmake desktop eapi8-dosym optfeature python-single-r1 xdg |
143 |
+ |
144 |
+DESCRIPTION="QT based Computer Aided Design application" |
145 |
+HOMEPAGE="https://www.freecadweb.org/ https://github.com/FreeCAD/FreeCAD" |
146 |
+ |
147 |
+MY_PN=FreeCAD |
148 |
+ |
149 |
+if [[ ${PV} = *9999 ]]; then |
150 |
+ inherit git-r3 |
151 |
+ EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git" |
152 |
+ S="${WORKDIR}/freecad-${PV}" |
153 |
+else |
154 |
+ MY_PV=$(ver_cut 1-2) |
155 |
+ MY_PV=$(ver_rs 1 '_' ${MY_PV}) |
156 |
+ SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz |
157 |
+ https://raw.githubusercontent.com/waebbl/waebbl-gentoo/master/patches/${P}-0005-Make-smesh-compile-with-vtk9.patch.xz" |
158 |
+ KEYWORDS="~amd64" |
159 |
+ S="${WORKDIR}/FreeCAD-${PV}" |
160 |
+fi |
161 |
+ |
162 |
+# code is licensed LGPL-2 |
163 |
+# examples are licensed CC-BY-SA (without note of specific version) |
164 |
+LICENSE="LGPL-2 CC-BY-SA-4.0" |
165 |
+SLOT="0" |
166 |
+IUSE="debug headless pcl test" |
167 |
+RESTRICT="!test? ( test )" |
168 |
+ |
169 |
+FREECAD_EXPERIMENTAL_MODULES="cloud plot ship" |
170 |
+FREECAD_STABLE_MODULES="addonmgr fem idf image inspection material |
171 |
+ openscad part-design path points raytracing robot show surface |
172 |
+ techdraw tux" |
173 |
+ |
174 |
+for module in ${FREECAD_STABLE_MODULES}; do |
175 |
+ IUSE="${IUSE} +${module}" |
176 |
+done |
177 |
+for module in ${FREECAD_EXPERIMENTAL_MODULES}; do |
178 |
+ IUSE="${IUSE} ${module}" |
179 |
+done |
180 |
+unset module |
181 |
+ |
182 |
+RDEPEND=" |
183 |
+ ${PYTHON_DEPS} |
184 |
+ >=dev-cpp/eigen-3.3.1:3 |
185 |
+ dev-libs/OpenNI2[opengl(+)] |
186 |
+ dev-libs/libspnav[X] |
187 |
+ dev-libs/xerces-c[icu] |
188 |
+ dev-qt/designer:5 |
189 |
+ dev-qt/qtconcurrent:5 |
190 |
+ dev-qt/qtcore:5 |
191 |
+ dev-qt/qtgui:5 |
192 |
+ dev-qt/qtnetwork:5 |
193 |
+ dev-qt/qtopengl:5 |
194 |
+ dev-qt/qtprintsupport:5 |
195 |
+ dev-qt/qtsvg:5 |
196 |
+ dev-qt/qtwebengine:5[widgets] |
197 |
+ dev-qt/qtwidgets:5 |
198 |
+ dev-qt/qtx11extras:5 |
199 |
+ dev-qt/qtxml:5 |
200 |
+ >=media-libs/coin-4.0.0 |
201 |
+ media-libs/freetype |
202 |
+ media-libs/qhull:= |
203 |
+ sci-libs/flann[openmp] |
204 |
+ sci-libs/hdf5:=[fortran,zlib] |
205 |
+ >=sci-libs/med-4.0.0-r1[python,${PYTHON_SINGLE_USEDEP}] |
206 |
+ sci-libs/opencascade:=[vtk(+)] |
207 |
+ sci-libs/orocos_kdl:= |
208 |
+ sys-libs/zlib |
209 |
+ virtual/glu |
210 |
+ virtual/libusb:1 |
211 |
+ virtual/opengl |
212 |
+ cloud? ( |
213 |
+ dev-libs/openssl:= |
214 |
+ net-misc/curl |
215 |
+ ) |
216 |
+ fem? ( sci-libs/vtk[boost,python,qt5,rendering,${PYTHON_SINGLE_USEDEP}] ) |
217 |
+ openscad? ( media-gfx/openscad ) |
218 |
+ pcl? ( >=sci-libs/pcl-1.8.1:=[opengl,openni2(+),qt5(+),vtk(+)] ) |
219 |
+ $(python_gen_cond_dep ' |
220 |
+ dev-libs/boost:=[python,threads(+),${PYTHON_MULTI_USEDEP}] |
221 |
+ dev-python/matplotlib[${PYTHON_MULTI_USEDEP}] |
222 |
+ dev-python/numpy[${PYTHON_MULTI_USEDEP}] |
223 |
+ >=dev-python/pivy-0.6.5[${PYTHON_MULTI_USEDEP}] |
224 |
+ dev-python/pybind11[${PYTHON_MULTI_USEDEP}] |
225 |
+ dev-python/pyside2[gui,svg,${PYTHON_MULTI_USEDEP}] |
226 |
+ dev-python/shiboken2[${PYTHON_MULTI_USEDEP}] |
227 |
+ addonmgr? ( dev-python/GitPython[${PYTHON_MULTI_USEDEP}] ) |
228 |
+ fem? ( dev-python/ply[${PYTHON_MULTI_USEDEP}] ) |
229 |
+ ') |
230 |
+" |
231 |
+DEPEND="${RDEPEND}" |
232 |
+BDEPEND="dev-lang/swig" |
233 |
+ |
234 |
+# To get required dependencies: |
235 |
+# 'grep REQUIRES_MODS cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake' |
236 |
+# We set the following requirements by default: |
237 |
+# arch, draft, drawing, import, mesh, part, qt5, sketcher, spreadsheet, start, web. |
238 |
+# |
239 |
+# Additionally, we auto-enable mesh_part, flat_mesh and smesh |
240 |
+# Fem actually needs smesh, but as long as we don't have a smesh package, we enable |
241 |
+# smesh through the mesh USE flag. Note however, the fem<-smesh dependency isn't |
242 |
+# reflected by the REQUIRES_MODS macro, but at |
243 |
+# cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake:187. |
244 |
+# |
245 |
+# The increase in auto-enabled workbenches is due to their need in parts of the |
246 |
+# test suite when compiled with a minimal set of USE flags. |
247 |
+REQUIRED_USE=" |
248 |
+ ${PYTHON_REQUIRED_USE} |
249 |
+ inspection? ( points ) |
250 |
+ path? ( robot ) |
251 |
+ ship? ( image plot ) |
252 |
+" |
253 |
+ |
254 |
+PATCHES=( |
255 |
+ "${FILESDIR}"/${PN}-0.19_pre20201231-0003-Gentoo-specific-don-t-check-vcs.patch |
256 |
+ "${FILESDIR}"/${PN}-0.19.1-0001-Gentoo-specific-Remove-ccache-usage.patch |
257 |
+ "${FILESDIR}"/${P}-0001-fix-failing-test-workbench-testcase.patch |
258 |
+ "${FILESDIR}"/${P}-0002-fix-femtest-failure-with-yaml-load.patch |
259 |
+ "${FILESDIR}"/${P}-0003-fix-test-when-built-without-GUI.patch |
260 |
+ "${WORKDIR}"/${P}-0005-Make-smesh-compile-with-vtk9.patch |
261 |
+ "${FILESDIR}"/${P}-0006-add-boost-serialization-to-find_package.patch |
262 |
+ "${FILESDIR}"/${P}-0007-fix-build-failure-with-opencascade-7.5.2.patch |
263 |
+) |
264 |
+ |
265 |
+DOCS=( CODE_OF_CONDUCT.md ChangeLog.txt README.md ) |
266 |
+ |
267 |
+CHECKREQS_DISK_BUILD="2G" |
268 |
+ |
269 |
+pkg_setup() { |
270 |
+ check-reqs_pkg_setup |
271 |
+ python-single-r1_pkg_setup |
272 |
+ [[ -z ${CASROOT} ]] && die "\${CASROOT} not set, plesae run eselect opencascade" |
273 |
+} |
274 |
+ |
275 |
+src_prepare() { |
276 |
+ # the upstream provided file doesn't find the coin doc tag file, |
277 |
+ # but cmake ships a working one, so we use this. |
278 |
+ rm "${S}/cMake/FindCoin3D.cmake" || die |
279 |
+ |
280 |
+ # Fix OpenCASCADE lookup |
281 |
+ local OCC_P=$(best_version sci-libs/opencascade[vtk]) |
282 |
+ OCC_P=${OCC_P#sci-libs/} |
283 |
+ local OCC_PV=${OCC_P#opencascade-} |
284 |
+ OCC_PV=$(ver_cut 1-2 ${OCC_PV}) |
285 |
+ # check for CASROOT needed to ensure occ-7.5 is eselected and profile resourced |
286 |
+ if [[ ${OCC_PV} = 7.5 && ${CASROOT} = "/usr" ]]; then |
287 |
+ sed -e 's|/usr/include/opencascade|'${CASROOT}'/include/'${OCC_P}'|' \ |
288 |
+ -e 's|/usr/lib|'${CASROOT}'/'$(get_libdir)'/'${OCC_P}' NO_DEFAULT_PATH|' \ |
289 |
+ -i cMake/FindOpenCasCade.cmake || die |
290 |
+ else |
291 |
+ sed -e 's|/usr/include/opencascade|${CASROOT}/include/opencascade|' \ |
292 |
+ -e 's|/usr/lib|${CASROOT}/'$(get_libdir)' NO_DEFAULT_PATH|' \ |
293 |
+ -i cMake/FindOpenCasCade.cmake || die |
294 |
+ fi |
295 |
+ |
296 |
+ # Fix desktop file |
297 |
+ sed -e 's/Exec=FreeCAD/Exec=freecad/' -i src/XDGData/org.freecadweb.FreeCAD.desktop || die |
298 |
+ |
299 |
+ cmake_src_prepare |
300 |
+} |
301 |
+ |
302 |
+src_configure() { |
303 |
+ local mycmakeargs=( |
304 |
+ -DBUILD_ADDONMGR=$(usex addonmgr) |
305 |
+ -DBUILD_ARCH=ON |
306 |
+ -DBUILD_ASSEMBLY=OFF # deprecated |
307 |
+ -DBUILD_CLOUD=$(usex cloud) |
308 |
+ -DBUILD_COMPLETE=OFF # deprecated |
309 |
+ -DBUILD_DRAFT=ON |
310 |
+ -DBUILD_DRAWING=ON |
311 |
+ -DBUILD_ENABLE_CXX_STD:STRING="C++14" # needed for >=boost-1.75.0 |
312 |
+ -DBUILD_FEM=$(usex fem) |
313 |
+ -DBUILD_FEM_NETGEN=OFF |
314 |
+ -DBUILD_FLAT_MESH=ON |
315 |
+ -DBUILD_FORCE_DIRECTORY=ON # force building in a dedicated directory |
316 |
+ -DBUILD_FREETYPE=ON # automagic dep |
317 |
+ -DBUILD_GUI=$(usex !headless) |
318 |
+ -DBUILD_IDF=$(usex idf) |
319 |
+ -DBUILD_IMAGE=$(usex image) |
320 |
+ -DBUILD_IMPORT=ON # import module for various file formats |
321 |
+ -DBUILD_INSPECTION=$(usex inspection) |
322 |
+ -DBUILD_JTREADER=OFF # code has been removed upstream, but option is still there |
323 |
+ -DBUILD_MATERIAL=$(usex material) |
324 |
+ -DBUILD_MESH=ON |
325 |
+ -DBUILD_MESH_PART=ON |
326 |
+ -DBUILD_OPENSCAD=$(usex openscad) |
327 |
+ -DBUILD_PART=ON |
328 |
+ -DBUILD_PART_DESIGN=$(usex part-design) |
329 |
+ -DBUILD_PATH=$(usex path) |
330 |
+ -DBUILD_PLOT=$(usex plot) # conflicts with possible external workbench |
331 |
+ -DBUILD_POINTS=$(usex points) |
332 |
+ -DBUILD_QT5=ON # OFF means to use Qt4 |
333 |
+ -DBUILD_RAYTRACING=$(usex raytracing) |
334 |
+ -DBUILD_REVERSEENGINEERING=OFF # currently only an empty sandbox |
335 |
+ -DBUILD_ROBOT=$(usex robot) |
336 |
+ -DBUILD_SHIP=$(usex ship) # conflicts with possible external workbench |
337 |
+ -DBUILD_SHOW=$(usex show) |
338 |
+ -DBUILD_SKETCHER=ON # needed by draft workspace |
339 |
+ -DBUILD_SMESH=ON |
340 |
+ -DBUILD_SPREADSHEET=ON |
341 |
+ -DBUILD_START=ON |
342 |
+ -DBUILD_SURFACE=$(usex surface) |
343 |
+ -DBUILD_TECHDRAW=$(usex techdraw) |
344 |
+ -DBUILD_TEST=ON # always build test workbench for run-time testing |
345 |
+ -DBUILD_TUX=$(usex tux) |
346 |
+ -DBUILD_VR=OFF |
347 |
+ -DBUILD_WEB=ON # needed by start workspace |
348 |
+ -DBUILD_WITH_CONDA=OFF |
349 |
+ |
350 |
+ -DCMAKE_INSTALL_DATADIR=/usr/share/${PN}/data |
351 |
+ -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF} |
352 |
+ -DCMAKE_INSTALL_INCLUDEDIR=/usr/include/${PN} |
353 |
+ -DCMAKE_INSTALL_PREFIX=/usr/$(get_libdir)/${PN} |
354 |
+ |
355 |
+ -DFREECAD_BUILD_DEBIAN=OFF |
356 |
+ |
357 |
+ -DFREECAD_USE_EXTERNAL_KDL=ON |
358 |
+ -DFREECAD_USE_EXTERNAL_SMESH=OFF # no package in Gentoo |
359 |
+ -DFREECAD_USE_EXTERNAL_ZIPIOS=OFF # doesn't work yet, also no package in Gentoo tree |
360 |
+ -DFREECAD_USE_FREETYPE=ON |
361 |
+ -DFREECAD_USE_OCC_VARIANT:STRING="Official Version" |
362 |
+ -DFREECAD_USE_PCL=$(usex pcl) |
363 |
+ -DFREECAD_USE_PYBIND11=ON |
364 |
+ -DFREECAD_USE_QT_FILEDIALOG=ON |
365 |
+ -DFREECAD_USE_QTWEBMODULE:STRING="Qt WebEngine" |
366 |
+ |
367 |
+ # Use the version of shiboken2 that matches the selected python version |
368 |
+ -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}" |
369 |
+ |
370 |
+ # install python modules to site-packages' dir. True only for the main package, |
371 |
+ # sub-packages will still be installed inside /usr/lib64/freecad |
372 |
+ -DINSTALL_TO_SITEPACKAGES=ON |
373 |
+ |
374 |
+ -DOCCT_CMAKE_FALLBACK=ON # don't use occt-config which isn't included in opencascade for Gentoo |
375 |
+ ) |
376 |
+ |
377 |
+ if has_version ">=sci-libs/opencascade-7.5"; then |
378 |
+ # bug https://bugs.gentoo.org/788274 |
379 |
+ local OCC_P=$(best_version sci-libs/opencascade[vtk]) |
380 |
+ OCC_P=${OCC_P#sci-libs/} |
381 |
+ OCC_P=${OCC_P%-r*} |
382 |
+ mycmakeargs+=( |
383 |
+ -DOCC_INCLUDE_DIR="${CASROOT}"/include/${OCC_P} |
384 |
+ -DOCC_LIBRARY_DIR="${CASROOT}"/$(get_libdir)/${OCC_P} |
385 |
+ ) |
386 |
+ else |
387 |
+ # <occ-7.5 uses different layout |
388 |
+ mycmakeargs+=( |
389 |
+ -DOCC_INCLUDE_DIR="${CASROOT}"/include/opencascade |
390 |
+ -DOCC_LIBRARY_DIR="${CASROOT}"/$(get_libdir) |
391 |
+ ) |
392 |
+ fi |
393 |
+ |
394 |
+ if use debug; then |
395 |
+ mycmakeargs+=( |
396 |
+ -DBUILD_SANDBOX=ON |
397 |
+ -DBUILD_TEMPLATE=ON |
398 |
+ ) |
399 |
+ else |
400 |
+ mycmakeargs+=( |
401 |
+ -DBUILD_SANDBOX=OFF |
402 |
+ -DBUILD_TEMPLATE=OFF |
403 |
+ ) |
404 |
+ fi |
405 |
+ |
406 |
+ cmake_src_configure |
407 |
+} |
408 |
+ |
409 |
+# We use the FreeCADCmd binary instead of the FreeCAD binary here |
410 |
+# for two reasons: |
411 |
+# 1. It works out of the box with USE=headless as well, not needing a guard |
412 |
+# 2. We don't need virtualx.eclass and it's dependencies |
413 |
+# The exported environment variables are needed, so freecad does know |
414 |
+# where to save it's temporary files, and where to look and write it's |
415 |
+# configuration. Without those, there are sandbox violation, when it |
416 |
+# tries to create /var/lib/portage/home/.FreeCAD directory. |
417 |
+src_test() { |
418 |
+ pushd "${BUILD_DIR}" > /dev/null || die |
419 |
+ export FREECAD_USER_HOME="${HOME}" |
420 |
+ export FREECAD_USER_DATA="${T}" |
421 |
+ export FREECAD_USER_TEMP="${T}" |
422 |
+ nonfatal ./bin/FreeCADCmd --run-test 0 |
423 |
+ popd > /dev/null || die |
424 |
+} |
425 |
+ |
426 |
+src_install() { |
427 |
+ cmake_src_install |
428 |
+ |
429 |
+ if ! use headless; then |
430 |
+ dosym8 -r /usr/$(get_libdir)/${PN}/bin/FreeCAD /usr/bin/freecad |
431 |
+ mv "${ED}"/usr/$(get_libdir)/freecad/share/* "${ED}"/usr/share || die "failed to move shared ressources" |
432 |
+ fi |
433 |
+ dosym8 -r /usr/$(get_libdir)/${PN}/bin/FreeCADCmd /usr/bin/freecadcmd |
434 |
+ |
435 |
+ python_optimize "${ED}"/usr/share/${PN}/data/Mod/Start/StartPage "${ED}"/usr/$(get_libdir)/${PN}{/Ext,/Mod}/ |
436 |
+ # compile main package in python site-packages as well |
437 |
+ python_optimize |
438 |
+ |
439 |
+ doenvd "${FILESDIR}/99${PN}" |
440 |
+} |
441 |
+ |
442 |
+pkg_postinst() { |
443 |
+ xdg_pkg_postinst |
444 |
+ |
445 |
+ if use plot; then |
446 |
+ einfo "Note: You are enabling the 'plot' USE flag." |
447 |
+ einfo "This conflicts with the plot workbench that can be loaded" |
448 |
+ einfo "via the addon manager! You can only install one of those." |
449 |
+ fi |
450 |
+ |
451 |
+ if use ship; then |
452 |
+ einfo "Note: You are enabling the 'ship' USE flag." |
453 |
+ einfo "This conflicts with the ship workbench that can be loaded" |
454 |
+ einfo "via the addon manager! You can only install one of those." |
455 |
+ fi |
456 |
+ |
457 |
+ einfo "You can load a lot of additional workbenches using the integrated" |
458 |
+ einfo "AddonManager." |
459 |
+ |
460 |
+ einfo "There are a lot of additional tools, for which FreeCAD has builtin" |
461 |
+ einfo "support. Some of them are available in Gentoo. Take a look at" |
462 |
+ einfo "https://wiki.freecadweb.org/Installing#External_software_supported_by_FreeCAD" |
463 |
+ optfeature "interact with git repositories" dev-python/GitPython |
464 |
+ optfeature "work with COLLADA documents" dev-python/pycollada |
465 |
+ optfeature "dependency graphs" media-gfx/graphviz |
466 |
+ optfeature "PBR Rendering" media-gfx/povray |
467 |
+ optfeature "FEM mesh generator" sci-libs/gmsh |
468 |
+ optfeature "importing and exporting 2D AutoCAD DWG files" media-gfx/libredwg |
469 |
+} |
470 |
+ |
471 |
+pkg_postrm() { |
472 |
+ xdg_pkg_postrm |
473 |
+} |