cfitsio-3.39.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. FORTRAN_NEEDED=fortran
  5. inherit fortran-2 multilib-minimal
  6. DESCRIPTION="C and Fortran library for manipulating FITS files"
  7. HOMEPAGE="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html"
  8. SRC_URI="https://dev.gentoo.org/~bicatali/distfiles/${P}.tar.gz"
  9. LICENSE="MIT"
  10. SLOT="0/5"
  11. KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris"
  12. IUSE="bzip2 doc examples fortran static-libs +tools threads"
  13. RDEPEND="
  14. sys-libs/zlib[${MULTILIB_USEDEP}]
  15. bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )"
  16. DEPEND="${RDEPEND}
  17. fortran? ( dev-lang/cfortran )"
  18. pkg_setup() {
  19. use fortran && fortran-2_pkg_setup
  20. }
  21. src_prepare() {
  22. # avoid internal cfortran
  23. if use fortran; then
  24. mv cfortran.h cfortran.h.disabled
  25. ln -s "${EPREFIX}"/usr/include/cfortran.h . || die
  26. fi
  27. default
  28. }
  29. multilib_src_configure() {
  30. ECONF_SOURCE="${S}" econf \
  31. $(use_enable fortran) \
  32. $(use_enable static-libs static) \
  33. $(use_enable threads) \
  34. $(use_enable tools) \
  35. $(use_with bzip2)
  36. }
  37. multilib_src_install_all() {
  38. dodoc README README.md CHANGES.md docs/changes.txt docs/cfitsio.doc
  39. use fortran && dodoc docs/fitsio.doc
  40. use doc && dodoc docs/{quick,cfitsio,fpackguide}.pdf
  41. use doc && use fortran && dodoc docs/fitsio.pdf
  42. if use examples; then
  43. insinto /usr/share/doc/${PF}/examples
  44. doins cookbook.c testprog.c speed.c smem.c
  45. use fortran && doins cookbook.f testf77.f
  46. fi
  47. prune_libtool_files --all
  48. }