# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# originally from https://bitbucket.org/szymonsz/gen2-overlay/src/master/media-gfx/PrusaSlicer/
EAPI=6
inherit eutils cmake-utils
DESCRIPTION="Prusa Edition of a mesh slicer to generate G-code for fused-filament-fabrication (3D printers)"
HOMEPAGE="https://github.com/prusa3d/PrusaSlicer"
SRC_URI="https://github.com/prusa3d/PrusaSlicer/archive/version_${PV}.tar.gz"
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+gui test"
# https://github.com/prusa3d/PrusaSlicer/issues/2150
RDEPEND=">=dev-libs/boost-1.55[threads]
dev-libs/cereal
dev-cpp/tbb
sci-libs/nlopt[cxx]
net-misc/curl
dev-cpp/eigen
dev-libs/expat
media-libs/glew:0
gui? ( >=media-libs/freeglut-3
x11-libs/libXmu
x11-libs/wxGTK:3.0
)"
DEPEND="${RDEPEND}
>=dev-cpp/gtest-1.7"
S="${WORKDIR}/PrusaSlicer-version_${PV}"
src_prepare() {
pushd "${WORKDIR}/PrusaSlicer-version_${PV}" || die
eapply_user
popd || die
}
src_configure() {
CMAKE_BUILD_TYPE=Release
local mycmakeargs=(
-DSLIC3R_WX_STABLE=1
-DSLIC3R_FHS=1
-DSLIC3R_BUILD_ID=PrusaSlicer-${PV}
)
sed -i "s|\+UNKNOWN||g" version.inc
cmake-utils_src_configure
}
src_test() {
cmake-utils_src_test
}
src_install() {
cmake-utils_src_install
make_desktop_entry prusa-slicer \
"PrusaSlicer" \
"/usr/share/${PN}/icons/PrusaSlicer_128px.png" \
"Graphics;3DGraphics;Engineering;Development"
}