1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_6 )
8 inherit cmake-utils eutils toolchain-funcs fortran-2 python-r1
10 DESCRIPTION="Core libraries for the Common Astronomy Software Applications"
11 HOMEPAGE="https://github.com/casacore/casacore"
12 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
15 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="+c++11 +data doc fftw hdf5 openmp python threads test"
18 RESTRICT="!test? ( test )"
19 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
22 sci-astronomy/wcslib:0=
27 data? ( sci-astronomy/casa-data )
28 fftw? ( sci-libs/fftw:3.0= )
29 hdf5? ( sci-libs/hdf5:0= )
32 dev-libs/boost:0=[python,${PYTHON_USEDEP}]
33 dev-python/numpy[${PYTHON_USEDEP}]
38 doc? ( app-doc/doxygen )
39 test? ( sci-astronomy/casa-data )
43 "${FILESDIR}"/${PN}-2.3.0-disable-class-and-collaboration-graph-generation.patch
44 "${FILESDIR}"/${PN}-2.3.0-disable-known-test-failures.patch
45 "${FILESDIR}"/${PN}-2.3.0-disable-tests-that-require-data-tables.patch
46 "${FILESDIR}"/${PN}-2.3.0-do-not-install-test-and-demonstration-executables.patch
47 "${FILESDIR}"/${PN}-2.3.0-fix-FTBFS-tStatisticsUtilities-tLatticeStatistics-and-tLC.patch
48 "${FILESDIR}"/${PN}-2.3.0-fix-too-small-int-type-for-memory-on-32-bit-machines.patch
49 "${FILESDIR}"/${PN}-2.3.0-loose-some-tests-tFFTServer-tests.patch
50 "${FILESDIR}"/${PN}-2.3.0-make-the-check-for-NFS-a-bit-more-portable-BSD.patch
51 "${FILESDIR}"/${PN}-2.3.0-use-the-correct-symbol-to-detect-Linux-OS.patch
55 if [[ $(tc-getCC)$ == *gcc* ]] && [[ ${MERGE_TYPE} != binary ]]; then
56 use c++11 && [[ $(gcc-major-version) -lt 4 ]] || \
57 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ]] ) && \
58 die "You are using gcc but gcc-4.7 or higher is required for C++11"
60 use openmp && tc-check-openmp
64 cmake-utils_src_prepare
65 sed -e '/python-py/s/^.*$/find_package(Boost REQUIRED COMPONENTS python)/' \
66 -i python3/CMakeLists.txt || die
70 has_version sci-libs/hdf5[mpi] && export CXX=mpicxx
74 -DDATA_DIR="${EPREFIX}/usr/share/casa/data"
75 -DBUILD_TESTING="$(usex test)"
76 -DCXX11="$(usex c++11)"
77 -DUSE_FFTW3="$(usex fftw)"
78 -DUSE_HDF5="$(usex hdf5)"
79 -DUSE_OPENMP="$(usex openmp)"
80 -DUSE_THREADS="$(usex threads)"
82 python_set_options() {
83 if python_is_python3; then
85 -DPYTHON3_EXECUTABLE="${PYTHON}"
90 -DPYTHON2_EXECUTABLE="${PYTHON}"
95 use python && python_foreach_impl python_set_options
96 cmake-utils_src_configure
100 cmake-utils_src_compile
102 doxygen doxygen.cfg || die
107 cmake-utils_src_install
109 insinto /usr/share/doc/${PF}
111 docompress -x /usr/share/doc/${PF}/html