summaryrefslogtreecommitdiff
blob: 65f50d9221c24a515925fc812158b53286dc0843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit git-r3 meson xdg-utils

DESCRIPTION="Minimal image viewer designed for tiling window manager users"
LICENSE="MIT-with-advertising"
HOMEPAGE="https://github.com/eXeC64/imv"
EGIT_REPO_URI="https://github.com/eXeC64/imv"

KEYWORDS=""
SLOT="0"
IUSE="X +freeimage +png jpeg svg gif heif test tiff wayland"
RESTRICT="!test? ( test )"
REQUIRED_USE="
	|| ( X wayland )
"

RDEPEND="
	!sys-apps/renameutils
	dev-libs/icu:=
	media-libs/fontconfig
	media-libs/libsdl2
	media-libs/sdl2-ttf
	X? (
		virtual/glu
		x11-libs/libX11
		x11-libs/libxcb
		x11-libs/libxkbcommon[X]
		x11-libs/pango
	)
	freeimage? ( media-libs/freeimage[png?,jpeg?,tiff?] )
	!freeimage? (
		jpeg? ( media-libs/libjpeg-turbo )
		png? ( media-libs/libpng )
		tiff? ( media-libs/tiff )
	)
	gif? ( media-libs/libnsgif )
	heif? ( media-libs/libheif )
	svg? ( >=gnome-base/librsvg-2.44 )
	wayland? ( dev-libs/wayland )
"
BDEPEND="
	app-text/asciidoc
	test? ( dev-util/cmocka )
"
DEPEND="
	${RDEPEND}
"

src_configure() {
	local WINDOWS
	if use X; then
		if ! use wayland; then
			WINDOWS=x11
		else
			WINDOWS=all
		fi
	else
		if use wayland; then
			WINDOWS=wayland
		fi
	fi

	if ! use test; then
		sed -i -e '/^dep_cmocka/,/^endforeach$/d' meson.build || die
	fi

	local emesonargs=(
		$(meson_feature freeimage)
		$(meson_feature gif libnsgif)
		$(meson_feature heif libheif)
		$(meson_feature svg librsvg)
		$(usex freeimage -Dlibjpeg=disabled -Dlibjpeg=enabled)
		$(usex freeimage -Dlibpng=disabled -Dlibjpeg=enabled)
		$(usex freeimage -Dlibtiff=disabled -Dlibjpeg=enabled)
		-Dwindows=$WINDOWS
	)
	meson_src_configure
}

pkg_postinst() {
	xdg_desktop_database_update
}

pkg_postrm() {
	xdg_desktop_database_update
}