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