diff options
author | Maciej Barć <xgqt@gentoo.org> | 2023-09-24 21:43:16 +0200 |
---|---|---|
committer | Maciej Barć <xgqt@gentoo.org> | 2023-09-25 00:02:40 +0200 |
commit | d29be4546cb3714a9422272337eef756e24a7b5b (patch) | |
tree | d47c4515e9d2a1f0795e9c4f2e418eeaf02f50e8 /dev-dotnet/dotnet-sdk/dotnet-sdk-8.0.0_rc1234194-r1.ebuild | |
parent | sys-devel/gcc: Stabilize 13.2.1_p20230826 amd64, #914616 (diff) | |
download | gentoo-d29be4546cb3714a9422272337eef756e24a7b5b.tar.gz gentoo-d29be4546cb3714a9422272337eef756e24a7b5b.tar.bz2 gentoo-d29be4546cb3714a9422272337eef756e24a7b5b.zip |
dev-dotnet/dotnet-sdk: conform to lack of native symlinks
Closes: https://bugs.gentoo.org/914262
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
Diffstat (limited to 'dev-dotnet/dotnet-sdk/dotnet-sdk-8.0.0_rc1234194-r1.ebuild')
-rw-r--r-- | dev-dotnet/dotnet-sdk/dotnet-sdk-8.0.0_rc1234194-r1.ebuild | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/dev-dotnet/dotnet-sdk/dotnet-sdk-8.0.0_rc1234194-r1.ebuild b/dev-dotnet/dotnet-sdk/dotnet-sdk-8.0.0_rc1234194-r1.ebuild new file mode 100644 index 000000000000..eaaa960c01c1 --- /dev/null +++ b/dev-dotnet/dotnet-sdk/dotnet-sdk-8.0.0_rc1234194-r1.ebuild @@ -0,0 +1,142 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Build the tarball: +# - "$" - shell command, +# - ">" - manual action. +# $ git clone --depth 1 \ +# -b v8.0.0-rc.1.23419.4 \ +# https://github.com/dotnet/dotnet \ +# dotnet-sdk-8.0.0_rc1234194 +# $ cd dotnet-sdk-8.0.0_rc1234194 +# > Note the checkout tag hash. +# $ ./prep.sh +# $ rm -fr .git +# $ cd .. +# $ tar --create --auto-compress --file \ +# dotnet-sdk-8.0.0_rc1234194-prepared-gentoo-amd64.tar.xz \ +# dotnet-sdk-8.0.0_rc1234194 +# > Upload dotnet-sdk-8.0.0_rc1234194-prepared-gentoo-amd64.tar.xz + +EAPI=8 + +LLVM_MAX_SLOT=16 +PYTHON_COMPAT=( python3_{10..12} ) + +inherit check-reqs llvm python-any-r1 + +DESCRIPTION=".NET is a free, cross-platform, open-source developer platform" +HOMEPAGE="https://dotnet.microsoft.com/ + https://github.com/dotnet/dotnet/" +SRC_URI=" + amd64? ( https://dev.gentoo.org/~xgqt/distfiles/repackaged/${P}-prepared-gentoo-amd64.tar.xz ) +" + +SDK_SLOT="$(ver_cut 1-2)" +RUNTIME_SLOT="${SDK_SLOT}.0_rc1234194" +SLOT="${SDK_SLOT}/${RUNTIME_SLOT}" + +LICENSE="MIT" +KEYWORDS="~amd64" + +CURRENT_NUGETS_DEPEND=" + ~dev-dotnet/dotnet-runtime-nugets-${RUNTIME_SLOT} +" +EXTRA_NUGETS_DEPEND=" + ~dev-dotnet/dotnet-runtime-nugets-3.1.32 + ~dev-dotnet/dotnet-runtime-nugets-6.0.22 + ~dev-dotnet/dotnet-runtime-nugets-7.0.11 +" +NUGETS_DEPEND=" + ${CURRENT_NUGETS_DEPEND} + ${EXTRA_NUGETS_DEPEND} +" +RDEPEND=" + app-crypt/mit-krb5:0/0 + dev-libs/icu + dev-libs/openssl:= + dev-util/lttng-ust:0/2.12 + sys-libs/zlib:0/1 +" +BDEPEND=" + ${PYTHON_DEPS} + <sys-devel/clang-$(( LLVM_MAX_SLOT + 1 )) + dev-util/cmake + dev-vcs/git +" +IDEPEND=" + app-eselect/eselect-dotnet +" +PDEPEND=" + ${NUGETS_DEPEND} +" + +CHECKREQS_DISK_BUILD="20G" + +# QA_PREBUILT="*" # TODO: Which binaries are created by dotnet itself? + +pkg_setup() { + check-reqs_pkg_setup + llvm_pkg_setup + python-any-r1_pkg_setup +} + +src_prepare() { + default + + unset DOTNET_DATA DOTNET_ROOT + unset NUGET_DATA NUGET_PACKAGES + + export DOTNET_CLI_TELEMETRY_OPTOUT=1 + export MSBUILDDISABLENODEREUSE=1 + export UseSharedCompilation=false + + local dotnet_sdk_tmp_directory="${WORKDIR}/dotnet-sdk-tmp" + mkdir -p "${dotnet_sdk_tmp_directory}" || die + + # This should fix the "PackageVersions.props" problem, + # see below, in src_compile. + sed -e "s|/tmp|${dotnet_sdk_tmp_directory}|g" -i build.sh || die +} + +src_compile() { + # Remove .NET leftover files that can be blocking the build. + # Keep this nonfatal! + local package_versions_path="/tmp/PackageVersions.props" + if [[ -f "${package_versions_path}" ]] ; then + rm "${package_versions_path}" || + ewarn "Failed to remove ${package_versions_path}, build may fail!" + fi + + # The "source_repository" should always be the same. + local source_repository="https://github.com/dotnet/dotnet" + # The "source_version" is dependent on the checkout tag commit. + local source_version="113d797bc90104bb4f1cc51e1a462cf3d4ef18fc" + + ebegin "Building the .NET SDK ${SDK_SLOT}" + bash ./build.sh \ + --clean-while-building \ + --source-repository "${source_repository}" \ + --source-version "${source_version}" + eend ${?} || die "build failed" +} + +src_install() { + local dest="/usr/$(get_libdir)/${PN}-${SDK_SLOT}" + dodir "${dest}" + + ebegin "Extracting the .NET SDK archive" + tar xzf artifacts/*/Release/${PN}-${SDK_SLOT}.*.tar.gz -C "${ED}/${dest}" + eend ${?} || die "extraction failed" + + fperms 0755 "${dest}" + dosym -r "${dest}/dotnet" "/usr/bin/dotnet-${SDK_SLOT}" +} + +pkg_postinst() { + eselect dotnet update ifunset +} + +pkg_postrm() { + eselect dotnet update ifunset +} |