summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-02-26 21:05:13 +0000
committerSam James <sam@gentoo.org>2022-02-26 21:08:57 +0000
commitea8e8a89bcd911c655ea9856641bd8f97f53d4bd (patch)
treed717faf0c3efccb44ef5712f43d66f5434a2ebfd /sci-libs
parentx11-misc/sddm: Drop vulnerable 0.15.0 (diff)
downloadgentoo-ea8e8a89bcd911c655ea9856641bd8f97f53d4bd.tar.gz
gentoo-ea8e8a89bcd911c655ea9856641bd8f97f53d4bd.tar.bz2
gentoo-ea8e8a89bcd911c655ea9856641bd8f97f53d4bd.zip
sci-libs/lemon: update EAPI 6 -> 8
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/lemon/lemon-1.3.1-r1.ebuild96
1 files changed, 96 insertions, 0 deletions
diff --git a/sci-libs/lemon/lemon-1.3.1-r1.ebuild b/sci-libs/lemon/lemon-1.3.1-r1.ebuild
new file mode 100644
index 000000000000..902d5e27521e
--- /dev/null
+++ b/sci-libs/lemon/lemon-1.3.1-r1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Needed to build tests for now
+CMAKE_MAKEFILE_GENERATOR=emake
+inherit cmake
+
+DESCRIPTION="C++ template static library of common data structures and algorithms"
+HOMEPAGE="https://lemon.cs.elte.hu/trac/lemon/"
+SRC_URI="https://lemon.cs.elte.hu/pub/sources/${P}.tar.gz"
+
+LICENSE="Boost-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+coin doc glpk static-libs test"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="|| ( coin glpk )"
+
+RDEPEND="coin? (
+ sci-libs/coinor-cbc:=
+ sci-libs/coinor-clp:=
+ )
+ glpk? ( sci-mathematics/glpk:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="doc? (
+ app-doc/doxygen
+ app-text/ghostscript-gpl
+ dev-libs/mathjax
+ )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-multilib.patch
+ "${FILESDIR}"/${PN}-1.3-as-needed.patch
+)
+
+src_prepare() {
+ local t
+ for t in \
+ max_clique \
+ max_flow \
+ graph_utils \
+ random \
+ time_measure \
+ tsp; do
+ sed -i -e "/${t}_test/d" test/CMakeLists.txt || die
+ done
+
+ sed -i \
+ -e '/ADD_TEST(lp_test lp_test)/d' \
+ -e '/ADD_DEPENDENCIES(check lp_test)/d' \
+ test/CMakeLists.txt || die
+
+ cmake_comment_add_subdirectory demo
+
+ use doc || cmake_comment_add_subdirectory doc
+ use test || cmake_comment_add_subdirectory test
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLEMON_ENABLE_COIN=$(usex coin)
+ -DLEMON_ENABLE_GLPK=$(usex glpk)
+ )
+
+ use coin && mycmakeargs+=( -DCOIN_ROOT_DIR="${EPREFIX}/usr" )
+
+ if use doc; then
+ mycmakeargs+=(
+ -DLEMON_DOC_MATHJAX_RELPATH="${EPREFIX}/usr/share/mathjax"
+ -DLEMON_DOC_SOURCE_BROWSER=$(usex doc)
+ -DLEMON_DOC_USE_MATHJAX=$(usex doc)
+ )
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ cd "${S}" || die
+ emake -C "${BUILD_DIR}" check
+}
+
+src_install() {
+ cmake_src_install
+
+ # TODO: Upstream needs to see the light of GNUInstallDirs
+ if use doc; then
+ mv "${ED}"/usr/share/doc/lemon/html "${ED}"/usr/share/doc/${PF} || die
+ rmdir "${ED}"/usr/share/doc/lemon || die
+ fi
+}