libf2c-20110801-r4.ebuild 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils multilib toolchain-funcs
  5. DESCRIPTION="Library that converts FORTRAN to C source"
  6. HOMEPAGE="http://www.netlib.org/f2c/"
  7. SRC_URI="${HOMEPAGE}/${PN}.zip -> ${P}.zip"
  8. LICENSE="HPND"
  9. SLOT="0"
  10. KEYWORDS="amd64 ppc ppc64 x86 ~x86-fbsd ~amd64-linux ~x86-linux"
  11. IUSE="static-libs"
  12. RDEPEND=""
  13. DEPEND="${RDEPEND}
  14. app-arch/unzip"
  15. S="${WORKDIR}"
  16. src_prepare() {
  17. epatch \
  18. "${FILESDIR}"/20051004-add-ofiles-dep.patch \
  19. "${FILESDIR}"/20090407-link-shared-libf2c-correctly.patch \
  20. "${FILESDIR}"/${P}-main.patch\
  21. "${FILESDIR}"/${P}-64bit-long.patch \
  22. "${FILESDIR}"/${P}-format-security.patch
  23. sed -i -e "s/ld /$(tc-getLD) /" makefile.u || die
  24. }
  25. src_compile() {
  26. emake \
  27. -f makefile.u \
  28. libf2c.so \
  29. CFLAGS="${CFLAGS} -fPIC" \
  30. CC="$(tc-getCC)"
  31. # Clean up files so we can recompile without PIC for the static lib
  32. if use static-libs; then
  33. rm *.o || die "clean failed"
  34. emake \
  35. -f makefile.u \
  36. all \
  37. CFLAGS="${CFLAGS}" \
  38. CC="$(tc-getCC)"
  39. fi
  40. }
  41. src_install () {
  42. dolib libf2c.so.2
  43. dosym libf2c.so.2 /usr/$(get_libdir)/libf2c.so
  44. use static-libs && dolib.a libf2c.a
  45. doheader f2c.h
  46. dodoc README Notice
  47. }