urt-3.1b-r1.ebuild 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils toolchain-funcs
  5. DESCRIPTION="the Utah Raster Toolkit is a library for dealing with raster images"
  6. HOMEPAGE="http://www.cs.utah.edu/gdc/projects/urt/"
  7. SRC_URI="ftp://ftp.iastate.edu/pub/utah-raster/${P}.tar.Z"
  8. LICENSE="URT gif? ( free-noncomm )"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x64-solaris ~x86-solaris"
  11. IUSE="gif postscript tiff X"
  12. RDEPEND="X? ( x11-libs/libXext )
  13. gif? ( media-libs/giflib )
  14. tiff? ( media-libs/tiff )
  15. postscript? ( app-text/ghostscript-gpl )"
  16. DEPEND="${RDEPEND}
  17. X? ( x11-proto/xextproto )"
  18. S=${WORKDIR}
  19. urt_config() {
  20. use $1 && echo "#define $2" || echo "##define $2"
  21. }
  22. src_prepare() {
  23. rm -f bin/README
  24. epatch "${FILESDIR}"/${P}-rle-fixes.patch
  25. epatch "${FILESDIR}"/${P}-compile-updates.patch
  26. epatch "${FILESDIR}"/${P}-tempfile.patch
  27. epatch "${FILESDIR}"/${P}-build-fixes.patch
  28. epatch "${FILESDIR}"/${P}-make.patch
  29. epatch "${FILESDIR}"/${P}-solaris.patch
  30. # punt bogus manpage #109511
  31. rm -f man/man1/template.1
  32. # stupid OS X declares a stack_t type already #107428
  33. sed -i -e 's:stack_t:_urt_stack:g' tools/clock/rleClock.c || die
  34. sed -i -e '/^CFLAGS/s: -O : :' makefile.hdr
  35. cp "${FILESDIR}"/gentoo-config config/gentoo
  36. cat >> config/gentoo <<-EOF
  37. $(urt_config X X11)
  38. $(urt_config postscript POSTSCRIPT)
  39. $(urt_config tiff TIFF)
  40. ExtraCFLAGS = ${CFLAGS}
  41. MFLAGS = ${MAKEOPTS}
  42. # prevent circular depend #111455
  43. $(has_version media-libs/giflib && urt_config gif GIF)
  44. EOF
  45. }
  46. src_configure() {
  47. ./Configure config/gentoo || die "config"
  48. }
  49. src_compile() {
  50. emake CC=$(tc-getCC)
  51. }
  52. src_install() {
  53. mkdir -p man-dest/man{1,3,5}
  54. # this just installs it into some local dirs
  55. make install || die
  56. dobin bin/*
  57. dolib.a lib/librle.a
  58. insinto /usr/include
  59. doins include/rle*.h
  60. doman man-dest/man?/*.[135]
  61. dodoc *-changes CHANGES* README blurb
  62. }