tkurbad-overlay/sci-electronics/flatcam/flatcam-9999.ebuild

133 lines
3.2 KiB
Bash

# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=7
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{8,9,10} )
inherit python-single-r1 gnome2
DESCRIPTION="Free and Open-source PCB CAM.."
HOMEPAGE="http://flatcam.org"
if [[ "${PV}" == "9999" ]] ; then
inherit git-r3
EGIT_REPO_URI="https://bitbucket.org/jpcgt/${PN}.git"
EGIT_BRANCH="Beta"
KEYWORDS=""
SRC_URI=""
else
SRC_URI="https://bitbucket.org/jpcgt/flatcam/downloads/FlatCAM-${PV}.zip -> ${P}.zip"
KEYWORDS="amd64 x86"
fi
LICENSE="MIT"
SLOT="0"
IUSE="+doc"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="
dev-libs/or-tools[${PYTHON_SINGLE_USEDEP}]
$(python_gen_cond_dep '
dev-python/cycler[${PYTHON_USEDEP}]
dev-python/dill[${PYTHON_USEDEP}]
dev-python/ezdxf[${PYTHON_USEDEP}]
dev-python/fonttools[${PYTHON_USEDEP}]
dev-python/freetype-py[${PYTHON_USEDEP}]
dev-python/kiwisolver[${PYTHON_USEDEP}]
dev-python/lxml[${PYTHON_USEDEP}]
>=dev-python/matplotlib-1.3.1[${PYTHON_USEDEP},qt5]
>=dev-python/numpy-1.8[${PYTHON_USEDEP}]
dev-python/pyopengl[${PYTHON_USEDEP}]
dev-python/PyQt5[${PYTHON_USEDEP},opengl,testlib]
dev-python/pyserial[${PYTHON_USEDEP}]
dev-python/python-dateutil[${PYTHON_USEDEP}]
dev-python/qrcode[${PYTHON_USEDEP}]
dev-python/rasterio[${PYTHON_USEDEP}]
dev-python/reportlab[${PYTHON_USEDEP}]
dev-python/scipy[${PYTHON_USEDEP}]
>=dev-python/shapely-1.3[${PYTHON_USEDEP}]
dev-python/simplejson[${PYTHON_USEDEP}]
dev-python/svg-path[${PYTHON_USEDEP}]
dev-python/svglib[${PYTHON_USEDEP}]
dev-python/testresources[${PYTHON_USEDEP}]
dev-python/vispy[${PYTHON_USEDEP},pyqt5]
')
media-libs/freetype
media-libs/libpng
sci-libs/gdal
sci-libs/geos
sci-libs/libspatialindex
sci-libs/rtree
"
DEPEND="$(python_gen_cond_dep '
dev-python/setuptools[${PYTHON_USEDEP}]
')
${RDEPEND}"
PREFIX="${EPREFIX}/usr"
src_prepare() {
default
sed -i -e '/markers\._marker_dict/d' \
"${S}"/appGUI/VisPyPatches.py \
|| die "sed failed"
}
src_configure() {
einfo "Nothing to configure"
}
src_compile() {
sed -i -e "s|\./bin/flatcam-beta|${PREFIX}/bin/flatcam|" \
-e "s|\./assets/icon\.png|flatcam|" \
"${S}"/assets/linux/flatcam-beta.desktop \
|| die "sed failed"
sed -i -e "/readlink -f/d" \
-e "0,/python_script_path/ s@python_script_path.*@python_script_path=${PREFIX}/share/${PN}@" \
-e "s|python3 |${EPYTHON} |" \
"${S}"/assets/linux/flatcam-beta \
|| die "sed failed"
if use doc ; then
cd "${S}"/doc
emake html
fi
}
src_install() {
insinto ${PREFIX}/share/${PN}
doins *.py
doins -r app{Common,Editors,GUI,Objects,Parsers,Tools}
doins -r assets config descartes locale preprocessors tclCommands Utils
insinto ${PREFIX}/share/applications
newins "${S}"/assets/linux/flatcam-beta.desktop flatcam.desktop
newbin "${S}"/assets/linux/flatcam-beta flatcam
local size
for size in 16 24 32 48 128 256; do
dosym ${PREFIX}/share/${PN}/assets/linux/icon.png \
${PREFIX}/share/icons/hicolor/${size}x${size}/apps/${PN}.png
done
dodoc "${S}"/CHANGELOG.md "${S}"/LICENSE "${S}"/README.md
use doc && dodoc -r "${S}"/doc/build/html
python_optimize "${ED}"/usr/share/${PN}
}
pkg_postrm() {
gnome2_icon_cache_update
}
pkg_postinst() {
gnome2_icon_cache_update
}