summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelle Licht <jlicht@fsfe.org>2021-03-11 21:51:53 +0100
committerJelle Licht <jlicht@fsfe.org>2021-03-20 14:02:38 +0100
commit1e57ef8dc4e1130e40f6d8e17218ca82c8512d9e (patch)
tree2a4e5341d21ec8f85f38a10c8a547ca9db953079
parent4363c3fcfe8ee3e902733a2899299e140b5e06ec (diff)
nongnu: Add dotnet.
* nongnu/packages/dotnet.scm (dotnet): New variable.
-rw-r--r--nongnu/packages/dotnet.scm111
1 files changed, 111 insertions, 0 deletions
diff --git a/nongnu/packages/dotnet.scm b/nongnu/packages/dotnet.scm
index d0af374..fa4c815 100644
--- a/nongnu/packages/dotnet.scm
+++ b/nongnu/packages/dotnet.scm
@@ -80,3 +80,114 @@
Roslyn workspaces. It provides project dependencies and C# language services to
various IDEs and plugins.")
(license license:expat)))
+
+(define-public dotnet
+ (let ((dotnet-sdk-version "5.0.4"))
+ (package
+ (name "dotnet")
+ (version "5.0.201")
+ (source
+ (origin
+ (method url-fetch/tarbomb)
+ (uri
+ (string-append "https://dotnetcli.azureedge.net/dotnet/Sdk/"
+ version "/dotnet-sdk-"
+ version "-linux-x64.tar.gz"))
+ (sha256
+ (base32
+ "0hdkwz39ql7madg5dzy50by6q4vyagpwjvjn34ks730yhf3p1xwz"))))
+ (build-system binary-build-system)
+ (arguments
+ `(#:patchelf-plan
+ `(("dotnet"
+ ("gcc:lib" "zlib"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version
+ "/libSystem.Net.Security.Native.so")
+ ("mit-krb5"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version
+ "/libSystem.Security.Cryptography.Native.OpenSsl.so")
+ ("openssl"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version
+ "/libSystem.IO.Compression.Native.so")
+ ("zlib"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version
+ "/libcoreclrtraceptprovider.so")
+ ("gcc:lib" "lttng-ust"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version "/createdump")
+ ("gcc:lib"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version "/libclrjit.so")
+ ("gcc:lib"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version "/libcoreclr.so")
+ ("gcc:lib" "icu4c"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version "/libdbgshim.so")
+ ("gcc:lib"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version "/libhostpolicy.so")
+ ("gcc:lib"))
+ (,,(string-append "shared/Microsoft.NETCore.App/"
+ dotnet-sdk-version "/libmscordaccore.so")
+ ("gcc:lib"))
+ (,,(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")
+ ("gcc:lib" "openssl" "mit-krb5" "zlib" "icu4c"))
+ (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/"
+ dotnet-sdk-version
+ "/runtimes/linux-x64/native/apphost")
+ ("gcc:lib"))
+ (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/"
+ dotnet-sdk-version
+ "/runtimes/linux-x64/native/libnethost.so")
+ ("gcc:lib"))
+ (,,(string-append "sdk/" version "/AppHostTemplate/apphost")
+ ("gcc:lib"))
+ (,,(string-append "host/fxr/" dotnet-sdk-version "/libhostfxr.so")
+ ("gcc:lib")))
+ #:install-plan
+ `(("." "share/dotnet/"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'patchelf 'patchelf-writable
+ (lambda _
+ (for-each make-file-writable (find-files "."))))
+ (add-after 'install 'install-wrapper
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin-dir (string-append out "/bin"))
+ (dotnet-target (string-append out "/share/dotnet/dotnet"))
+ (dotnet-dest (string-append bin-dir "/dotnet")))
+ (mkdir-p bin-dir)
+ (symlink dotnet-target dotnet-dest)
+ ;; First symlink, then wrap-program: dotnet cannot run when renamed
+ (wrap-program dotnet-dest
+ ;; Ensure the `dotnet' program does not phone home to share telemetry
+ `("DOTNET_CLI_TELEMETRY_OPTOUT" = ("1")))))))))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "DOTNET_ROOT")
+ (separator #f)
+ (files '("share/dotnet")))))
+ (inputs
+ `(("gcc:lib" ,gcc "lib")
+ ("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"))
+ (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))))