cblas-reference-20030223-r6.ebuild 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils fortran-2 multilib toolchain-funcs
  5. MyPN="${PN/-reference/}"
  6. DESCRIPTION="C wrapper interface to the F77 reference BLAS implementation"
  7. HOMEPAGE="http://www.netlib.org/blas/"
  8. SRC_URI="http://www.netlib.org/blas/blast-forum/${MyPN}.tgz"
  9. SLOT="0"
  10. LICENSE="public-domain"
  11. IUSE=""
  12. KEYWORDS="alpha amd64 hppa ppc ppc64 ~s390 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
  13. RDEPEND="
  14. virtual/blas
  15. app-eselect/eselect-cblas"
  16. DEPEND="${RDEPEND}
  17. virtual/pkgconfig"
  18. ESELECT_PROF=reference
  19. S="${WORKDIR}/CBLAS"
  20. src_prepare() {
  21. epatch "${FILESDIR}"/${P}-autotool.patch
  22. eautoreconf
  23. cp "${FILESDIR}"/eselect.cblas.reference "${T}"/ || die
  24. sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.cblas.reference || die
  25. if [[ ${CHOST} == *-darwin* ]] ; then
  26. sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
  27. "${T}"/eselect.cblas.reference || die
  28. fi
  29. }
  30. src_configure() {
  31. econf \
  32. --libdir="${EPREFIX}"/usr/$(get_libdir)/blas/reference \
  33. --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
  34. }
  35. src_install() {
  36. default
  37. dodoc cblas_example*c
  38. eselect cblas add $(get_libdir) "${T}"/eselect.cblas.reference ${ESELECT_PROF}
  39. }
  40. pkg_postinst() {
  41. local p=cblas
  42. local current_lib=$(eselect ${p} show | cut -d' ' -f2)
  43. if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
  44. # work around eselect bug #189942
  45. local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
  46. [[ -e ${configfile} ]] && rm -f ${configfile}
  47. eselect ${p} set ${ESELECT_PROF}
  48. elog "${p} has been eselected to ${ESELECT_PROF}"
  49. else
  50. elog "Current eselected ${p} is ${current_lib}"
  51. elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
  52. elog "\t eselect ${p} set ${ESELECT_PROF}"
  53. fi
  54. }