summaryrefslogtreecommitdiff
blob: 1bc88c4fed7bb769c6cd7a34b43fa340f2a693db (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_EXT=1
DISTUTILS_SINGLE_IMPL=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..12} )
inherit distutils-r1

DESCRIPTION="Tweak tool for the MATE Desktop"
HOMEPAGE="https://github.com/ubuntu-mate/mate-tweak"
SRC_URI="https://github.com/ubuntu-mate/mate-tweak/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="dropdown"

RDEPEND="
	$(python_gen_cond_dep '
		dev-python/distro[${PYTHON_USEDEP}]
		dev-python/psutil[${PYTHON_USEDEP}]
		dev-python/setproctitle[${PYTHON_USEDEP}]
	')
	gnome-base/dconf
	x11-libs/libnotify
	mate-base/libmatekbd
	mate-base/mate-panel
	dropdown? ( x11-terms/tilda )
"

BDEPEND="
	dev-util/intltool
	net-misc/rsync
	sys-devel/gettext
"

PATCHES=(
	"${FILESDIR}/mate-tweak-22.10.0-avoid-distutilsextra.patch"
)

pkg_setup() {
	python-single-r1_pkg_setup
}

src_prepare() {
	# Correct paths in mate-tweak script - makes "Window Behavior" options work
	# from https://github.com/shiznix/unity-gentoo/blob/master/mate-extra/mate-tweak/mate-tweak-22.10.0_p_p0_p01.ebuild
	sed -e "s:brisk-menu/brisk-menu:brisk-menu:g" \
		-e "s:/usr/lib/mate-netbook/mate-window-picker-applet:/usr/libexec/mate-window-picker-applet:g" \
		-e "s:/usr/lib/MULTIARCH:MULTIARCH:g" \
		-e "s:'/usr/lib/' + self.multiarch + :self.multiarch + :g" \
		-e "/self.multiarch = sysconfig.get_config_var/c\        self.multiarch = os.path.join('/','usr','libexec')" \
		-e "s:self.multiarch + '/mate-panel/libappmenu-mate.so':'/usr/$(get_libdir)/mate-panel/libappmenu-mate.so':g" \
			-i mate-tweak || die

	distutils-r1_src_prepare
}

src_install() {
	distutils-r1_src_install
	rsync -av "${ED}"/usr/lib/python*/site-packages/usr/ "${ED}"/usr || die
	rm -r "${ED}"/usr/lib/python*/site-packages/{usr,__pycache__,setup.py} || die
	python_fix_shebang "${ED}"
}