sys-process/glances: revbump 3.1.4.1, add missing doc dep
[gentoo.git] / media-gfx / fbida / fbida-2.12.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 inherit eutils toolchain-funcs
6
7 DESCRIPTION="Image viewers for the framebuffer console (fbi) and X11 (ida)"
8 HOMEPAGE="https://www.kraxel.org/blog/linux/fbida/"
9 SRC_URI="
10         https://www.kraxel.org/releases/${PN}/${P}.tar.gz
11         mirror://gentoo/ida.png.bz2
12 "
13 LICENSE="GPL-2 IJG"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 arm hppa ppc ppc64 sparc x86"
16 IUSE="curl fbcon ghostscript +gif lirc +png scanner +tiff X +webp"
17 REQUIRED_USE="
18         ghostscript? ( tiff )
19 "
20
21 CDEPEND="
22         !media-gfx/fbi
23         app-text/poppler
24         >=media-libs/fontconfig-2.2
25         >=media-libs/freetype-2.0
26         media-libs/libepoxy
27         media-libs/libexif
28         media-libs/mesa[X(+)]
29         virtual/jpeg:*
30         virtual/ttf-fonts
31         x11-libs/cairo[opengl]
32         x11-libs/libdrm
33         curl? ( net-misc/curl )
34         gif? ( media-libs/giflib:= )
35         lirc? ( app-misc/lirc )
36         png? ( media-libs/libpng:* )
37         scanner? ( media-gfx/sane-backends )
38         tiff? ( media-libs/tiff:* )
39         webp? ( media-libs/libwebp )
40         X? (
41                 >=x11-libs/motif-2.3:0
42                 x11-libs/libX11
43                 x11-libs/libXpm
44                 x11-libs/libXt
45         )
46 "
47
48 DEPEND="
49         ${CDEPEND}
50         X? ( x11-base/xorg-proto )
51 "
52
53 RDEPEND="
54         ${CDEPEND}
55         ghostscript? (
56                 app-text/ghostscript-gpl
57         )
58 "
59
60 src_prepare() {
61         epatch \
62                 "${FILESDIR}"/ida-desktop.patch \
63                 "${FILESDIR}"/${PN}-2.10-giflib-4.2.patch \
64                 "${FILESDIR}"/${PN}-2.10-fprintf-format.patch
65
66         tc-export CC CPP
67
68         # upstream omission?
69         echo ${PV} > VERSION
70 }
71
72 src_configure() {
73         # Let autoconf do its job and then fix things to build fbida
74         # according to our specifications
75         emake Make.config
76
77         gentoo_fbida() {
78                 local useflag=${1}
79                 local config=${2}
80
81                 local option="no"
82                 use ${useflag} && option="yes"
83
84                 sed -i \
85                         -e "s|HAVE_${config}.*|HAVE_${config} := ${option}|" \
86                         "${S}/Make.config" || die
87         }
88
89         gentoo_fbida X MOTIF
90         gentoo_fbida curl LIBCURL
91         gentoo_fbida fbcon LINUX_FB_H
92         gentoo_fbida gif LIBUNGIF
93         gentoo_fbida lirc LIBLIRC
94         gentoo_fbida ghostscript LIBTIFF
95         gentoo_fbida png LIBPNG
96         gentoo_fbida scanner LIBSANE
97         gentoo_fbida tiff LIBTIFF
98         gentoo_fbida webp LIBWEBP
99 }
100
101 src_compile() {
102         emake verbose=yes
103 }
104
105 src_install() {
106         emake \
107                 DESTDIR="${D}" \
108                 STRIP="" \
109                 prefix=/usr \
110                 install
111
112         dodoc README
113
114         if use fbcon && ! use ghostscript; then
115                 rm \
116                         "${D}"/usr/bin/fbgs \
117                         "${D}"/usr/share/man/man1/fbgs.1 \
118                         || die
119         fi
120
121         if use X ; then
122                 doicon "${WORKDIR}"/ida.png
123                 domenu desktop/ida.desktop
124         fi
125 }