summaryrefslogtreecommitdiff
blob: 933b55e04eab741e8028d9098608a36d21107b7e (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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit cmake multibuild toolchain-funcs

DESCRIPTION="C++ Sequence Analysis Library"
HOMEPAGE="https://www.seqan.de/"

if [[ ${PV} == *9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/seqan/seqan.git"
	EGIT_BRANCH="develop"
else
	SRC_URI="https://github.com/seqan/seqan/archive/seqan-v${PV}.tar.gz"
	KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
	S="${WORKDIR}"/seqan-seqan-v${PV}
fi

LICENSE="BSD GPL-3"
SLOT="0"
IUSE="cpu_flags_x86_sse4_1 tools"
REQUIRED_USE="cpu_flags_x86_sse4_1"

RDEPEND="
	app-arch/bzip2:=
	sys-libs/zlib
	!!sci-biology/seqan:2.0
	!!sci-biology/seqan:2.1
	!!sci-biology/seqan:2.2"
DEPEND="${RDEPEND}"

PATCHES=(
	"${FILESDIR}"/${P}-fix-pthread.patch
	"${FILESDIR}"/${P}-installpaths.patch
	"${FILESDIR}"/${P}-cmake-add_library-static.patch
)

pkg_pretend() {
	[[ ${MERGE_TYPE} != binary ]] && use tools && tc-check-openmp
}

pkg_setup() {
	if [[ ${MERGE_TYPE} != binary ]]; then
		use tools && tc-check-openmp

		MULTIBUILD_VARIANTS=( $(usev tools) library )
	fi
}

src_configure() {
	my_configure() {
		local mycmakeargs=(
			-DSEQAN_NO_DOX=ON
		)
		case "${MULTIBUILD_ID}" in
			tools)
				mycmakeargs+=(
					-DSEQAN_BUILD_SYSTEM=SEQAN_RELEASE_APPS
				)
				;;
			library)
				mycmakeargs+=(
					-DSEQAN_BUILD_SYSTEM=SEQAN_RELEASE_LIBRARY
				)
				;;
			*)
				die "${MULTIBUILD_ID} is not recognized"
				;;
		esac
		cmake_src_configure
	}
	multibuild_foreach_variant my_configure
}

src_compile() {
	multibuild_foreach_variant cmake_src_compile
}

src_install() {
	multibuild_foreach_variant cmake_src_install
}