casacore-2.0.3.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. # python3 is experimental and only one python is supported
  5. PYTHON_COMPAT=( python2_7 )
  6. inherit cmake-utils eutils toolchain-funcs fortran-2 python-single-r1
  7. DESCRIPTION="Core libraries for the Common Astronomy Software Applications"
  8. HOMEPAGE="https://github.com/casacore/casacore"
  9. SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  10. LICENSE="GPL-2"
  11. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
  12. SLOT="0"
  13. IUSE="c++11 +data doc fftw hdf5 openmp python threads test"
  14. RDEPEND="
  15. sci-astronomy/wcslib:0=
  16. sci-libs/cfitsio:0=
  17. sys-libs/readline:0=
  18. virtual/blas
  19. virtual/lapack
  20. data? ( sci-astronomy/casa-data )
  21. fftw? ( sci-libs/fftw:3.0= )
  22. hdf5? ( sci-libs/hdf5:0= )
  23. python? ( dev-libs/boost:0=[python,${PYTHON_USEDEP}]
  24. dev-python/numpy[${PYTHON_USEDEP}] )"
  25. DEPEND="${RDEPEND}
  26. virtual/pkgconfig
  27. doc? ( app-doc/doxygen )
  28. test? ( sci-astronomy/casa-data )"
  29. pkg_pretend() {
  30. if [[ $(tc-getCC)$ == *gcc* ]] && [[ ${MERGE_TYPE} != binary ]]; then
  31. use c++11 && [[ $(gcc-major-version) -lt 4 ]] || \
  32. ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ]] ) && \
  33. die "You are using gcc but gcc-4.7 or higher is required for C++11"
  34. use openmp && ! tc-has-openmp && \
  35. die "You are using gcc but without OpenMP capabilities that you requested"
  36. fi
  37. }
  38. pkg_setup() {
  39. use python && python-single-r1_pkg_setup
  40. fortran-2_pkg_setup
  41. }
  42. src_configure() {
  43. has_version sci-libs/hdf5[mpi] && export CXX=mpicxx
  44. local mycmakeargs=(
  45. -DENABLE_SHARED=ON
  46. -DPYTHON_EXECUTABLE="${PYTHON}"
  47. -DDATA_DIR="${EPREFIX}/usr/share/casa/data"
  48. -DBUILD_PYTHON="$(usex python)"
  49. -DBUILD_TESTING="$(usex test)"
  50. -DCXX11="$(usex c++11)"
  51. -DUSE_FFTW3="$(usex fftw)"
  52. -DUSE_HDF5="$(usex hdf5)"
  53. -DUSE_OPENMP="$(usex openmp)"
  54. -DUSE_THREADS="$(usex threads)"
  55. )
  56. cmake-utils_src_configure
  57. }
  58. src_compile() {
  59. cmake-utils_src_compile
  60. if use doc; then
  61. doxygen doxygen.cfg || die
  62. fi
  63. }
  64. src_install(){
  65. cmake-utils_src_install
  66. # conflict, bug #575726 (gone in version > 2.0.4)
  67. mv "${ED}"usr/bin/show{,casa}table || die
  68. if use doc; then
  69. insinto /usr/share/doc/${PF}
  70. doins -r doc/html
  71. fi
  72. }