aboutsummaryrefslogtreecommitdiffstats
path: root/dev-vcs/sublime-merge/sublime-merge-2125.ebuild
blob: ab9dc7f713758d77fe8fd22969f66460de1cb6d8 (plain) (blame)
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
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop wrapper xdg

case "$CHOST" in
	x86_64-*)	MY_ARCH=x64;;
	aarch64-*)	MY_ARCH=arm64;;
	*)	eerror "Please update MY_ARCH" ;;
esac
MY_PN="${PN/-/_}-${MY_ARCH}-tar"
echo "$MY_PN"

DESCRIPTION="Sophisticated GUI frontend for Git"
HOMEPAGE="https://www.sublimemerge.com"
SRC_URI="
	amd64? ( https://download.sublimetext.com/sublime_merge_build_${PV}_x64.tar.xz )
	arm64? ( https://download.sublimetext.com/sublime_merge_build_${PV}_arm64.tar.xz )
"
S="${WORKDIR}/${MY_PN}"

LICENSE="Sublime"
SLOT="0"
KEYWORDS="-* ~amd64 ~arm64"
IUSE="dbus"
RESTRICT="bindist mirror strip"

RDEPEND="
	dev-libs/glib:2
	sys-libs/glibc
	x11-libs/gtk+:3
	x11-libs/libX11
	dbus? ( sys-apps/dbus )"

QA_PREBUILT="*"

src_install() {
	insinto /opt/${MY_PN}
	doins -r Packages Icon # /Icon is used at runtime by the application
	doins changelog.txt sublime_merge.desktop

	# sublime_merge looks for /opt/sublime_text/sublime_text
	exeinto /opt/${MY_PN}
	doexe crash_handler git-credential-sublime ssh-askpass-sublime sublime_merge

	# sublime-text sets its WM_CLASS based on its argv[0]. A wrapper script is
	# used instead of a symlink to preserve a consistent WM_CLASS regardless of
	# how the application is launched. This causes the WM_CLASS to be
	# "sublime_text" which matches the .desktop entry.
	make_wrapper smerge "/opt/${MY_PN}/sublime_merge --fwdargv0 \"\$0\""
	domenu sublime_merge.desktop

	local size
	for size in 16 32 48 128 256; do
		doicon --size ${size} Icon/${size}x${size}/${PN}.png
	done
}

pkg_postinst() {
	xdg_pkg_postinst
}