1 |
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=8
|
|
4 |
# TODO's
|
|
5 |
# package and unbundle manifold
|
|
6 |
# set up proper testing
|
|
7 |
# set up OFFLINE_DOCS and add doc USE flag
|
5 |
8 |
|
6 |
|
inherit elisp-common qmake-utils xdg
|
|
9 |
EAPI=8
|
7 |
10 |
|
8 |
|
SITEFILE="50${PN}-gentoo.el"
|
|
11 |
inherit cmake git-r3 optfeature xdg
|
9 |
12 |
|
10 |
13 |
DESCRIPTION="The Programmers Solid 3D CAD Modeller"
|
11 |
14 |
HOMEPAGE="https://www.openscad.org/"
|
12 |
|
SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.src.tar.gz -> ${P}.tar.gz"
|
|
15 |
SRC_URI=""
|
|
16 |
EGIT_REPO_URI="https://github.com/openscad/openscad.git"
|
13 |
17 |
|
14 |
|
LICENSE="GPL-2"
|
|
18 |
# Code is GPL-3+, MCAD library is LGPL-2.1
|
|
19 |
LICENSE="GPL-3+ LGPL-2.1"
|
15 |
20 |
SLOT="0"
|
16 |
|
KEYWORDS="amd64 ~arm64 ~x86"
|
17 |
|
IUSE="emacs"
|
18 |
|
# tests are not fully working and need cmake which isn't yet
|
19 |
|
# officially supported.
|
20 |
|
RESTRICT="test"
|
|
21 |
KEYWORDS=""
|
|
22 |
IUSE="cairo dbus egl experimental gamepad gui hidapi mimalloc spacenav"
|
|
23 |
RESTRICT="test" # 32 out 1300+ tests fail
|
|
24 |
|
|
25 |
REQUIRED_USE="
|
|
26 |
dbus? ( gui )
|
|
27 |
gamepad? ( gui )
|
|
28 |
spacenav? ( gui )
|
|
29 |
"
|
21 |
30 |
|
22 |
31 |
RDEPEND="
|
23 |
32 |
dev-cpp/eigen:3
|
24 |
33 |
dev-libs/boost:=
|
25 |
34 |
dev-libs/double-conversion:=
|
26 |
35 |
dev-libs/glib:2
|
27 |
|
dev-libs/gmp:0=
|
28 |
|
dev-libs/hidapi
|
29 |
|
dev-libs/libspnav
|
30 |
36 |
dev-libs/libxml2
|
31 |
37 |
dev-libs/libzip:=
|
32 |
|
dev-libs/mpfr:0=
|
33 |
|
dev-qt/qtconcurrent:5
|
34 |
|
dev-qt/qtcore:5
|
35 |
|
dev-qt/qtdbus:5
|
36 |
|
dev-qt/qtgui:5[-gles2-only]
|
37 |
|
dev-qt/qtmultimedia:5
|
38 |
|
dev-qt/qtnetwork:5
|
39 |
|
dev-qt/qtopengl:5
|
40 |
|
dev-qt/qtwidgets:5
|
41 |
38 |
media-gfx/opencsg:=
|
42 |
39 |
media-libs/fontconfig
|
43 |
40 |
media-libs/freetype
|
44 |
|
>=media-libs/glew-2.0.0:0=
|
|
41 |
media-libs/glew:0=
|
45 |
42 |
media-libs/harfbuzz:=
|
46 |
|
media-libs/lib3mf
|
|
43 |
media-libs/lib3mf:=
|
47 |
44 |
sci-mathematics/cgal:=
|
48 |
|
x11-libs/cairo
|
49 |
|
>=x11-libs/qscintilla-2.10.3:=
|
50 |
|
emacs? ( >=app-editors/emacs-23.1:* )
|
|
45 |
virtual/opengl
|
|
46 |
cairo? ( x11-libs/cairo )
|
|
47 |
gui? (
|
|
48 |
dev-qt/qtconcurrent:5
|
|
49 |
dev-qt/qtcore:5
|
|
50 |
dev-qt/qtgui:5[-gles2-only]
|
|
51 |
dev-qt/qtmultimedia:5
|
|
52 |
dev-qt/qtnetwork:5
|
|
53 |
dev-qt/qtopengl:5
|
|
54 |
dev-qt/qtsvg:5
|
|
55 |
dev-qt/qtwidgets:5
|
|
56 |
x11-libs/libX11
|
|
57 |
x11-libs/qscintilla:=
|
|
58 |
dbus? ( dev-qt/qtdbus:5 )
|
|
59 |
gamepad? ( dev-qt/qtgamepad:5 )
|
|
60 |
)
|
|
61 |
hidapi? ( dev-libs/hidapi )
|
|
62 |
mimalloc? ( dev-libs/mimalloc:= )
|
|
63 |
spacenav? ( dev-libs/libspnav )
|
51 |
64 |
"
|
52 |
65 |
DEPEND="${RDEPEND}"
|
53 |
66 |
BDEPEND="
|
... | ... | |
58 |
71 |
virtual/pkgconfig
|
59 |
72 |
"
|
60 |
73 |
|
61 |
|
PATCHES=(
|
62 |
|
"${FILESDIR}"/${P}-0001-Gentoo-specific-Disable-ccache-building.patch
|
63 |
|
"${FILESDIR}"/${P}-0002-fix-to-find-lib3mf-2.patch
|
64 |
|
"${FILESDIR}"/${P}-CVE-2022-0496-Out-of-bounds-memory-access-in-DXF-loa.patch
|
65 |
|
"${FILESDIR}"/${P}-CVE-2022-0497-Out-of-bounds-memory-access-in-comment.patch
|
66 |
|
"${FILESDIR}"/${P}-Fix-build-failure-with-generic_print_polyhedron-on-C.patch
|
67 |
|
"${FILESDIR}"/${P}-CGAL-build-fix-v5.4-renames-projection-traits-header.patch
|
68 |
|
"${FILESDIR}"/${P}-Fix-build-issue-with-overloaded-join.patch
|
69 |
|
"${FILESDIR}"/${P}-Remove-double-quoting-of-the-output-file-parameter-f.patch
|
|
74 |
DOCS=(
|
|
75 |
README.md
|
|
76 |
RELEASE_NOTES.md
|
|
77 |
doc/TODO.txt
|
|
78 |
doc/contributor_copyright.txt
|
|
79 |
doc/hacking.md
|
|
80 |
doc/testing.txt
|
|
81 |
doc/translation.txt
|
70 |
82 |
)
|
71 |
83 |
|
72 |
84 |
src_configure() {
|
73 |
|
if has ccache ${FEATURES}; then
|
74 |
|
eqmake5 "PREFIX = ${ESYSROOT}/usr" "CONFIG += ccache" "${PN}.pro"
|
75 |
|
else
|
76 |
|
eqmake5 "PREFIX = ${ESYSROOT}/usr" "${PN}.pro"
|
|
85 |
local mycmakeargs=(
|
|
86 |
-DCLANG_TIDY=OFF
|
|
87 |
-DENABLE_CAIRO=$(usex cairo)
|
|
88 |
-DENABLE_EGL=$(usex egl)
|
|
89 |
-DENABLE_HIDAPI=$(usex hidapi)
|
|
90 |
# needs python deps, unbundle first before enabling
|
|
91 |
-DENABLE_MANIFOLD=OFF
|
|
92 |
-DENABLE_SPNAV=$(usex spacenav)
|
|
93 |
-DENABLE_TESTS=OFF
|
|
94 |
-DEXPERIMENTAL=$(usex experimental)
|
|
95 |
-DHEADLESS=$(usex gui OFF ON)
|
|
96 |
-DOFFLINE_DOCS=OFF
|
|
97 |
-DUSE_CCACHE=OFF
|
|
98 |
-DUSE_MIMALLOC=$(usex mimalloc)
|
|
99 |
)
|
|
100 |
|
|
101 |
if use gui; then
|
|
102 |
mycmakeargs+=(
|
|
103 |
-DENABLE_GAMEPAD=$(usex gamepad)
|
|
104 |
-DENABLE_QTDBUS=$(usex dbus)
|
|
105 |
)
|
77 |
106 |
fi
|
78 |
|
}
|
79 |
|
|
80 |
|
src_compile() {
|
81 |
|
# We have random parallel build issues, bug #856430
|
82 |
|
emake -j1
|
83 |
107 |
|
84 |
|
if use emacs ; then
|
85 |
|
elisp-compile contrib/*.el
|
86 |
|
fi
|
|
108 |
cmake_src_configure
|
87 |
109 |
}
|
88 |
110 |
|
89 |
111 |
src_install() {
|
90 |
|
emake install INSTALL_ROOT="${D}"
|
91 |
|
|
92 |
|
if use emacs; then
|
93 |
|
elisp-site-file-install "${FILESDIR}/${SITEFILE}"
|
94 |
|
elisp-install ${PN} contrib/*.el contrib/*.elc
|
95 |
|
fi
|
|
112 |
DOCS+=( doc/*.pdf )
|
|
113 |
cmake_src_install
|
96 |
114 |
|
97 |
115 |
mv -i "${ED}"/usr/share/openscad/locale "${ED}"/usr/share || die "failed to move locales"
|
98 |
|
ln -sf ../locale "${ED}"/usr/share/openscad/locale || die
|
99 |
|
|
100 |
|
einstalldocs
|
|
116 |
dosym -r /usr/share/locale /usr/share/openscad/locale
|
101 |
117 |
}
|
102 |
118 |
|
103 |
119 |
pkg_postinst() {
|
104 |
|
use emacs && elisp-site-regen
|
105 |
120 |
xdg_desktop_database_update
|
|
121 |
xdg_icon_cache_update
|
106 |
122 |
xdg_mimeinfo_database_update
|
|
123 |
|
|
124 |
optfeature "support scad major mode in GNU Emacs" app-emacs/scad-mode
|
107 |
125 |
}
|
108 |
126 |
|
109 |
127 |
pkg_postrm() {
|
110 |
|
use emacs && elisp-site-regen
|
111 |
128 |
xdg_desktop_database_update
|
|
129 |
xdg_icon_cache_update
|
112 |
130 |
xdg_mimeinfo_database_update
|
113 |
131 |
}
|