summaryrefslogtreecommitdiff
blob: e8ec6d12e9198144981f57738e86d062ea2329d9 (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit flag-o-matic qmake-utils toolchain-funcs

COMMIT="5023138d7c35c4667c938b853e5ea89737334e92"
DESCRIPTION="A better i7 (and now i3, i5) reporting tool for Linux"
HOMEPAGE="https://github.com/ajaiantilal/i7z"
SRC_URI="https://github.com/ajaiantilal/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="qt4 qt5"

RDEPEND="sys-libs/ncurses:0=
	qt5? (
		dev-qt/qtcore:5=
		dev-qt/qtgui:5=
		dev-qt/qtwidgets:5=
	)
	!qt5? ( qt4? (
		dev-qt/qtcore:4=
		dev-qt/qtgui:4=
	) )"

DEPEND="${RDEPEND}"

PATCHES=(
	"${FILESDIR}"/i7z-0.27.2-ncurses.patch
	"${FILESDIR}"/qt5.patch
	"${FILESDIR}"/gcc5.patch
)

S="${WORKDIR}/${PN}-${COMMIT}"

src_configure() {
	# The GUI segfaults with -O1. None of the documented flags make a
	# difference. There may not be a specific flag for the culprit.
	filter-flags "-O*"

	tc-export CC
	cd GUI || die

	if use qt5; then
		eqmake5 ${PN}_GUI.pro
	elif use qt4; then
		eqmake4 ${PN}_GUI.pro
	fi
}

src_compile() {
	default

	if use qt5 || use qt4; then
		emake -C GUI clean
		emake -C GUI
	fi
}

src_install() {
	emake DESTDIR="${ED}" docdir=/usr/share/doc/${PF} install

	if use qt5 || use qt4; then
		dosbin GUI/i7z_GUI
	fi
}