dev-qt/qtpositioning: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / media-gfx / imv / imv-4.1.0-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit toolchain-funcs xdg-utils
6
7 DESCRIPTION="Minimal image viewer designed for tiling window manager users"
8 HOMEPAGE="https://github.com/eXeC64/imv"
9 SRC_URI="https://github.com/eXeC64/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
10
11 LICENSE="MIT-with-advertising"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="X +freeimage jpeg libnsgif png +svg test tiff wayland"
15 RESTRICT="!test? ( test )"
16 REQUIRED_USE="
17         || ( X wayland )
18 "
19
20 RDEPEND="
21         !sys-apps/renameutils
22         dev-libs/icu:=
23         media-libs/fontconfig
24         media-libs/libsdl2
25         media-libs/sdl2-ttf
26         X? (
27                 virtual/glu
28                 x11-libs/libX11
29                 x11-libs/libxcb
30                 x11-libs/libxkbcommon[X]
31                 x11-libs/pango
32         )
33         freeimage? ( media-libs/freeimage )
34         jpeg? ( media-libs/libjpeg-turbo )
35         libnsgif? ( media-libs/libnsgif )
36         png? ( media-libs/libpng )
37         svg? ( gnome-base/librsvg )
38         tiff? ( media-libs/tiff )
39         wayland? ( dev-libs/wayland )
40 "
41 BDEPEND="
42         app-text/asciidoc
43         test? ( dev-util/cmocka )
44 "
45 DEPEND="
46         ${RDEPEND}
47 "
48
49 src_prepare() {
50         default
51         sed -i -e 's|pkg-config|$(PKG_CONFIG)|g' Makefile || die
52 }
53
54 src_configure() {
55         tc-export PKG_CONFIG
56         local WINDOWS
57         if use X; then
58                 if ! use wayland; then
59                         WINDOWS=x11
60                 else
61                         WINDOWS=all
62                 fi
63         else
64                 if use wayland; then
65                         WINDOWS=wayland
66                 fi
67         fi
68
69         BACKENDS=(
70                 BACKEND_FREEIMAGE=$(usex freeimage)
71                 BACKEND_JPEG=$(usex jpeg)
72                 BACKEND_LIBNSGIF=$(usex libnsgif)
73                 BACKEND_LIBPNG=$(usex png)
74                 BACKEND_LIBRSVG=$(usex svg)
75                 BACKEND_LIBTIFF=$(usex tiff)
76                 WINDOWS=${WINDOWS}
77         )
78 }
79
80 src_compile() {
81         emake ${BACKENDS[@]}
82 }
83
84 src_install() {
85         emake ${BACKENDS[@]} DESTDIR="${D}" install
86 }
87
88 pkg_postinst() {
89         xdg_desktop_database_update
90 }
91
92 pkg_postrm() {
93         xdg_desktop_database_update
94 }