commit:     81006f8284b08a2b5097da883709f268dfa535d5
Author:     Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
AuthorDate: Sat Nov 26 23:32:15 2016 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 11:30:46 2016 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=81006f82

kde-apps/cantor: Fix DEPENDs, add USE=julia, pkg_postinst -> pkg_pretend

Better warn before the emerge than afterwards.
Add two runtime backends to pkg_pretend message.

Gentoo-bug: 598926

Package-Manager: portage-2.3.0

 kde-apps/cantor/cantor-16.12.49.9999.ebuild | 40 +++++++++++++++++------------
 kde-apps/cantor/cantor-9999.ebuild          | 40 +++++++++++++++++------------
 kde-apps/cantor/metadata.xml                |  1 +
 3 files changed, 47 insertions(+), 34 deletions(-)

diff --git a/kde-apps/cantor/cantor-16.12.49.9999.ebuild 
b/kde-apps/cantor/cantor-16.12.49.9999.ebuild
index ed84d7b..022066a 100644
--- a/kde-apps/cantor/cantor-16.12.49.9999.ebuild
+++ b/kde-apps/cantor/cantor-16.12.49.9999.ebuild
@@ -13,7 +13,7 @@ inherit kde5 python-r1
 DESCRIPTION="Interface for doing mathematics and scientific computing"
 HOMEPAGE="https://www.kde.org/applications/education/cantor 
https://edu.kde.org/cantor";
 KEYWORDS=""
-IUSE="analitza lua postscript python qalculate +R"
+IUSE="analitza julia lua postscript python qalculate +R"
 
 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
@@ -26,8 +26,8 @@ RDEPEND="
        $(add_frameworks_dep kconfigwidgets)
        $(add_frameworks_dep kcoreaddons)
        $(add_frameworks_dep kcrash)
-       $(add_frameworks_dep kdelibs4support)
        $(add_frameworks_dep ki18n)
+       $(add_frameworks_dep kiconthemes)
        $(add_frameworks_dep kio)
        $(add_frameworks_dep knewstuff)
        $(add_frameworks_dep kparts)
@@ -36,11 +36,13 @@ RDEPEND="
        $(add_frameworks_dep kwidgetsaddons)
        $(add_frameworks_dep kxmlgui)
        $(add_qt_dep qtgui)
+       $(add_qt_dep qtprintsupport)
        $(add_qt_dep qtsvg)
        $(add_qt_dep qtwidgets)
        $(add_qt_dep qtxml)
        $(add_qt_dep qtxmlpatterns)
        analitza? ( $(add_kdeapps_dep analitza) )
