From 15b5a12fb0d22c329ce3852d88a7b1c6df368a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20Nikkil=C3=A4?= Date: Sun, 6 Aug 2023 21:41:40 +0300 Subject: [PATCH] nongnu: dotnet: Support ARM systems. * nongnu/packages/dotnet.scm (dotnet): Support ARM systems. [source]: Make conditional. [arguments]: Make conditional. [inputs]: Add missing glibc input for RPATH validation. [supported-systems]: List new systems. (dotnet-core-3.1): Support ARM systems. [source]: Make conditional. [arguments]: Make conditional. [supported-systems]: List new systems. --- nongnu/packages/dotnet.scm | 90 ++++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 27 deletions(-) diff --git a/nongnu/packages/dotnet.scm b/nongnu/packages/dotnet.scm index a45a1ca..64b2898 100644 --- a/nongnu/packages/dotnet.scm +++ b/nongnu/packages/dotnet.scm @@ -1,5 +1,6 @@ ;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2021 Jelle Licht +;;; Copyright © 2023 Leo Nikkilä (define-module (nongnu packages dotnet) #:use-module (ice-9 match) @@ -67,7 +68,12 @@ various IDEs and plugins.") (license license:expat))) (define-public dotnet - (let ((dotnet-sdk-version "6.0.9")) + (let ((dotnet-sdk-version "6.0.9") + (dotnet-sdk-target + (match (or (%current-target-system) (%current-system)) + ("armhf-linux" "linux-arm") + ("aarch64-linux" "linux-arm64") + (_ "linux-x64")))) (package (name "dotnet") (version "6.0.401") @@ -75,17 +81,30 @@ various IDEs and plugins.") (origin (method url-fetch/tarbomb) (uri - (string-append "https://download.visualstudio.microsoft.com/download/pr/8159607a-e686-4ead-ac99-b4c97290a5fd/ec6070b1b2cc0651ebe57cf1bd411315/dotnet-sdk-" - version - "-linux-x64.tar.gz")) + (match dotnet-sdk-target + ("linux-arm" + (string-append "https://download.visualstudio.microsoft.com/download/pr/451f282f-dd26-4acd-9395-36cc3a9758e4/f5399d2ebced2ad9640db6283aa9d714/dotnet-sdk-" + version "-" dotnet-sdk-target ".tar.gz")) + ("linux-arm64" + (string-append "https://download.visualstudio.microsoft.com/download/pr/a567a07f-af9d-451a-834c-a746ac299e6b/1d9d74b54cf580f93cad71a6bf7b32be/dotnet-sdk-" + version "-" dotnet-sdk-target ".tar.gz")) + ("linux-x64" + (string-append "https://download.visualstudio.microsoft.com/download/pr/8159607a-e686-4ead-ac99-b4c97290a5fd/ec6070b1b2cc0651ebe57cf1bd411315/dotnet-sdk-" + version "-" dotnet-sdk-target ".tar.gz")))) (sha256 (base32 - "05yr64ffcaf48ripxzcv9nwlzp7r83cy9hz17dm5c0317lhksqch")))) + (match dotnet-sdk-target + ("linux-arm" + "1rypjl48f3fww0kjbngim3r1a2qv47ckr9kzpb70iijip0m89s4w") + ("linux-arm64" + "0znm4i27yvnzbd77vgqwnrcgdkfkwipw2php2y4wp66wsdq3ysib") + ("linux-x64" + "05yr64ffcaf48ripxzcv9nwlzp7r83cy9hz17dm5c0317lhksqch")))))) (build-system binary-build-system) (arguments `(#:patchelf-plan `(("dotnet" - ("gcc:lib" "zlib")) + ("glibc" "gcc:lib" "zlib")) (,,(string-append "shared/Microsoft.NETCore.App/" dotnet-sdk-version "/libSystem.Net.Security.Native.so") @@ -123,17 +142,20 @@ various IDEs and plugins.") (,,(string-append "shared/Microsoft.NETCore.App/" dotnet-sdk-version "/libmscordbi.so") ("gcc:lib")) - (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/" - dotnet-sdk-version - "/runtimes/linux-x64/native/singlefilehost") + (,,(string-append "packs/Microsoft.NETCore.App.Host." + dotnet-sdk-target "/" + dotnet-sdk-version "/runtimes/" + dotnet-sdk-target "/native/singlefilehost") ("gcc:lib" "openssl" "mit-krb5" "zlib" "icu4c")) - (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/" - dotnet-sdk-version - "/runtimes/linux-x64/native/apphost") + (,,(string-append "packs/Microsoft.NETCore.App.Host." + dotnet-sdk-target "/" + dotnet-sdk-version "/runtimes/" + dotnet-sdk-target "/native/apphost") ("gcc:lib")) - (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/" - dotnet-sdk-version - "/runtimes/linux-x64/native/libnethost.so") + (,,(string-append "packs/Microsoft.NETCore.App.Host." + dotnet-sdk-target "/" + dotnet-sdk-version "/runtimes/" + dotnet-sdk-target "/native/libnethost.so") ("gcc:lib")) (,,(string-append "sdk/" version "/AppHostTemplate/apphost") ("gcc:lib")) @@ -165,20 +187,26 @@ various IDEs and plugins.") (files '("share/dotnet"))))) (inputs `(("gcc:lib" ,gcc "lib") + ("glibc" ,glibc) ("icu4c" ,icu4c) ("lttng-ust" ,lttng-ust) ("mit-krb5" ,mit-krb5) ("openssl" ,openssl) ("zlib" ,zlib))) (home-page "https://docs.microsoft.com/en-us/dotnet/") - (supported-systems '("x86_64-linux")) + (supported-systems '("armhf-linux" "aarch64-linux" "x86_64-linux")) (synopsis "Binary build of the @code{.NET} SDK and runtime") (description "@code{.NET} is a cross-platform developer platform for building different types of applications.") (license license:expat)))) (define-public dotnet-core-3.1 - (let ((dotnet-sdk-version "3.1.25")) + (let ((dotnet-sdk-version "3.1.25") + (dotnet-sdk-target + (match (or (%current-target-system) (%current-system)) + ("armhf-linux" "linux-arm") + ("aarch64-linux" "linux-arm64") + (_ "linux-x64")))) (package (name "dotnet") (version "3.1.419") @@ -187,11 +215,17 @@ building different types of applications.") (method url-fetch/tarbomb) (uri (string-append "https://dotnetcli.azureedge.net/dotnet/Sdk/" - version "/dotnet-sdk-" - version "-linux-x64.tar.gz")) + version "/dotnet-sdk-" version "-" + dotnet-sdk-target ".tar.gz")) (sha256 (base32 - "0wg91y5czimcrcv4rfvza9qc1n7l29szbs9qnmr437175zl10ksi")))) + (match dotnet-sdk-target + ("linux-arm" + "0vlmm3y1q5rr9w7p4h5nfzwqmg3h98lb3za6hdd1rgxd5zip9rw2") + ("linux-arm64" + "0jv9caw0krq6hf4zi7chlxcgiqbjw8n6yf1kpy7bdahm51ib7j6n") + ("linux-x64" + "0wg91y5czimcrcv4rfvza9qc1n7l29szbs9qnmr437175zl10ksi")))))) (build-system binary-build-system) (arguments `(#:patchelf-plan @@ -234,13 +268,15 @@ building different types of applications.") (,,(string-append "shared/Microsoft.NETCore.App/" dotnet-sdk-version "/libmscordbi.so") ("gcc:lib")) - (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/" - dotnet-sdk-version - "/runtimes/linux-x64/native/apphost") + (,,(string-append "packs/Microsoft.NETCore.App.Host." + dotnet-sdk-target "/" + dotnet-sdk-version "/runtimes/" + dotnet-sdk-target "/native/apphost") ("gcc:lib")) - (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/" - dotnet-sdk-version - "/runtimes/linux-x64/native/libnethost.so") + (,,(string-append "packs/Microsoft.NETCore.App.Host." + dotnet-sdk-target "/" + dotnet-sdk-version "/runtimes/" + dotnet-sdk-target "/native/libnethost.so") ("gcc:lib")) (,,(string-append "sdk/" version "/AppHostTemplate/apphost") ("gcc:lib")) @@ -281,7 +317,7 @@ building different types of applications.") ("openssl" ,openssl) ("zlib" ,zlib))) (home-page "https://dotnet.microsoft.com/en-us/") - (supported-systems '("x86_64-linux")) + (supported-systems '("armhf-linux" "aarch64-linux" "x86_64-linux")) (synopsis "Binary build of the @code{.NET} SDK and runtime") (description "@code{.NET} is a cross-platform developer platform for building different types of applications.")