grace-5.1.23-r1.ebuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. FORTRAN_NEEDED=fortran
  5. inherit eutils fortran-2 multilib toolchain-funcs
  6. DESCRIPTION="Motif based XY-plotting tool"
  7. HOMEPAGE="http://plasma-gate.weizmann.ac.il/Grace/"
  8. SRC_URI="
  9. http://pkgs.fedoraproject.org/cgit/grace.git/plain/grace.png
  10. https://dev.gentoo.org/~jlec/distfiles/${PN}.png.tar
  11. ftp://plasma-gate.weizmann.ac.il/pub/${PN}/src/stable/${P}.tar.gz"
  12. SLOT="0"
  13. LICENSE="GPL-2 LGPL-2"
  14. KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
  15. IUSE="fortran fftw jpeg netcdf png"
  16. DEPEND="
  17. media-libs/t1lib
  18. media-libs/tiff:0
  19. sys-libs/zlib
  20. >=x11-libs/motif-2.3:0
  21. x11-libs/xbae
  22. fftw? ( sci-libs/fftw:2.1 )
  23. jpeg? ( virtual/jpeg:0 )
  24. netcdf? ( sci-libs/netcdf )
  25. png? ( media-libs/libpng:0= )"
  26. RDEPEND="${DEPEND}
  27. x11-misc/xdg-utils"
  28. pkg_setup() {
  29. fortran-2_pkg_setup
  30. tc-export CC AR
  31. }
  32. src_prepare() {
  33. # move tmpnam to mkstemp (adapted from debian)
  34. epatch "${FILESDIR}"/${PN}-5.1.22-mkstemp.patch
  35. # fix configure instead of aclocal.m4
  36. epatch "${FILESDIR}"/${PN}-5.1.21-netcdf.patch
  37. # fix for missing defines when fortran is disabled
  38. epatch "${FILESDIR}"/${PN}-5.1.21-fortran.patch
  39. # fix a leak (from freebsd)
  40. epatch \
  41. "${FILESDIR}"/${PN}-5.1.22-dlmodule.patch \
  42. "${FILESDIR}"/${PN}-5.1.22-ldflags.patch
  43. # don't strip if not asked for
  44. sed -i \
  45. -e 's:$(INSTALL_PROGRAM) -s:$(INSTALL_PROGRAM):g' \
  46. {auxiliary,grconvert,src}/Makefile || die
  47. sed -i \
  48. -e 's:$(GRACE_HOME)/bin:$(PREFIX)/bin:g' \
  49. -e "s:\$(GRACE_HOME)/lib:\$(PREFIX)/$(get_libdir):g" \
  50. -e 's:$(GRACE_HOME)/include:$(PREFIX)/include:g' \
  51. -e 's:$(PREFIX)/man:$(PREFIX)/share/man:g' \
  52. Makefile */Makefile || die "sed failed"
  53. sed -i \
  54. -e 's:bin/grconvert:grconvert:' \
  55. -e 's:auxiliary/fdf2fit:fdf2fit:' \
  56. gracerc || die
  57. }
  58. src_configure() {
  59. local myconf
  60. if use fortran; then
  61. myconf="--with-f77=$(tc-getFC)"
  62. else
  63. myconf="--without-f77"
  64. fi
  65. # the configure script just produces a basic Make.conf
  66. # and a config.h
  67. econf \
  68. --disable-pdfdrv \
  69. --disable-xmhtml \
  70. --without-bundled-xbae \
  71. --without-bundled-t1lib \
  72. --enable-grace-home="${EPREFIX}"/usr/share/${PN} \
  73. --with-helpviewer="xdg-open %s" \
  74. --with-editor="xdg-open %s" \
  75. --with-printcmd="lpr" \
  76. --x-includes="${EPREFIX}"/usr/include \
  77. --x-libraries="${EPREFIX}"/usr/$(get_libdir) \
  78. $(use_with fftw) \
  79. $(use_enable fortran f77-wrapper) \
  80. $(use_enable netcdf) \
  81. $(use_enable jpeg jpegdrv) \
  82. $(use_enable png pngdrv) \
  83. ${myconf}
  84. }
  85. src_install() {
  86. default
  87. dosym ../../${PN}/examples /usr/share/doc/${PF}/examples
  88. dosym ../../${PN}/doc /usr/share/doc/${PF}/html
  89. doman "${ED}"/usr/share/doc/${PF}/html/*.1
  90. rm -f "${ED}"/usr/share/doc/${PF}/html/*.1 || die
  91. doicon "${WORKDIR}"/${PN}.png
  92. domenu "${FILESDIR}"/${PN}.desktop
  93. doicon "${WORKDIR}"/${PN}.png
  94. }