+       julia? ( dev-lang/julia )
        lua? ( dev-lang/luajit:2 )
        qalculate? (
                sci-libs/cln
@@ -51,10 +53,26 @@ RDEPEND="
        R? ( dev-lang/R )
 "
 DEPEND="${RDEPEND}
-       >=dev-cpp/eigen-2.0.3:2
+       dev-cpp/eigen:2
 "
 
-RESTRICT="test"
+RESTRICT+=" test"
+
+pkg_pretend() {
+       kde5_pkg_pretend
+
+       if ! has_version sci-mathematics/maxima && ! has_version 
sci-mathematics/octave && \
+               ! use analitza && ! use julia && ! use lua && ! use python && ! 
use qalculate && ! use R; then
+               einfo
+               einfo "You have decided to build ${PN} with no backend."
+               einfo "To have this application functional, please enable one 
of the backends via USE flag:"
+               einfo "    analitza, julia, lua, python, qalculate, R"
+               einfo "Alternatively, install one of these:"
+               einfo "    # emerge sci-mathematics/maxima"
+               einfo "    # emerge sci-mathematics/octave"
+               einfo
+       fi
+}
 
 pkg_setup() {
        use python && python_setup
@@ -72,6 +90,7 @@ src_prepare() {
 src_configure() {
        local mycmakeargs=(
                $(cmake-utils_use_find_package analitza Analitza5)
+               $(cmake-utils_use_find_package julia Julia)
                $(cmake-utils_use_find_package lua LuaJIT)
                $(cmake-utils_use_find_package postscript LibSpectre)
                $(cmake-utils_use_find_package python PythonLibs)
@@ -80,16 +99,3 @@ src_configure() {
        )
        kde5_src_configure
 }
-
-pkg_postinst() {
-       kde5_pkg_postinst
-
-       if ! use analitza && ! use lua && ! use python && ! use qalculate && ! 
use R; then
-               echo
-               ewarn "You have decided to build ${PN} with no backend."
-               ewarn "To have this application functional, please do one of 
below:"
-               ewarn "    # emerge -va1 '='${CATEGORY}/${P} with 'analitza', 
'lua', 'python', 'qalculate' or 'R' USE flag enabled"
-               ewarn "    # emerge -vaDu sci-mathematics/maxima"
-               echo
-       fi
-}

diff --git a/kde-apps/cantor/cantor-9999.ebuild 
b/kde-apps/cantor/cantor-9999.ebuild
index ed84d7b..022066a 100644
--- a/kde-apps/cantor/cantor-9999.ebuild
+++ b/kde-apps/cantor/cantor-9999.ebuild
@@ -13,7 +13,7 @@ inherit kde5 python-r1
 DESCRIPTION="Interface for doing mathematics and scientific computing"
 HOMEPAGE="https://www.kde.org/applications/education/cantor 
https://edu.kde.org/cantor";
 KEYWORDS=""
-IUSE="analitza lua postscript python qalculate +R"
+IUSE="analitza julia lua postscript python qalculate +R"
 
 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
@@ -26,8 +26,8 @@ RDEPEND="
        $(add_frameworks_dep kconfigwidgets)
        $(add_frameworks_dep kcoreaddons)
        $(add_frameworks_dep kcrash)
-       $(add_frameworks_dep kdelibs4support)
        $(add_frameworks_dep ki18n)
+       $(add_frameworks_dep kiconthemes)
        $(add_frameworks_dep kio)
        $(add_frameworks_dep knewstuff)
        $(add_frameworks_dep kparts)
@@ -36,11 +36,13 @@ RDEPEND="
        $(add_frameworks_dep kwidgetsaddons)
        $(add_frameworks_dep kxmlgui)
        $(add_qt_dep qtgui)
+       $(add_qt_dep qtprintsupport)
        $(add_qt_dep qtsvg)
        $(add_qt_dep qtwidgets)
        $(add_qt_dep qtxml)
        $(add_qt_dep qtxmlpatterns)
        analitza? ( $(add_kdeapps_dep analitza) )
+       julia? ( dev-lang/julia )
        lua? ( dev-lang/luajit:2 )
        qalculate? (
                sci-libs/cln
@@ -51,10 +53,26 @@ RDEPEND="
        R? ( dev-lang/R )
 "
 DEPEND="${RDEPEND}
-       >=dev-cpp/eigen-2.0.3:2
+       dev-cpp/eigen:2
 "
 
-RESTRICT="test"
+RESTRICT+=" test"
+
+pkg_pretend() {
+       kde5_pkg_pretend
+
+       if ! has_version sci-mathematics/maxima && ! has_version 
sci-mathematics/octave && \
+               ! use analitza && ! use julia && ! use lua && ! use python && ! 
use qalculate && ! use R; then
+               einfo
+               einfo "You have decided to build ${PN} with no backend."
+               einfo "To have this application functional, please enable one 
of the backends via USE flag:"
+               einfo "    analitza, julia, lua, python, qalculate, R"
+               einfo "Alternatively, install one of these:"
+               einfo "    # emerge sci-mathematics/maxima"
+               einfo "    # emerge sci-mathematics/octave"
+               einfo
+       fi
+}
 
 pkg_setup() {
        use python && python_setup
@@ -72,6 +90,7 @@ src_prepare() {
 src_configure() {
        local mycmakeargs=(
                $(cmake-utils_use_find_package analitza Analitza5)
+               $(cmake-utils_use_find_package julia Julia)
                $(cmake-utils_use_find_package lua LuaJIT)
                $(cmake-utils_use_find_package postscript LibSpectre)
                $(cmake-utils_use_find_package python PythonLibs)
@@ -80,16 +99,3 @@ src_configure() {
        )
        kde5_src_configure
 }
-
-pkg_postinst() {
-       kde5_pkg_postinst
-
-       if ! use analitza && ! use lua && ! use python && ! use qalculate && ! 
use R; then
-               echo
-               ewarn "You have decided to build ${PN} with no backend."
-               ewarn "To have this application functional, please do one of 
below:"
-               ewarn "    # emerge -va1 '='${CATEGORY}/${P} with 'analitza', 
'lua', 'python', 'qalculate' or 'R' USE flag enabled"
-               ewarn "    # emerge -vaDu sci-mathematics/maxima"
-               echo
-       fi
-}

diff --git a/kde-apps/cantor/metadata.xml b/kde-apps/cantor/metadata.xml
index 632627c..20e3a59 100644
--- a/kde-apps/cantor/metadata.xml
+++ b/kde-apps/cantor/metadata.xml
@@ -7,6 +7,7 @@
        </maintainer>
        <use>
                <flag name="analitza">Enable <pkg>kde-apps/analitza</pkg> 
backend support</flag>
+               <flag name="julia">Enable <pkg>dev-lang/julia</pkg> backend 
support</flag>
                <flag name="qalculate">Enable <pkg>sci-libs/libqalculate</pkg> 
backend support</flag>
                <flag name="R">Enable <pkg>dev-lang/R</pkg> backend 
support</flag>
        </use>

Reply via email to