1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils toolchain-funcs
9 DESCRIPTION="X Load Image: view images or load them to root window"
10 HOMEPAGE="ftp://ftp.ibiblio.org/pub/Linux/apps/graphics/viewers/X/xli-1.16.README"
11 SRC_URI="http://pantransit.reptiles.org/prog/xli/xli-${SNAPSHOT}.tar.gz"
15 KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
17 RDEPEND="app-arch/bzip2
18 >=media-libs/libpng-1.0.5
27 !media-gfx/xloadimage"
29 S=${WORKDIR}/${PN}-${SNAPSHOT}
32 # avoid conflicts on systems that have zopen in system headers
33 sed -i -e "s:zopen:xli_zopen:g" *
36 -e '/^DEFINES =/s/$/ -DHAVE_GUNZIP -DHAVE_BUNZIP2 /' \
37 -e '/CCOPTIONS =/s/=.*/=/'
39 # This is a hack to avoid a parse error on /usr/include/string.h
40 # when _BSD_SOURCE is defined. This may be a bug in that header.
42 -e '/^#include "xli.h"/i#undef _BSD_SOURCE'
44 # This hack will allow xli to compile using gcc-3.3
46 -e 's/#include <varargs.h>//'
48 # fix potential security issues.
49 EPATCH_OPTS="-F3 -l" epatch "${FILESDIR}"/xli-security-gentoo.diff
51 # Fix scale per bug 282979
52 epatch "${FILESDIR}"/${P}-fix-scale-zoom.patch \
53 "${FILESDIR}"/${P}-libpng14.patch
58 emake CDEBUGFLAGS="${CFLAGS}" CC="$(tc-getCC)" EXTRA_LDOPTIONS="${LDFLAGS}"
64 dosym xli /usr/bin/xsetbg
65 dosym xli /usr/bin/xview
67 dodoc README README.xloadimage ABOUTGAMMA TODO chkgamma.jpg
69 newman xliguide.man xliguide.1
70 newman xlito.man xlito.1
72 insinto /etc/X11/app-defaults
73 newins "${FILESDIR}"/Xli.ad Xli
74 fperms a+r /etc/X11/app-defaults/Xli