summaryrefslogtreecommitdiff
blob: 26f28c22b851fb6033b7ab89d54df3ebf4907495 (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-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-gfx/cropgui/cropgui-0.1.1-r2.ebuild,v 1.5 2013/10/30 19:25:27 mgorny Exp $

EAPI="5"

PYTHON_COMPAT=( python2_{6,7} )
inherit eutils python-r1

DESCRIPTION="GUI for lossless cropping of jpeg images"
HOMEPAGE="http://emergent.unpythonic.net/01248401946"
SRC_URI="http://media.unpythonic.net/emergent-files/01248401946/${PN}_${PV}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

DEPEND="${PYTHON_DEPS}
	dev-lang/python-exec:0[${PYTHON_USEDEP}]"
RDEPEND="${PYTHON_DEPS}
	virtual/python-imaging[${PYTHON_USEDEP}]
	dev-python/pygobject:2[${PYTHON_USEDEP}]
	dev-python/pygtk:2[${PYTHON_USEDEP}]
"

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

src_prepare() {
	sed -i  -e '/Encoding/d' \
		-e '/Version/d' \
		-e '/MimeType/s/$/&;/' \
		-e '/Categories/s/Application;//' \
		cropgui.desktop || die 'sed on cropgui.desktop failed'
	# bug 471530
	epatch "${FILESDIR}/${P}-PIL.patch"

	epatch_user
}

install_cropgui_wrapper() {
	python_domodule cropgtk.py cropgui_common.py filechooser.py cropgui.glade
	make_wrapper "${PN}-${EPYTHON}" "${PYTHON} $(python_get_sitedir)/${PN}/cropgtk.py"
}

src_install() {
	local python_moduleroot="${PN}"
	python_foreach_impl install_cropgui_wrapper
	dosym python-exec /usr/bin/"${PN}"

	domenu "${PN}.desktop"
	doicon "${PN}.png"
}