1 |
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
## Build the tarball:
|
5 |
|
## ./build.sh --configuration Release --architecture x64 \
|
6 |
|
## /p:ArcadeBuildTarball=true /p:TarballDir="$(pwd)/dotnet-sdk-7.0.105"
|
7 |
|
## cd dotnet-sdk-7.0.105
|
8 |
|
## ./prep.sh --bootstrap
|
9 |
|
## cd ..
|
10 |
|
## tar --create --auto-compress --file dotnet-sdk-7.0.105.tar.xz dotnet-sdk-7.0.105
|
11 |
|
## mv dotnet-sdk-7.0.105.tar.xz dotnet-sdk-7.0.1050-prepared-gentoo-amd64.tar.xz
|
12 |
|
## upload dotnet-sdk-7.0.1050-amd64.tar.xz
|
|
4 |
# Build the tarball:
|
|
5 |
# - "$" - shell command,
|
|
6 |
# - ">" - manual action.
|
|
7 |
# $ git clone --depth 1 \
|
|
8 |
# -b v8.0.0-rc.1.23419.4 \
|
|
9 |
# https://github.com/dotnet/dotnet \
|
|
10 |
# dotnet-sdk-8.0.0_rc1234194
|
|
11 |
# $ cd dotnet-sdk-8.0.0_rc1234194
|
|
12 |
# > Note the checkout tag hash.
|
|
13 |
# $ ./prep.sh
|
|
14 |
# $ rm -fr .git
|
|
15 |
# $ cd ..
|
|
16 |
# $ tar --create --auto-compress --file \
|
|
17 |
# dotnet-sdk-8.0.0_rc1234194-prepared-gentoo-amd64.tar.xz \
|
|
18 |
# dotnet-sdk-8.0.0_rc1234194
|
|
19 |
# > Upload dotnet-sdk-8.0.0_rc1234194-prepared-gentoo-amd64.tar.xz
|
13 |
20 |
|
14 |
21 |
EAPI=8
|
15 |
22 |
|
... | ... | |
19 |
26 |
inherit check-reqs llvm python-any-r1
|
20 |
27 |
|
21 |
28 |
DESCRIPTION=".NET is a free, cross-platform, open-source developer platform"
|
22 |
|
HOMEPAGE="https://dotnet.microsoft.com/"
|
|
29 |
HOMEPAGE="https://dotnet.microsoft.com/
|
|
30 |
https://github.com/dotnet/dotnet/"
|
23 |
31 |
SRC_URI="
|
24 |
32 |
amd64? ( https://dev.gentoo.org/~xgqt/distfiles/repackaged/${P}-prepared-gentoo-amd64.tar.xz )
|
25 |
33 |
"
|
26 |
34 |
|
27 |
35 |
SDK_SLOT="$(ver_cut 1-2)"
|
28 |
|
RUNTIME_SLOT="${SDK_SLOT}.5"
|
|
36 |
RUNTIME_SLOT="${SDK_SLOT}.0_rc1234194"
|
29 |
37 |
SLOT="${SDK_SLOT}/${RUNTIME_SLOT}"
|
30 |
38 |
|
31 |
39 |
LICENSE="MIT"
|
32 |
40 |
KEYWORDS="~amd64"
|
33 |
41 |
|
34 |
|
BDEPEND="
|
35 |
|
${PYTHON_DEPS}
|
36 |
|
<sys-devel/clang-$(( LLVM_MAX_SLOT + 1 ))
|
37 |
|
dev-util/cmake
|
38 |
|
dev-vcs/git
|
|
42 |
CURRENT_NUGETS_DEPEND="
|
|
43 |
~dev-dotnet/dotnet-runtime-nugets-${RUNTIME_SLOT}
|
|
44 |
"
|
|
45 |
EXTRA_NUGETS_DEPEND="
|
|
46 |
~dev-dotnet/dotnet-runtime-nugets-3.1.32
|
|
47 |
~dev-dotnet/dotnet-runtime-nugets-6.0.22
|
|
48 |
~dev-dotnet/dotnet-runtime-nugets-7.0.11
|
|
49 |
"
|
|
50 |
NUGETS_DEPEND="
|
|
51 |
${CURRENT_NUGETS_DEPEND}
|
|
52 |
${EXTRA_NUGETS_DEPEND}
|
39 |
53 |
"
|
40 |
54 |
RDEPEND="
|
41 |
55 |
app-crypt/mit-krb5:0/0
|
... | ... | |
44 |
58 |
dev-util/lttng-ust:0/2.12
|
45 |
59 |
sys-libs/zlib:0/1
|
46 |
60 |
"
|
47 |
|
IDEPEND="app-eselect/eselect-dotnet"
|
|
61 |
BDEPEND="
|
|
62 |
${PYTHON_DEPS}
|
|
63 |
<sys-devel/clang-$(( LLVM_MAX_SLOT + 1 ))
|
|
64 |
dev-util/cmake
|
|
65 |
dev-vcs/git
|
|
66 |
"
|
|
67 |
IDEPEND="
|
|
68 |
app-eselect/eselect-dotnet
|
|
69 |
"
|
48 |
70 |
PDEPEND="
|
49 |
|
~dev-dotnet/dotnet-runtime-nugets-${RUNTIME_SLOT}
|
50 |
|
~dev-dotnet/dotnet-runtime-nugets-3.1.32
|
51 |
|
~dev-dotnet/dotnet-runtime-nugets-6.0.16
|
|
71 |
${NUGETS_DEPEND}
|
52 |
72 |
"
|
53 |
73 |
|
54 |
74 |
CHECKREQS_DISK_BUILD="20G"
|
... | ... | |
70 |
90 |
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
71 |
91 |
export MSBUILDDISABLENODEREUSE=1
|
72 |
92 |
export UseSharedCompilation=false
|
|
93 |
|
|
94 |
local dotnet_sdk_tmp_directory="${WORKDIR}/dotnet-sdk-tmp"
|
|
95 |
mkdir -p "${dotnet_sdk_tmp_directory}" || die
|
|
96 |
|
|
97 |
# This should fix the "PackageVersions.props" problem,
|
|
98 |
# see below, in src_compile.
|
|
99 |
sed -e "s|/tmp|${dotnet_sdk_tmp_directory}|g" -i build.sh || die
|
73 |
100 |
}
|
74 |
101 |
|
75 |
102 |
src_compile() {
|
76 |
|
# Remove .NET leftover files that block build.
|
77 |
|
if [[ -f /tmp/PackageVersions.props ]] ; then
|
78 |
|
rm /tmp/PackageVersions.props # nonfatal
|
|
103 |
# Remove .NET leftover files that can be blocking the build.
|
|
104 |
# Keep this nonfatal!
|
|
105 |
local package_versions_path="/tmp/PackageVersions.props"
|
|
106 |
if [[ -f "${package_versions_path}" ]] ; then
|
|
107 |
rm "${package_versions_path}" ||
|
|
108 |
ewarn "Failed to remove ${package_versions_path}, build may fail!"
|
79 |
109 |
fi
|
80 |
110 |
|
81 |
|
ebegin "Building .NET SDK ${SDK_SLOT}"
|
82 |
|
bash ./build.sh --clean-while-building
|
|
111 |
# The "source_repository" should always be the same.
|
|
112 |
local source_repository="https://github.com/dotnet/dotnet"
|
|
113 |
# The "source_version" is dependent on the checkout tag commit.
|
|
114 |
local source_version="113d797bc90104bb4f1cc51e1a462cf3d4ef18fc"
|
|
115 |
|
|
116 |
ebegin "Building the .NET SDK ${SDK_SLOT}"
|
|
117 |
bash ./build.sh \
|
|
118 |
--clean-while-building \
|
|
119 |
--source-repository "${source_repository}" \
|
|
120 |
--source-version "${source_version}"
|
83 |
121 |
eend ${?} || die "build failed"
|
84 |
122 |
}
|
85 |
123 |
|
86 |
124 |
src_install() {
|
87 |
|
local dest=/usr/$(get_libdir)/${PN}-${SDK_SLOT}
|
88 |
|
dodir ${dest}
|
|
125 |
local dest="/usr/$(get_libdir)/${PN}-${SDK_SLOT}"
|
|
126 |
dodir "${dest}"
|
89 |
127 |
|
90 |
|
ebegin "Extracting SDK archive"
|
91 |
|
tar xzf artifacts/*/Release/${P}-*.tar.gz -C "${ED}"/${dest}
|
|
128 |
ebegin "Extracting the .NET SDK archive"
|
|
129 |
tar xzf artifacts/*/Release/${PN}-${SDK_SLOT}.*.tar.gz -C "${ED}/${dest}"
|
92 |
130 |
eend ${?} || die "extraction failed"
|
93 |
131 |
|
94 |
|
fperms 0755 ${dest}
|
95 |
|
dosym -r ${dest}/dotnet /usr/bin/dotnet-${SDK_SLOT}
|
|
132 |
fperms 0755 "${dest}"
|
|
133 |
dosym -r "${dest}/dotnet" "/usr/bin/dotnet-${SDK_SLOT}"
|
96 |
134 |
}
|
97 |
135 |
|
98 |
136 |
pkg_postinst() {
|