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

134 lines
3.2 KiB
Bash
Raw Normal View History

# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
2023-07-03 11:36:29 +02:00
EAPI=8
PYTHON_COMPAT=( python3_{9..12} )
DISTUTILS_USE_PEP517=setuptools
2023-07-03 11:36:29 +02:00
DISTUTILS_SINGLE_IMPL=1
2023-07-03 11:36:29 +02:00
inherit distutils-r1 gnome2
DESCRIPTION="Free and Open-source PCB CAM.."
HOMEPAGE="http://flatcam.org"
2017-10-31 15:16:11 +01:00
if [[ "${PV}" == "9999" ]] ; then
2023-07-03 11:36:29 +02:00
SRC_URI=""
2017-10-31 15:16:11 +01:00
EGIT_REPO_URI="https://bitbucket.org/jpcgt/${PN}.git"
EGIT_BRANCH="Beta"
2023-07-03 11:36:29 +02:00
inherit git-r3
2017-10-31 15:16:11 +01:00
else
SRC_URI="https://bitbucket.org/jpcgt/flatcam/downloads/FlatCAM-${PV}.zip -> ${P}.zip"
KEYWORDS="amd64 x86"
fi
LICENSE="MIT"
SLOT="0"
2017-10-31 15:16:11 +01:00
IUSE="+doc"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
2017-10-31 15:16:11 +01:00
RDEPEND="
2023-07-03 11:36:29 +02:00
dev-lang/tk
sci-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}]
2023-07-03 11:36:29 +02:00
dev-python/matplotlib[${PYTHON_USEDEP},qt5]
dev-python/numpy[${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}]
2023-07-03 11:36:29 +02:00
dev-python/shapely[${PYTHON_USEDEP}]
2020-10-12 09:27:26 +02:00
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
2020-11-26 09:08:45 +01:00
sci-libs/rtree
2017-10-31 15:16:11 +01:00
"
DEPEND="$(python_gen_cond_dep '
2023-01-10 15:44:01 +01:00
dev-python/sphinx[${PYTHON_USEDEP}]
doc? ( dev-python/setuptools[${PYTHON_USEDEP}] )
')
${RDEPEND}"
2017-10-31 15:16:11 +01:00
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"
}
2017-10-31 15:16:11 +01:00
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"
2017-10-31 15:16:11 +01:00
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
2017-10-31 15:16:11 +01:00
insinto ${PREFIX}/share/applications
newins "${S}"/assets/linux/flatcam-beta.desktop flatcam.desktop
newbin "${S}"/assets/linux/flatcam-beta flatcam
2017-10-31 15:16:11 +01:00
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
2017-10-31 15:16:11 +01:00
done
dodoc "${S}"/CHANGELOG.md "${S}"/LICENSE "${S}"/README.md
2017-10-31 15:16:11 +01:00
use doc && dodoc -r "${S}"/doc/build/html
python_optimize "${ED}"/usr/share/${PN}
2017-10-31 15:16:11 +01:00
}
pkg_postrm() {
gnome2_icon_cache_update
}
pkg_postinst() {
gnome2_icon_cache_update
}