Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/freecad/
Date: Wed, 31 Aug 2022 04:57:34
Message-Id: 1661921847.bd52133a3c1179c09c17861aabc26149be90c275.juippis@gentoo
1 commit: bd52133a3c1179c09c17861aabc26149be90c275
2 Author: Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net>
3 AuthorDate: Wed Aug 10 07:31:56 2022 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 31 04:57:27 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd52133a
7
8 media-gfx/freecad: add 0.20.1
9
10 Closes: https://bugs.gentoo.org/865791
11 Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
12 Closes: https://github.com/gentoo/gentoo/pull/26924
13 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
14
15 media-gfx/freecad/Manifest | 1 +
16 media-gfx/freecad/freecad-0.20.1.ebuild | 303 ++++++++++++++++++++++++++++++++
17 2 files changed, 304 insertions(+)
18
19 diff --git a/media-gfx/freecad/Manifest b/media-gfx/freecad/Manifest
20 index 8fd5b5d028a5..42213fb79589 100644
21 --- a/media-gfx/freecad/Manifest
22 +++ b/media-gfx/freecad/Manifest
23 @@ -1,3 +1,4 @@
24 DIST freecad-0.19.2-0005-Make-smesh-compile-with-vtk9.patch.xz 5368 BLAKE2B 69bafefd049effe3c31719bb2c23d32e8ba7ad58235c58ac8279ba6c036feaf1b97d5751cf2d68896e7489803103b2d0f92f76e61b3ccc97ef05a95b337ca5c2 SHA512 66585cc13fb3b0b026cf9dbd761c8ba1c1fe4d4f7db2e144ddd97706e02ccd78f4a43ac7cd93ddcae6e73933bf41d4cbd4d94bcdff8804b81378a6d946c7b070
25 DIST freecad-0.19.4.tar.gz 296990652 BLAKE2B 6b252198616f7731144d000307a7f186eb2b24e07b85e008d0aae0f60a732fef5598c06c5c66b70fa44114f05afbc7d81b15c71bbb147bc2e458ea90cc81ee45 SHA512 58e5e6bb4ed40ce7f3a0b653cdb0371208189b9ca266f1c29a8f9077c4e56861b3925f695718fba34781254220f8a8919a2e2a501d43573b2c733f8b21c12c1f
26 +DIST freecad-0.20.1.tar.gz 75545072 BLAKE2B be2d2970b80523b34f7400a2762f997b815a5ae90dcb6cee6e560316712ebe3ab8a64053bd73e9f50548ff076920af0304a6780c94c4f3708d30b82bbee3b5d9 SHA512 ab4cfab4008300b8273769b9395602261c88c19f0893dabe6498a2eac020f1fe3fbf7284928144f1d4147d8627a47d83a40a1777a298673da2e24d956006d827
27 DIST freecad-0.20.tar.gz 75452957 BLAKE2B 600baf30541dabb7cf5df22a2d0fef0972d1b9cbf7c8425b9e2fadae54a0b0a1b75bb252fa18ecbf68fa5649ce459a88c71d69e000899e4b46d5c59fe956fcd1 SHA512 b1d91efa873f180bf635f6006d6c4b7a33b64b630955c639fe923bb340ce8104474688e05eea151d1ac1557388947ae81618cfc8a578f14706aa07b5cdc45cda
28
29 diff --git a/media-gfx/freecad/freecad-0.20.1.ebuild b/media-gfx/freecad/freecad-0.20.1.ebuild
30 new file mode 100644
31 index 000000000000..89036988794b
32 --- /dev/null
33 +++ b/media-gfx/freecad/freecad-0.20.1.ebuild
34 @@ -0,0 +1,303 @@
35 +# Copyright 1999-2022 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=8
39 +
40 +PYTHON_COMPAT=( python3_{8..10} )
41 +
42 +inherit check-reqs cmake optfeature python-single-r1 xdg
43 +
44 +DESCRIPTION="QT based Computer Aided Design application"
45 +HOMEPAGE="https://www.freecad.org/ https://github.com/FreeCAD/FreeCAD"
46 +
47 +MY_PN=FreeCAD
48 +
49 +if [[ ${PV} = *9999 ]]; then
50 + inherit git-r3
51 + EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git"
52 + S="${WORKDIR}/freecad-${PV}"
53 +else
54 + SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
55 + KEYWORDS="~amd64"
56 + S="${WORKDIR}/FreeCAD-${PV}"
57 +fi
58 +
59 +# code is licensed LGPL-2
60 +# examples are licensed CC-BY-SA (without note of specific version)
61 +LICENSE="LGPL-2 CC-BY-SA-4.0"
62 +SLOT="0"
63 +IUSE="debug designer headless test"
64 +
65 +FREECAD_EXPERIMENTAL_MODULES="cloud pcl"
66 +FREECAD_STABLE_MODULES="addonmgr fem idf image inspection material
67 + openscad part-design path points raytracing robot show surface
68 + techdraw tux"
69 +
70 +for module in ${FREECAD_STABLE_MODULES}; do
71 + IUSE="${IUSE} +${module}"
72 +done
73 +for module in ${FREECAD_EXPERIMENTAL_MODULES}; do
74 + IUSE="${IUSE} ${module}"
75 +done
76 +unset module
77 +
78 +RESTRICT="!test? ( test )"
79 +
80 +RDEPEND="
81 + ${PYTHON_DEPS}
82 + dev-libs/OpenNI2[opengl(+)]
83 + dev-libs/libspnav[X]
84 + dev-libs/xerces-c[icu]
85 + dev-qt/designer:5
86 + dev-qt/qtconcurrent:5
87 + dev-qt/qtcore:5
88 + dev-qt/qtgui:5
89 + dev-qt/qtnetwork:5
90 + dev-qt/qtopengl:5
91 + dev-qt/qtprintsupport:5
92 + dev-qt/qtsvg:5
93 + dev-qt/qtwebengine:5[widgets]
94 + dev-qt/qtwidgets:5
95 + dev-qt/qtx11extras:5
96 + dev-qt/qtxml:5
97 + >=media-libs/coin-4.0.0
98 + media-libs/freetype
99 + media-libs/qhull:=
100 + sci-libs/flann[openmp]
101 + sci-libs/hdf5:=[fortran,zlib]
102 + >=sci-libs/med-4.0.0-r1[python,${PYTHON_SINGLE_USEDEP}]
103 + sci-libs/opencascade:=[json,vtk]
104 + sci-libs/orocos_kdl:=
105 + sys-libs/zlib
106 + virtual/glu
107 + virtual/libusb:1
108 + virtual/opengl
109 + cloud? (
110 + dev-libs/openssl:=
111 + net-misc/curl
112 + )
113 + fem? ( sci-libs/vtk:=[boost(+),python,qt5,rendering,${PYTHON_SINGLE_USEDEP}] )
114 + openscad? ( media-gfx/openscad )
115 + pcl? ( >=sci-libs/pcl-1.8.1:=[opengl,openni2,qt5,vtk] )
116 + $(python_gen_cond_dep '
117 + dev-libs/boost:=[python,threads(+),${PYTHON_USEDEP}]
118 + dev-python/matplotlib[${PYTHON_USEDEP}]
119 + dev-python/numpy[${PYTHON_USEDEP}]
120 + >=dev-python/pivy-0.6.5[${PYTHON_USEDEP}]
121 + dev-python/pybind11[${PYTHON_USEDEP}]
122 + dev-python/pyside2[gui,svg,webchannel,webengine,${PYTHON_USEDEP}]
123 + dev-python/shiboken2[${PYTHON_USEDEP}]
124 + addonmgr? ( dev-python/GitPython[${PYTHON_USEDEP}] )
125 + fem? ( dev-python/ply[${PYTHON_USEDEP}] )
126 + ')
127 +"
128 +DEPEND="
129 + ${RDEPEND}
130 + >=dev-cpp/eigen-3.3.1:3
131 +"
132 +BDEPEND="
133 + app-text/dos2unix
134 + dev-lang/swig
135 +"
136 +
137 +# To get required dependencies:
138 +# 'grep REQUIRES_MODS cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake'
139 +# We set the following requirements by default:
140 +# arch, draft, drawing, import, mesh, part, qt5, sketcher, spreadsheet, start, web.
141 +#
142 +# Additionally, we auto-enable mesh_part, flat_mesh and smesh
143 +# Fem actually needs smesh, but as long as we don't have a smesh package, we enable
144 +# smesh through the mesh USE flag. Note however, the fem<-smesh dependency isn't
145 +# reflected by the REQUIRES_MODS macro, but at
146 +# cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake:187.
147 +#
148 +# The increase in auto-enabled workbenches is due to their need in parts of the
149 +# test suite when compiled with a minimal set of USE flags.
150 +REQUIRED_USE="
151 + ${PYTHON_REQUIRED_USE}
152 + inspection? ( points )
153 + path? ( robot )
154 +"
155 +
156 +PATCHES=(
157 + "${FILESDIR}"/${PN}-0.19.4-Gentoo-specific-don-t-check-vcs.patch
158 + "${FILESDIR}"/${PN}-0.19.1-0001-Gentoo-specific-Remove-ccache-usage.patch
159 +)
160 +
161 +DOCS=( CODE_OF_CONDUCT.md ChangeLog.txt README.md )
162 +
163 +CHECKREQS_DISK_BUILD="2G"
164 +
165 +pkg_setup() {
166 + check-reqs_pkg_setup
167 + python-single-r1_pkg_setup
168 + [[ -z ${CASROOT} ]] && die "\${CASROOT} not set, please run eselect opencascade"
169 +}
170 +
171 +src_prepare() {
172 + # Fix desktop file
173 + sed -e 's/Exec=FreeCAD/Exec=freecad/' -i src/XDGData/org.freecadweb.FreeCAD.desktop || die
174 +
175 + find "${S}" -type f -exec dos2unix -q {} \; || die "failed to convert to unix line endings"
176 +
177 + cmake_src_prepare
178 +}
179 +
180 +src_configure() {
181 + local mycmakeargs=(
182 + -DBUILD_ADDONMGR=$(usex addonmgr)
183 + -DBUILD_ARCH=ON
184 + -DBUILD_ASSEMBLY=OFF # deprecated
185 + -DBUILD_CLOUD=$(usex cloud)
186 + -DBUILD_COMPLETE=OFF # deprecated
187 + -DBUILD_DRAFT=ON
188 + -DBUILD_DESIGNER_PLUGIN=$(usex designer)
189 + -DBUILD_DRAWING=ON
190 + -DBUILD_ENABLE_CXX_STD:STRING="C++17" # needed for >=boost-1.77.0
191 + -DBUILD_FEM=$(usex fem)
192 + -DBUILD_FEM_NETGEN=OFF
193 + -DBUILD_FLAT_MESH=ON
194 + -DBUILD_FORCE_DIRECTORY=ON # force building in a dedicated directory
195 + -DBUILD_FREETYPE=ON # automagic dep
196 + -DBUILD_GUI=$(usex !headless)
197 + -DBUILD_IDF=$(usex idf)
198 + -DBUILD_IMAGE=$(usex image)
199 + -DBUILD_IMPORT=ON # import module for various file formats
200 + -DBUILD_INSPECTION=$(usex inspection)
201 + -DBUILD_JTREADER=OFF # code has been removed upstream, but option is still there
202 + -DBUILD_MATERIAL=$(usex material)
203 + -DBUILD_MESH=ON
204 + -DBUILD_MESH_PART=ON
205 + -DBUILD_OPENSCAD=$(usex openscad)
206 + -DBUILD_PART=ON
207 + -DBUILD_PART_DESIGN=$(usex part-design)
208 + -DBUILD_PATH=$(usex path)
209 + -DBUILD_POINTS=$(usex points)
210 + -DBUILD_QT5=ON # OFF means to use Qt4
211 + -DBUILD_RAYTRACING=$(usex raytracing)
212 + -DBUILD_REVERSEENGINEERING=OFF # currently only an empty sandbox
213 + -DBUILD_ROBOT=$(usex robot)
214 + -DBUILD_SHOW=$(usex show)
215 + -DBUILD_SKETCHER=ON # needed by draft workspace
216 + -DBUILD_SMESH=ON
217 + -DBUILD_SPREADSHEET=ON
218 + -DBUILD_START=ON
219 + -DBUILD_SURFACE=$(usex surface)
220 + -DBUILD_TECHDRAW=$(usex techdraw)
221 + -DBUILD_TEST=ON # always build test workbench for run-time testing
222 + -DBUILD_TUX=$(usex tux)
223 + -DBUILD_VR=OFF
224 + -DBUILD_WEB=ON # needed by start workspace
225 + -DBUILD_WITH_CONDA=OFF
226 +
227 + -DCMAKE_INSTALL_DATADIR=/usr/share/${PN}/data
228 + -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF}
229 + -DCMAKE_INSTALL_INCLUDEDIR=/usr/include/${PN}
230 + -DCMAKE_INSTALL_PREFIX=/usr/$(get_libdir)/${PN}
231 +
232 + -DFREECAD_BUILD_DEBIAN=OFF
233 +
234 + -DFREECAD_USE_EXTERNAL_KDL=ON
235 + -DFREECAD_USE_EXTERNAL_SMESH=OFF # no package in Gentoo
236 + -DFREECAD_USE_EXTERNAL_ZIPIOS=OFF # doesn't work yet, also no package in Gentoo tree
237 + -DFREECAD_USE_FREETYPE=ON
238 + -DFREECAD_USE_OCC_VARIANT:STRING="Official Version"
239 + -DFREECAD_USE_PCL=$(usex pcl)
240 + -DFREECAD_USE_PYBIND11=ON
241 + -DFREECAD_USE_QT_FILEDIALOG=ON
242 + -DFREECAD_USE_QTWEBMODULE:STRING="Qt WebEngine"
243 +
244 + # install python modules to site-packages' dir. True only for the main package,
245 + # sub-packages will still be installed inside /usr/lib64/freecad
246 + -DINSTALL_TO_SITEPACKAGES=ON
247 +
248 + # Use the version of shiboken2 that matches the selected python version
249 + -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}"
250 + -DPython3_EXECUTABLE=${PYTHON}
251 + )
252 +
253 + if use debug; then
254 + # BUILD_SANDBOX currently broken, see
255 + # https://forum.freecadweb.org/viewtopic.php?f=4&t=36071&start=30#p504595
256 + mycmakeargs+=(
257 + -DBUILD_SANDBOX=OFF
258 + -DBUILD_TEMPLATE=ON
259 + )
260 + else
261 + mycmakeargs+=(
262 + -DBUILD_SANDBOX=OFF
263 + -DBUILD_TEMPLATE=OFF
264 + )
265 + fi
266 +
267 + cmake_src_configure
268 +}
269 +
270 +# We use the FreeCADCmd binary instead of the FreeCAD binary here
271 +# for two reasons:
272 +# 1. It works out of the box with USE=headless as well, not needing a guard
273 +# 2. We don't need virtualx.eclass and it's dependencies
274 +# The exported environment variables are needed, so freecad does know
275 +# where to save it's temporary files, and where to look and write it's
276 +# configuration. Without those, there are sandbox violation, when it
277 +# tries to create /var/lib/portage/home/.FreeCAD directory.
278 +src_test() {
279 + pushd "${BUILD_DIR}" > /dev/null || die
280 + export FREECAD_USER_HOME="${HOME}"
281 + export FREECAD_USER_DATA="${T}"
282 + export FREECAD_USER_TEMP="${T}"
283 + nonfatal ./bin/FreeCADCmd --run-test 0
284 + popd > /dev/null || die
285 +}
286 +
287 +src_install() {
288 + cmake_src_install
289 +
290 + dobin src/Tools/freecad-thumbnailer
291 +
292 + if ! use headless; then
293 + dosym -r /usr/$(get_libdir)/${PN}/bin/FreeCAD /usr/bin/freecad
294 + mv "${ED}"/usr/$(get_libdir)/${PN}/share/* "${ED}"/usr/share || die "failed to move shared resources"
295 + fi
296 + dosym -r /usr/$(get_libdir)/${PN}/bin/FreeCADCmd /usr/bin/freecadcmd
297 +
298 + python_optimize "${ED}"/usr/share/${PN}/data/Mod/Start/StartPage "${ED}"/usr/$(get_libdir)/${PN}{/Ext,/Mod}/
299 + # compile main package in python site-packages as well
300 + python_optimize
301 +}
302 +
303 +pkg_postinst() {
304 + xdg_pkg_postinst
305 +
306 + einfo "You can load a lot of additional workbenches using the integrated"
307 + einfo "AddonManager."
308 +
309 + # ToDo: check opencv, pysolar (::science), elmerfem (::science)
310 + # ifc++, ifcopenshell, netgen, z88 (no pkgs), calculix-ccx (::waebbl)
311 + einfo "There are a lot of additional tools, for which FreeCAD has builtin"
312 + einfo "support. Some of them are available in Gentoo. Take a look at"
313 + einfo "https://wiki.freecadweb.org/Installing#External_software_supported_by_FreeCAD"
314 + optfeature_header "Computational utilities"
315 + optfeature "BLAS library" sci-libs/openblas
316 + optfeature "Statistical computation with Python" dev-python/pandas
317 + optfeature "Use scientific computation with Python" dev-python/scipy
318 + optfeature "Use symbolic math with Python" dev-python/sympy
319 + optfeature_header "Imaging, Plotting and Rendering utilities"
320 + optfeature "Dependency graphs" media-gfx/graphviz
321 + optfeature "PBR Rendering" media-gfx/povray
322 + optfeature_header "Import / Export"
323 + optfeature "Interact with git repositories" dev-python/GitPython
324 + optfeature "Work with COLLADA documents" dev-python/pycollada
325 + optfeature "YAML importer and emitter" dev-python/pyyaml
326 + optfeature "Importing and exporting 2D AutoCAD DWG files" media-gfx/libredwg
327 + optfeature "Importing and exporting geospatial data formats" sci-libs/gdal
328 + optfeature "Working with projection data" sci-libs/proj
329 + optfeature_header "Meshing and FEM"
330 + optfeature "FEM mesh generator" sci-libs/gmsh
331 + optfeature "Triangulating meshes" sci-libs/gts
332 + optfeature "Visualization" sci-visualization/paraview
333 +}
334 +
335 +pkg_postrm() {
336 + xdg_pkg_postrm
337 +}