summaryrefslogtreecommitdiff
path: root/gnu/packages/dotnet.scm
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@friendly-machines.com>2025-06-15 22:00:49 +0200
committerDanny Milosavljevic <dannym@friendly-machines.com>2025-06-22 10:05:55 +0200
commit15a43c743102b5026eccb82be94af30de799f79f (patch)
treea9f1788a7caf60b8480154fa22e3f3b41e31a2d9 /gnu/packages/dotnet.scm
parente365fc68f3f48167dcb1b63d6acbc1d857d1ed15 (diff)
gnu: Add mono-system-reflection-metadata-bootstrap.
* gnu/packages/dotnet.scm (mono-system-reflection-metadata-bootstrap): New variable. Change-Id: I05d30bc85c182316ccd099bc18473a91a0d8e7f1
Diffstat (limited to 'gnu/packages/dotnet.scm')
-rw-r--r--gnu/packages/dotnet.scm63
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/packages/dotnet.scm b/gnu/packages/dotnet.scm
index 10a3cb611c1..778045f201d 100644
--- a/gnu/packages/dotnet.scm
+++ b/gnu/packages/dotnet.scm
@@ -1981,3 +1981,66 @@ most of the heavy lifting.")
1981the source code included within the Mono source tree.") 1981the source code included within the Mono source tree.")
1982 (home-page "https://dot.net/") 1982 (home-page "https://dot.net/")
1983 (license license:expat))) 1983 (license license:expat)))
1984
1985(define mono-system-reflection-metadata-bootstrap
1986 (package
1987 (name "mono-system-reflection-metadata-bootstrap")
1988 ;; Upstream version 1.4.2; but for bootstrap packages it's more useful to have the mono version here.
1989 (version
1990 (package-version mono))
1991 (source
1992 (package-source mono))
1993 (build-system gnu-build-system)
1994 (inputs
1995 (list mono-system-collections-immutable-bootstrap)) ; not required: mono-system-buffers-bootstrap
1996 (native-inputs
1997 (list mono))
1998 (arguments
1999 (list #:phases
2000 #~(modify-phases %standard-phases
2001 (delete 'bootstrap)
2002 (add-after 'unpack 'chdir
2003 (lambda _
2004 (chdir "external/corefx/src/System.Reflection.Metadata/src")
2005 (substitute* "../../Common/src/System/SR.cs"
2006 ;; I don't want to drag System.Security.AccessControl into the bootstrap path.
2007 (("new ResourceManager[(]ResourceType[)]")
2008 "new ResourceManager(\"System.Collections.Immutable\", typeof(SR).Assembly)"))))
2009 (add-after 'chdir 'prepare
2010 (lambda* (#:key inputs #:allow-other-keys)
2011 (for-each
2012 (lambda (name)
2013 (if (file-exists? name)
2014 (delete-file name)
2015 (format #t "Warning: File ~s doesn't exist~%" name)))
2016 ;; We don't need those since they would be for different .NET standards.
2017 '("./System/Reflection/Internal/Utilities/CriticalDisposableObject.netstandard1.1.cs"
2018 "./System/Reflection/Internal/Utilities/EncodingHelper.netcoreapp.cs"
2019 "./System/Reflection/Internal/Utilities/FileStreamReadLightUp.netstandard1.1.cs"
2020 "./System/Reflection/Internal/Utilities/MemoryMapLightUp.netstandard1.1.cs"))))
2021 (delete 'configure)
2022 (replace 'build
2023 (lambda* (#:key inputs outputs #:allow-other-keys)
2024 (invoke "resx2sr" "-o" "SR.cs" "-n" "System.SR" "--warn-mismatch"
2025 "Resources/Strings.resx")
2026 (apply invoke "mcs"
2027 "-target:library"
2028 "-langversion:7.2"
2029 "-unsafe"
2030 "-out:System.Reflection.Metadata.dll"
2031 ; ,(string-append "-r:" buffers-dll)
2032 (string-append "-r:"
2033 (search-input-file inputs
2034 "/lib/mono/4.5/System.Collections.Immutable.dll"))
2035 "../../Common/src/System/SR.cs"
2036 (find-files "." "\\.cs$"))))
2037 (delete 'check)
2038 (replace 'install
2039 (lambda* (#:key outputs #:allow-other-keys)
2040 (let* ((lib-dir (string-append #$output "/lib/mono/4.5")))
2041 (install-file "System.Reflection.Metadata.dll" lib-dir)))))))
2042 (synopsis "System.Reflection.Metadata library for bootstrapping")
2043 (description "This package builds the System.Reflection.Metadata library from
2044the source code included within the Mono source tree.")
2045 (home-page "https://dot.net/")
2046 (license license:expat)))