summaryrefslogtreecommitdiff
blob: d9ec4573b2f22e13a8d10b9e62a6be0f8aa38ec0 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-gfx/qiviewer/qiviewer-0.5.0.ebuild,v 1.1 2012/09/07 07:05:48 pinkbyte Exp $

EAPI="4"
PLOCALES="el es_AR es_ES"
inherit l10n qt4-r2

DESCRIPTION="Lightweight image viewer, similar to eog or viewnior for Gnome"
HOMEPAGE="http://code.google.com/p/qiviewer"
SRC_URI="http://${PN}.googlecode.com/files/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="gif tiff webp"

DEPEND="x11-libs/qt-gui:4[gif=,tiff=]
	webp? ( media-libs/libwebp )"
RDEPEND="${DEPEND}"

S="${WORKDIR}/${PN}/src"

src_prepare() {
	local LOCALE_FILES=""
	add_locale() {
		LOCALE_FILES="${LOCALE_FILES} ${1}.ts"
	}

	# Check for locales added/removed from previous version
	l10n_find_plocales_changes "${S}/translations" "" '.ts'
	# Fill list of available locale files
	l10n_for_each_locale_do add_locale
	sed -i -e "s:TRANSLATIONS += .\+:TRANSLATIONS = ${LOCALE_FILES}:" translations/locale.pri || die 'locale sed failed'
	# Fix mime types in desktop file
	sed -i -e "s:^MimeType=\(.\+\)imaqe/x-xpixrnap;\(.\+\):MimeType=\1\2:" qiviewer.desktop || die 'desktop file sed failed'
	# Use system libwebp
	epatch "${FILESDIR}"/${PN}-use-system-webp.patch

	qt4-r2_src_prepare
}

src_configure() {
	local _webp=
	use webp && _webp="CONFIG+=enable-webp"
	eqmake4 ${PN}.pro $_webp
}

src_install() {
	qt4-r2_src_install
	cd "${WORKDIR}"/"${PN}"
	dodoc AUTHORS ChangeLog README
}