summaryrefslogtreecommitdiff
blob: a6048c4993fe185d21adefdd5fd601937e30e303 (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
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit cmake-utils eutils toolchain-funcs fortran-2

DESCRIPTION="Core libraries for the Common Astronomy Software Applications"
HOMEPAGE="https://code.google.com/p/casacore/"
SRC_URI="https://${PN}.googlecode.com/files/${P}.tar.bz2"

LICENSE="GPL-2"
#KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
# de-keyworded until casa-data catches up
KEYWORDS=""
SLOT="0"
IUSE="+data doc fftw hdf5 openmp threads test"

RDEPEND="
	sci-libs/cfitsio:0=
	sci-astronomy/wcslib:0=
	sys-libs/readline:0=
	virtual/blas
	virtual/lapack
	data? ( sci-astronomy/casa-data )
	fftw? ( sci-libs/fftw:3.0= )
	hdf5? ( sci-libs/hdf5:0= )"
DEPEND="${RDEPEND}
	virtual/pkgconfig
	doc? ( app-doc/doxygen )
	test? ( sci-astronomy/casa-data )"

PATCHES=(
	"${FILESDIR}"/1.3.0-implicits.patch
	"${FILESDIR}"/1.3.0-libdir.patch
	"${FILESDIR}"/1.5.0-sysdep.patch
	"${FILESDIR}"/1.5.0-gcc47.patch
	"${FILESDIR}"/1.5.0-gcc48.patch
)

pkg_setup() {
	if use openmp && [[ $(tc-getCC)$ == *gcc* ]] && ! tc-has-openmp; then
		ewarn "You are using gcc but without OpenMP capabilities"
		die "Need an OpenMP capable compiler"
	fi
	fortran-2_pkg_setup
}

src_configure() {
	has_version sci-libs/hdf5[mpi] && export CXX=mpicxx
	local mycmakeargs=(
		-DENABLE_SHARED=ON
		-DDATA_DIR="${EPREFIX}/usr/share/casa/data"
		$(cmake-utils_use_build test TESTING)
		$(cmake-utils_use_use fftw FFTW3)
		$(cmake-utils_use_use hdf5 HDF5)
		$(cmake-utils_use_use threads THREADS)
		$(cmake-utils_use_use openmp OPENMP)
	)
	cmake-utils_src_configure
}

src_compile() {
	cmake-utils_src_compile
	use doc && doxygen doxygen.cfg
}

src_install(){
	cmake-utils_src_install
	use doc && dohtml -r doc/html/*
}