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