summaryrefslogtreecommitdiff
blob: 6dbaa92d0b1a72265f108cbdcf25f28d0d51f802 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/kde-misc/kdiff3/kdiff3-0.9.92.ebuild,v 1.9 2007/08/20 18:42:25 keytoaster Exp $

inherit kde

DESCRIPTION="KDE-based frontend to diff3"
HOMEPAGE="http://kdiff3.sourceforge.net/"
SRC_URI="mirror://sourceforge/kdiff3/${P}.tar.gz"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="amd64 ppc ppc64 sparc x86"
IUSE=""

RDEPEND="sys-apps/diffutils"

need-kde 3.5

LANGS="ar az bg br ca cs cy da de el en_GB es et fr ga gl hi hu is it ja ka lt
nb nl pl pt pt_BR ro ru rw sk sr sr@Latn sv ta tg tr uk zh_CN"

LANGS_DOC="da de en es et fr it nl pt sv"

for lang in ${LANGS}; do
	IUSE="${IUSE} linguas_${lang}"
done

src_unpack() {
	kde_src_unpack

	# Adapted from kde.eclass
	if [[ -z ${LINGUAS} ]]; then
		einfo "You can drop some of the translations of the interface and"
		einfo "documentation by setting the \${LINGUAS} variable to the"
		einfo "languages you want installed."
		einfo
		einfo "Enabling all languages"
	else
		if [[ -n ${LANGS} ]]; then
			MAKE_PO=$(echo $(echo "${LINGUAS} ${LANGS}" | tr ' ' '\n' | sort | uniq -d))
			einfo "Enabling translations for: ${MAKE_PO}"
			local tmp=""
			for x in ${MAKE_PO}; do
				tmp+="${x}.po "
			done
			MAKE_PO=${tmp}
			sed -i -e "s:^POFILES =.*:POFILES = ${MAKE_PO}:" "${KDE_S}/po/Makefile.am" \
				|| die "sed for locale failed"

			rm -f "${KDE_S}/configure"
		fi

		if [[ -n ${LANGS_DOC} ]]; then
			MAKE_DOC=$(echo $(echo "${LINGUAS} ${LANGS_DOC}" | tr ' ' '\n' | sort | uniq -d))
			einfo "Enabling documentation for: ${MAKE_DOC}"
			[[ -n ${MAKE_DOC} ]] && [[ -n ${DOC_DIR_SUFFIX} ]] && MAKE_DOC=$(echo "${MAKE_DOC}" | tr '\n' ' ') && MAKE_DOC="${MAKE_DOC// /${DOC_DIR_SUFFIX} }"
			sed -i -e "s:^SUBDIRS =.*:SUBDIRS = ${MAKE_DOC} :" \
				"${KDE_S}/doc/Makefile.am" || die "sed for locale failed"
			rm -f "${KDE_S}/configure"
		fi
	fi

	# Fixes bug 186942
	epatch ${FILESDIR}/${P}-fix-desktop-file.patch
}