dev-perl/File-BaseDir: Add ~sh keyword wrt bug #665088
[gentoo.git] / media-libs / urt / urt-3.1b-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 inherit eutils toolchain-funcs
7
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"
11
12 LICENSE="URT gif? ( free-noncomm )"
13 SLOT="0"
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"
16
17 RDEPEND="X? ( x11-libs/libXext )
18         gif? ( media-libs/giflib )
19         tiff? ( media-libs/tiff )
20         postscript? ( app-text/ghostscript-gpl )"
21 DEPEND="${RDEPEND}
22         X? ( x11-base/xorg-proto )"
23
24 S=${WORKDIR}
25
26 urt_config() {
27         use $1 && echo "#define $2" || echo "##define $2"
28 }
29
30 src_prepare() {
31         rm -f bin/README
32
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
39
40         # punt bogus manpage #109511
41         rm -f man/man1/template.1
42
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
45
46         sed -i -e '/^CFLAGS/s: -O : :' makefile.hdr
47         cp "${FILESDIR}"/gentoo-config config/gentoo
48         cat >> config/gentoo <<-EOF
49         $(urt_config X X11)
50         $(urt_config postscript POSTSCRIPT)
51         $(urt_config tiff TIFF)
52         ExtraCFLAGS = ${CFLAGS}
53         MFLAGS = ${MAKEOPTS}
54         # prevent circular depend #111455
55         $(has_version media-libs/giflib && urt_config gif GIF)
56         EOF
57 }
58
59 src_configure() {
60         ./Configure config/gentoo || die "config"
61 }
62
63 src_compile() {
64         emake CC=$(tc-getCC)
65 }
66
67 src_install() {
68         mkdir -p man-dest/man{1,3,5}
69         # this just installs it into some local dirs
70         make install || die
71         dobin bin/*
72         dolib.a lib/librle.a
73         insinto /usr/include
74         doins include/rle*.h
75         doman man-dest/man?/*.[135]
76         dodoc *-changes CHANGES* README blurb
77 }