summaryrefslogtreecommitdiff
path: root/kde-apps/cantor
diff options
context:
space:
mode:
Diffstat (limited to 'kde-apps/cantor')
-rw-r--r--kde-apps/cantor/cantor-16.04.49.9999.ebuild104
-rw-r--r--kde-apps/cantor/cantor-9999.ebuild26
-rw-r--r--kde-apps/cantor/files/cantor-15.12.3-tests.patch49
3 files changed, 172 insertions, 7 deletions
diff --git a/kde-apps/cantor/cantor-16.04.49.9999.ebuild b/kde-apps/cantor/cantor-16.04.49.9999.ebuild
new file mode 100644
index 00000000000..3cdcedc7155
--- /dev/null
+++ b/kde-apps/cantor/cantor-16.04.49.9999.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+KDE_HANDBOOK="forceoptional"
+KDE_TEST="forceoptional"
+PYTHON_COMPAT=( python2_7 )
+# FIXME: PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
+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"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+# TODO Add Sage Mathematics Software backend (http://www.sagemath.org)
+# FIXME: $(python_gen_cond_dep 'dev-qt/qtdbus:5' 'python3*')
+RDEPEND="
+ $(add_frameworks_dep karchive)
+ $(add_frameworks_dep kcompletion)
+ $(add_frameworks_dep kconfig)
+ $(add_frameworks_dep kconfigwidgets)
+ $(add_frameworks_dep kcoreaddons)
+ $(add_frameworks_dep kcrash)
+ $(add_frameworks_dep kdelibs4support)
+ $(add_frameworks_dep ki18n)
+ $(add_frameworks_dep kio)
+ $(add_frameworks_dep knewstuff)
+ $(add_frameworks_dep kparts)
+ $(add_frameworks_dep kpty)
+ $(add_frameworks_dep ktexteditor)
+ $(add_frameworks_dep kwidgetsaddons)
+ $(add_frameworks_dep kxmlgui)
+ $(add_qt_dep qtgui)
+ $(add_qt_dep qtsvg)
+ $(add_qt_dep qtwidgets)
+ $(add_qt_dep qtxml)
+ $(add_qt_dep qtxmlpatterns)
+ analitza? ( $(add_kdeapps_dep analitza) )
+ lua? ( dev-lang/luajit:2 )
+ qalculate? (
+ sci-libs/cln
+ sci-libs/libqalculate
+ )
+ postscript? ( app-text/libspectre )
+ python? ( ${PYTHON_DEPS} )
+ R? ( dev-lang/R )
+"
+DEPEND="${RDEPEND}
+ >=dev-cpp/eigen-2.0.3:2
+"
+
+RESTRICT="test"
+
+PATCHES=( "${FILESDIR}/${PN}-15.12.3-tests.patch" )
+
+pkg_setup() {
+ use python && python_setup
+ kde5_pkg_setup
+}
+
+src_prepare() {
+ kde5_src_prepare
+
+ # FIXME: shipped FindPythonLibs3.cmake does not work for Gentoo
+ sed -e "/^find_package(PythonLibs3)/ s/^/#/" \
+ -i src/backends/CMakeLists.txt || die
+
+ if ! use test ; then
+ sed -e "/add_subdirectory(test)/ s/^/#DONT/" \
+ -i src/lib/CMakeLists.txt || die
+ sed -e "/add_subdirectory(tests)/ s/^/#DONT/" \
+ -i src/backends/python3/CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_find_package analitza Analitza5)
+ $(cmake-utils_use_find_package lua LuaJIT)
+ $(cmake-utils_use_find_package postscript LibSpectre)
+ $(cmake-utils_use_find_package python PythonLibs)
+ $(cmake-utils_use_find_package qalculate Qalculate)
+ $(cmake-utils_use_find_package R R)
+ )
+ 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 ee203282584..3cdcedc7155 100644
--- a/kde-apps/cantor/cantor-9999.ebuild
+++ b/kde-apps/cantor/cantor-9999.ebuild
@@ -2,12 +2,12 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
-EAPI=5
+EAPI=6
-KDE_HANDBOOK="true"
-KDE_TEST="true"
+KDE_HANDBOOK="forceoptional"
+KDE_TEST="forceoptional"
PYTHON_COMPAT=( python2_7 )
-# FIXME: PYTHON_COMPAT=( python{2_7,3_2,3_3,3_4} )
+# FIXME: PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
inherit kde5 python-r1
DESCRIPTION="Interface for doing mathematics and scientific computing"
@@ -28,6 +28,7 @@ RDEPEND="
$(add_frameworks_dep kcrash)
$(add_frameworks_dep kdelibs4support)
$(add_frameworks_dep ki18n)
+ $(add_frameworks_dep kio)
$(add_frameworks_dep knewstuff)
$(add_frameworks_dep kparts)
$(add_frameworks_dep kpty)
@@ -55,15 +56,26 @@ DEPEND="${RDEPEND}
RESTRICT="test"
+PATCHES=( "${FILESDIR}/${PN}-15.12.3-tests.patch" )
+
pkg_setup() {
use python && python_setup
kde5_pkg_setup
}
src_prepare() {
+ kde5_src_prepare
+
# FIXME: shipped FindPythonLibs3.cmake does not work for Gentoo
- sed -e '/^find_package(PythonLibs3)/ s/^/#/' \
+ sed -e "/^find_package(PythonLibs3)/ s/^/#/" \
-i src/backends/CMakeLists.txt || die
+
+ if ! use test ; then
+ sed -e "/add_subdirectory(test)/ s/^/#DONT/" \
+ -i src/lib/CMakeLists.txt || die
+ sed -e "/add_subdirectory(tests)/ s/^/#DONT/" \
+ -i src/backends/python3/CMakeLists.txt || die
+ fi
}
src_configure() {
@@ -72,8 +84,8 @@ src_configure() {
$(cmake-utils_use_find_package lua LuaJIT)
$(cmake-utils_use_find_package postscript LibSpectre)
$(cmake-utils_use_find_package python PythonLibs)
- $(cmake-utils_use_find_package qalculate)
- $(cmake-utils_use_find_package R)
+ $(cmake-utils_use_find_package qalculate Qalculate)
+ $(cmake-utils_use_find_package R R)
)
kde5_src_configure
}
diff --git a/kde-apps/cantor/files/cantor-15.12.3-tests.patch b/kde-apps/cantor/files/cantor-15.12.3-tests.patch
new file mode 100644
index 00000000000..5cea78d6c3a
--- /dev/null
+++ b/kde-apps/cantor/files/cantor-15.12.3-tests.patch
@@ -0,0 +1,49 @@
+--- a/src/backends/maxima/CMakeLists.txt 2016-03-21 02:16:05.549024821 +0100
++++ b/src/backends/maxima/CMakeLists.txt 2016-03-21 02:22:07.951014021 +0100
+@@ -21,12 +21,14 @@
+ target_link_libraries(cantor_maximabackend KF5::Pty)
+ endif(NOT WIN32)
+
++if (BUILD_TESTING)
+ add_executable( testmaxima testmaxima.cpp)
+ target_link_libraries( testmaxima
+ cantorlibs
+ cantortest
+ ${QTTEST_LIBRARY}
+ )
++endif()
+
+ install( FILES cantor_maxima.knsrc DESTINATION ${KDE_INSTALL_CONFDIR} )
+ install( FILES keywords.xml cantor-initmaxima.lisp DESTINATION ${KDE_INSTALL_DATADIR}/cantor/maximabackend)
+--- a/src/backends/sage/CMakeLists.txt 2016-03-21 01:23:19.251791138 +0100
++++ b/src/backends/sage/CMakeLists.txt 2016-03-21 01:27:16.300827617 +0100
+@@ -17,12 +17,14 @@
+
+ target_link_libraries( cantor_sagebackend KF5::Pty)
+
++if (BUILD_TESTING)
+ add_executable( testsage testsage.cpp)
+ target_link_libraries( testsage
+ ${QT_QTTEST_LIBRARY}
+ cantorlibs
+ cantortest
+ )
++endif()
+
+ install( FILES cantor_sage.knsrc DESTINATION ${KDE_INSTALL_CONFDIR} )
+ install( FILES keywords.xml DESTINATION ${KDE_INSTALL_DATADIR}/cantor/sagebackend)
+--- a/src/backends/python2/CMakeLists.txt 2016-03-21 01:28:39.055793038 +0100
++++ b/src/backends/python2/CMakeLists.txt 2016-03-21 01:35:01.451012440 +0100
+@@ -20,10 +20,12 @@
+ cantor_pythonbackend
+ )
+
++if (BUILD_TESTING)
+ add_executable(testpython2 testpython2.cpp)
+ target_link_libraries(testpython2 ${QT_QTTEST_LIBRARY} cantorlibs cantortest)
+
+ add_test(NAME testpython2 COMMAND testpython2)
++endif()
+
+ install(FILES cantor_python2.knsrc DESTINATION ${KDE_INSTALL_CONFDIR})
+ install(FILES python2backend.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})