1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils toolchain-funcs
8 DESCRIPTION="the Utah Raster Toolkit is a library for dealing with raster images"
9 HOMEPAGE="http://www.cs.utah.edu/gdc/projects/urt/"
10 SRC_URI="ftp://ftp.iastate.edu/pub/utah-raster/${P}.tar.Z"
12 LICENSE="URT gif? ( free-noncomm )"
14 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"
15 IUSE="gif postscript tiff X"
17 RDEPEND="X? ( x11-libs/libXext )
18 gif? ( media-libs/giflib )
19 tiff? ( media-libs/tiff )
20 postscript? ( app-text/ghostscript-gpl )"
22 X? ( x11-base/xorg-proto )"
27 use $1 && echo "#define $2" || echo "##define $2"
33 epatch "${FILESDIR}"/${P}-rle-fixes.patch
34 epatch "${FILESDIR}"/${P}-compile-updates.patch
35 epatch "${FILESDIR}"/${P}-tempfile.patch
36 epatch "${FILESDIR}"/${P}-build-fixes.patch
37 epatch "${FILESDIR}"/${P}-make.patch
38 epatch "${FILESDIR}"/${P}-solaris.patch
40 # punt bogus manpage #109511
41 rm -f man/man1/template.1
43 # stupid OS X declares a stack_t type already #107428
44 sed -i -e 's:stack_t:_urt_stack:g' tools/clock/rleClock.c || die
46 sed -i -e '/^CFLAGS/s: -O : :' makefile.hdr
47 cp "${FILESDIR}"/gentoo-config config/gentoo
48 cat >> config/gentoo <<-EOF
50 $(urt_config postscript POSTSCRIPT)
51 $(urt_config tiff TIFF)
52 ExtraCFLAGS = ${CFLAGS}
54 # prevent circular depend #111455
55 $(has_version media-libs/giflib && urt_config gif GIF)
60 ./Configure config/gentoo || die "config"
68 mkdir -p man-dest/man{1,3,5}
69 # this just installs it into some local dirs
75 doman man-dest/man?/*.[135]
76 dodoc *-changes CHANGES* README blurb