+ qcad: fixed from https://bugs.gentoo.org/498656
[booboo.git] / media-gfx / qcad / qcad-3.27.6.3.ebuild
blob6f41a057693284e302023f386e97cda9cd2ff454
1 # Copyright 2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=7
6 inherit desktop xdg eutils qmake-utils #git-r3
8 DESCRIPTION="Open Source 2D CAD"
9 HOMEPAGE="http://www.qcad.org/"
10 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
16 L10N=( de en es fr it ja nl pl pt ru sl sk sv fi hr hu zh_CN cs TW lt )
18 IUSE=""
20 for lingua in ${L10N[*]}; do
21 IUSE+=" l10n_${lingua}"
22 done
24 DEPEND="
25 dev-libs/glib
26 media-libs/glu
27 media-libs/mesa
28 dev-qt/designer:5=
29 dev-qt/qtcore:5=
30 dev-qt/qtgui:5=
31 dev-qt/qthelp:5=
32 dev-qt/qtopengl:5=
33 dev-qt/qtscript:5=[scripttools]
34 dev-qt/qtsql:5=
35 dev-qt/qtsvg:5=
36 dev-qt/qtxmlpatterns:5=
37 dev-qt/qtwebengine:5=
39 RDEPEND="${DEPEND}"
41 src_prepare() {
42 # This is the latest known src/3rdparty/qt-labs-qtscriptgenerator-<qtversion>
43 local myqtvsrc="5.14.0" # available since 3.24.2.3
44 #local myqtvsrc="5.14.2" # in git master on 2020 Apr 8 (ie after 3.24.3.0)
46 local myqt=$(best_version dev-qt/qtcore:5)
47 local myqtv=${myqt#dev-qt/qtcore-}
48 local myqtv=${myqtv%-r*}
50 if ! test -d "${S}/src/3rdparty/qt-labs-qtscriptgenerator-${myqtv}"
51 then
52 einfo "Creating QT configuration for QT ${myqtv}"
53 mkdir "${S}/src/3rdparty/qt-labs-qtscriptgenerator-${myqtv}"
54 ln "${S}/src/3rdparty/qt-labs-qtscriptgenerator-${myqtvsrc}/qt-labs-qtscriptgenerator-${myqtvsrc}.pro" "${S}/src/3rdparty/qt-labs-qtscriptgenerator-${myqtv}/qt-labs-qtscriptgenerator-${myqtv}.pro"
57 default
60 src_configure() {
61 eqmake5 -r || die
64 src_install() {
65 # Create Wayland desktop entry
66 cp qcad.desktop qcad-wayland.desktop
67 sed -i 's/Exec=qcad/Exec=qcad -platform xcb/g' qcad-wayland.desktop
68 sed -i 's/Name=QCAD/Name=QCAD (Wayland)/g' qcad-wayland.desktop
70 domenu "${S}/*.desktop"
71 doicon "${S}/scripts/${PN}_icon.svg"
72 doicon --size 256 "${S}/scripts/${PN}_icon.png"
74 cd "${S}"
75 for lingua in "${L10N[@]}"
77 if ! use l10n_${lingua}
78 then
79 find -type f -name "*_${lingua}.*" -delete
81 done
83 insinto /usr/lib/${PN}/
84 doins -r scripts fonts patterns linetypes themes
85 insopts -m0755
86 doins release/*
87 make_wrapper ${PN} /usr/lib/${PN}/qcad-bin "" /usr/lib/${PN}:/usr/lib/${PN}/plugins
88 doins -r plugins
90 docinto examples
91 dodoc -r examples/*
92 docompress -x /usr/share/doc/${PF}/examples
95 pkg_postinst() {
96 xdg_pkg_postinst