summaryrefslogtreecommitdiff
path: root/dev-dotnet/dotnet-runtime-bin/dotnet-runtime-bin-6.0.21.ebuild
blob: 4518487733b352ca00168d50e5b6105b91097e71 (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
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION=".NET is a free, cross-platform, open-source developer platform"
HOMEPAGE="https://dotnet.microsoft.com/"
LICENSE="MIT"

gen_src_uri() {
	echo "$1? (
		elibc_glibc? ( https://dotnetcli.azureedge.net/dotnet/Runtime/${PV}/dotnet-runtime-${PV}-linux-${2:-$1}.tar.gz )
		elibc_musl? ( https://dotnetcli.azureedge.net/dotnet/Runtime/${PV}/dotnet-runtime-${PV}-linux-musl-${2:-$1}.tar.gz )
	)"
}

SRC_URI="
	$(gen_src_uri amd64 x64)
	$(gen_src_uri arm)
	$(gen_src_uri arm64)
"

SLOT="$(ver_cut 1-2)"
IUSE="kerberos lttng"
KEYWORDS="-* ~amd64 ~arm ~arm64"
QA_PREBUILT="*"
RESTRICT+=" splitdebug"
RDEPEND="
	sys-libs/zlib:0/1
	!dev-dotnet/dotnet-sdk-bin:${SLOT}
"
IDEPEND="
	app-eselect/eselect-dotnet
"

S=${WORKDIR}

delete() {
	test -n "$(find . -name "$1" -print -delete)"
}

src_compile() {
	use kerberos || delete libSystem.Net.Security.Native.so || die
	use lttng || delete libcoreclrtraceptprovider.so || die
}

src_install() {
	local dest="opt/${PN}-${SLOT}"
	dodir "${dest%/*}"

	mv "${S}" "${ED}/${dest}" || die
	mkdir "${S}" || die
	fperms 0755 "/${dest}"

	dosym "../../${dest}/dotnet" "/usr/bin/dotnet-bin-${SLOT}"
}

pkg_postinst() {
	eselect dotnet update ifunset
}

pkg_postrm() {
	eselect dotnet update ifunset
}