dev-qt/qtgui: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / sys-apps / duc / duc-1.4.1-r1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit autotools
7
8 if [[ "${PV}" == "9999" ]]; then
9         inherit git-r3
10         EGIT_REPO_URI="https://github.com/zevv/duc.git"
11         KEYWORDS=""
12 else
13         KEYWORDS="~amd64 ~x86"
14         SRC_URI="https://github.com/zevv/${PN}/releases/download/${PV}/${P}.tar.gz"
15 fi
16
17 DESCRIPTION="A library and suite of tools for inspecting disk usage"
18 HOMEPAGE="https://github.com/zevv/duc"
19
20 LICENSE="GPL-2"
21 SLOT="0"
22 IUSE="cairo gui -leveldb ncurses -sqlite +tokyocabinet X"
23
24 REQUIRED_USE="
25         ^^ ( tokyocabinet leveldb sqlite )
26         X? ( cairo gui )
27 "
28
29 DEPEND="
30         cairo? ( x11-libs/cairo x11-libs/pango )
31         gui? (
32                 X? (
33                         x11-libs/cairo[X]
34                         x11-libs/libX11
35                         x11-libs/pango[X]
36                 )
37                 !X? ( >=media-libs/glfw-3.0 )
38         )
39         leveldb? ( dev-libs/leveldb )
40         ncurses? ( sys-libs/ncurses:= )
41         sqlite? ( dev-db/sqlite:3 )
42         tokyocabinet? ( dev-db/tokyocabinet )
43 "
44 RDEPEND="${DEPEND}"
45
46 src_unpack() {
47         if [[ "${PV}" == "9999" ]]; then
48                 git-r3_src_unpack
49         else
50                 unpack ${A}
51         fi
52 }
53
54 src_prepare() {
55         sed -i -e "/ldconfig/d" -e "/install-exec-hook/d" Makefile.am || die
56
57         default
58
59         eautoreconf
60 }
61
62 src_configure() {
63         local myconf=( $(use_enable ncurses ui) )
64
65         if use tokyocabinet; then
66                 myconf+=( --with-db-backend=tokyocabinet )
67         elif    use leveldb; then
68                 myconf+=( --with-db-backend=leveldb )
69         else
70                 myconf+=( --with-db-backend=sqlite3 )
71         fi
72
73         # Necessary logic for cairo
74         if use gui && use X; then
75                 # X backend GUI
76                 myconf+=( --enable-x11 --disable-opengl --enable-cairo )
77         elif use gui; then
78                 # OpenGL backend GUI
79                 myconf+=( --disable-x11 --enable-opengl $(use_enable cairo) )
80         else
81                 # No GUI
82                 myconf+=( $(use_enable cairo) --disable-x11 --disable-opengl )
83         fi
84
85         econf ${myconf[@]}
86 }