summaryrefslogtreecommitdiff
blob: e107ab352e2c31102f17e32d4a63c15e8aa57da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Copyright 1999-2020 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit perl-module cmake-utils

DESCRIPTION="G-code generator for 3D printers"
HOMEPAGE="https://www.prusa3d.com/prusaslicer/"
SRC_URI="https://github.com/prusa3d/PrusaSlicer/archive/version_${PV/_/-}.tar.gz -> ${P}.tar.gz"

LICENSE="AGPL-3 CC-BY-3.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+gui test"

RDEPEND="!media-gfx/slic3r
	>=dev-libs/boost-1.55[threads]
	dev-cpp/eigen
	dev-cpp/gtest
	dev-cpp/tbb
	dev-libs/cereal
	dev-libs/expat
	dev-libs/openssl
	>=media-gfx/openvdb-5.0[-abi4-compat]
	media-libs/glew
	net-misc/curl
	sci-libs/nlopt
	>=sci-mathematics/cgal-4.14
	x11-libs/wxGTK:3.0-gtk3"
DEPEND="${RDEPEND}"

S="${WORKDIR}/PrusaSlicer-version_${PV/_/-}"

src_configure() {
	local mycmakeargs=(
		-DSLIC3R_WX_STABLE=1
		-DSLIC3R_GUI=$(usex gui 1 0)
		-DSLIC3R_FHS=1
		-DSLIC3R_STATIC=0
		-DSLIC3R_GTK=3
		-DSLIC3R_PERL_XS=0
		-DSLIC3R_BUILD_SANDBOXES=0
		-DSLIC3R_BUILD_TESTS=$(usex test 1 0)
		-DSLIC3R_PCH=0
		-DOPENVDB_ABI_VERSION_NUMBER=5
	)
	cmake-utils_src_configure
}

src_test() {
	perl-module_src_test
	pushd .. || die
	prove -Ixs/blib/arch -Ixs/blib/lib/ t/ || die "Tests failed"
	popd || die
}

src_install() {
	cmake-utils_src_install

	dosym "/usr/share/PrusaSlicer/icons/PrusaSlicer_192px.png" \
		"/usr/share/pixmaps/prusa-slicer.png"

	make_desktop_entry "prusa-slicer %F" "PrusaSlicer" "prusa-slicer" \
		"Graphics;3DGraphics;Engineering;Development" \
		"MimeType=model/stl;application/xml;application/prs.wavefront-obj;application/vnd.ms-3mfdocument;"
}