aboutsummaryrefslogtreecommitdiff
blob: c4a2da7b42eeffad4d5180d8ade65840df749022 (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
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{7..10} pypy3 )
DOCS_BUILDER="sphinx"
DOCS_AUTODOC=0
DOCS_DIR="docs"
inherit python-any-r1 docs meson

DESCRIPTION="Program for docking ligands to proteins and nucleic acids"
HOMEPAGE="https://gitlab.com/Jukic/cmdock"
SRC_URI="https://gitlab.com/Jukic/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.gz"
S="${WORKDIR}/${PN}-v${PV}"

LICENSE="LGPL-3"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="boinc"

RDEPEND="
	dev-lang/perl
	boinc? ( sci-misc/boinc-wrapper )
"
BDEPEND="
	dev-cpp/eigen:3
	dev-cpp/indicators
	dev-cpp/pcg-cpp
	dev-libs/cxxopts
"

src_prepare() {
	default
	rm -r include/indicators || die
	sed "s|pcg_cpp_dep = dependency.*|pcg_cpp_dep = declare_dependency(include_directories: '/usr/include')|" -i meson.build || die
}

src_configure() {
	# very weird directory layout
	local emesonargs=(
		--prefix="${EPREFIX}/opt/cmdock-${PV}"
	)
	meson_src_configure
}

src_compile() {
	meson_src_compile
	docs_compile
}

src_install() {
	meson_src_install

	if use boinc ; then
		insinto /var/lib/boinc/projects/www.sidock.si_sidock
		newins "${FILESDIR}/app_info_${PV}.xml" app_info.xml
		doins "${FILESDIR}/cmdock-boinc_job_${PV}.xml"
		doins "${FILESDIR}/cmdock-boinc-zcp_job_${PV}.xml"
		newins "${FILESDIR}/cmdock-boinc-zcp_job_${PV}.xml" cmdock-boinc-zip_job_${PV}.xml

		dosym ../../../../../usr/bin/boinc-wrapper /var/lib/boinc/projects/www.sidock.si_sidock/cmdock-wrapper_${PV}
		dosym ../../../../../usr/bin/boinc-wrapper /var/lib/boinc/projects/www.sidock.si_sidock/cmdock-boinc-zcp_wrapper_${PV}
		dosym ../../../../../usr/bin/boinc-wrapper /var/lib/boinc/projects/www.sidock.si_sidock/cmdock-boinc-zip_wrapper_${PV}
	fi
}

pkg_postinst() {
	if use boinc ; then
		touch /var/lib/boinc/projects/www.sidock.si_sidock/docking_out.sd || die
		elog
		elog "The easiest way to do something useful with this application"
		elog "is to attach it to SiDock@home BOINC project."
		elog
		elog "- Master URL: https://sidock.si/sidock/"
		elog "- Invitation code: Crunch_4Science"
	fi
}