summaryrefslogtreecommitdiff
blob: b4d49d1fb14b07d4ca3a7d834d7912e3562e13a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PYTHON_COMPAT=( python2_7 )
COMMIT=e80b5e2021a72faa36bf9e35207998d4590f2cf4
inherit cmake-utils python-single-r1

DESCRIPTION="Biochemical Algorithms Library"
HOMEPAGE="https://github.com/BALL-Project/ball"
SRC_URI="https://github.com/BALL-Project/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"

SLOT="0"
LICENSE="LGPL-2 fftw? ( GPL-3 ) openbabel? ( GPL-3 )"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="cuda doc +fftw +gui lpsolve mpi openbabel +python svm test threads webengine"

REQUIRED_USE="
	python? ( ${PYTHON_REQUIRED_USE} )
	threads? ( fftw )
	webengine? ( gui )
"

RDEPEND="
	dev-cpp/eigen:3
	dev-libs/boost:=
	dev-qt/qtcore:5
	dev-qt/qtnetwork:5
	dev-qt/qtxml:5
	media-libs/glew:0=
	virtual/opengl
	x11-libs/libX11
	cuda? ( dev-util/nvidia-cuda-toolkit )
	fftw? ( sci-libs/fftw:3.0=[threads?] )
	gui? (
		dev-qt/qtgui:5
		dev-qt/qtopengl:5
		dev-qt/qtprintsupport:5
		dev-qt/qttest:5
		dev-qt/qtwidgets:5
	)
	lpsolve? ( sci-mathematics/lpsolve )
	mpi? ( virtual/mpi )
	openbabel? ( sci-chemistry/openbabel:= )
	python? ( ${PYTHON_DEPS} )
	svm? ( sci-libs/libsvm:= )
	webengine? (
		dev-qt/qtwebchannel:5
		dev-qt/qtwebengine:5[widgets]
	)
"
DEPEND="${RDEPEND}
	sys-devel/bison
	virtual/yacc
	doc? ( app-doc/doxygen[dot] )
	gui? ( dev-qt/linguist-tools:5 )
	python? ( dev-python/sip )
"

S="${WORKDIR}"/${PN}-${COMMIT}

PATCHES=( "${FILESDIR}"/${PN}-1.5.0-gnuinstalldirs.patch )

RESTRICT="test"

pkg_setup() {
	use python && python-single-r1_pkg_setup
}

src_configure() {
	local mycmakeargs=(
		-DUPDATE_TRANSLATIONS=ON
		-DCMAKE_DISABLE_FIND_PACKAGE_LATEX=ON
		-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF}
		-DUSE_CUDA=$(usex cuda)
		-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=$(usex !doc)
		-DCMAKE_DISABLE_FIND_PACKAGE_FFTW=$(usex !fftw)
		-DUSE_LPSOLVE=$(usex lpsolve)
		-DUSE_MPI=$(usex mpi)
		-DREQUIRE_MPI=$(usex mpi)
		-DCMAKE_DISABLE_FIND_PACKAGE_OpenBabel2=$(usex !openbabel)
		-DBALL_PYTHON_SUPPORT=$(usex python)
		-DBALL_HAS_VIEW=$(usex gui)
		-DUSE_LIBSVM=$(usex svm)
		-DUSE_FFTW_THREADS=$(usex threads)
		-DUSE_QTWEBENGINE=$(usex webengine)
	)

	if use fftw || use openbabel; then
		mycmakeargs+=( -DBALL_LICENSE=GPL )
	fi

	cmake-utils_src_configure
}

src_compile() {
	cmake-utils_src_compile
	use test && cmake-utils_src_make build_tests
}