summaryrefslogtreecommitdiff
path: root/gnu/packages/dotnet.scm
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@friendly-machines.com>2025-06-15 22:01:58 +0200
committerDanny Milosavljevic <dannym@friendly-machines.com>2025-06-22 10:05:55 +0200
commit5239ec21fda51687671c6667a3bffbcd32bbc9d5 (patch)
tree0cce38ef53ebfa4fef67c9b2b0f56690bb6968f4 /gnu/packages/dotnet.scm
parent15a43c743102b5026eccb82be94af30de799f79f (diff)
gnu: Add msbuild.
* gnu/packages/patches/mono-msbuild-15.7.179-fix-build.patch: New file. * gnu/packages/patches/mono-msbuild-15.7.179-fix-resources.patch: New file. * gnu/local.mk (dist_patch_DATA): Register them. * gnu/packages/dotnet.scm (mono-msbuild): New variable. [source]: Use patches. Change-Id: I02cdd6b43368c07d8afad1ee1c80159d91ec7e16
Diffstat (limited to 'gnu/packages/dotnet.scm')
-rw-r--r--gnu/packages/dotnet.scm858
1 files changed, 759 insertions, 99 deletions
diff --git a/gnu/packages/dotnet.scm b/gnu/packages/dotnet.scm
index 778045f201d..2ad9a17b457 100644
--- a/gnu/packages/dotnet.scm
+++ b/gnu/packages/dotnet.scm
@@ -1,6 +1,7 @@
1(define-module (gnu packages dotnet) 1(define-module (gnu packages dotnet)
2 #:use-module ((guix licenses) #:prefix license:) 2 #:use-module ((guix licenses) #:prefix license:)
3 #:use-module (gnu packages assembly) 3 #:use-module (gnu packages assembly)
4 #:use-module (gnu packages bash)
4 #:use-module (gnu packages bison) 5 #:use-module (gnu packages bison)
5 #:use-module (gnu packages check) 6 #:use-module (gnu packages check)
6 #:use-module (gnu packages cmake) 7 #:use-module (gnu packages cmake)
@@ -1074,16 +1075,17 @@ unused0:")))))
1074 (lambda* (#:key make-flags #:allow-other-keys) 1075 (lambda* (#:key make-flags #:allow-other-keys)
1075 (apply invoke "make" "-C" "mcs/tools/resx2sr" make-flags))) 1076 (apply invoke "make" "-C" "mcs/tools/resx2sr" make-flags)))
1076 (add-after 'install 'install-resx2sr 1077 (add-after 'install 'install-resx2sr
1077 (lambda* (#:key make-flags #:allow-other-keys) 1078 (lambda* (#:key inputs make-flags #:allow-other-keys)
1078 (apply invoke "make" "-C" "mcs/tools/resx2sr" "install" make-flags) 1079 (apply invoke "make" "-C" "mcs/tools/resx2sr" "install" make-flags)
1079 ;; They don't install a wrapper script--but we need it for 1080 ;; They don't install a wrapper script--but we need it for
1080 ;; bootstrapping MSBuild. 1081 ;; bootstrapping MSBuild.
1081 (let ((resx2sr (string-append #$output "/bin/resx2sr"))) 1082 (let ((resx2sr (string-append #$output "/bin/resx2sr")))
1082 (call-with-output-file resx2sr 1083 (call-with-output-file resx2sr
1083 (lambda (port) 1084 (lambda (port)
1084 (format port "#!/bin/sh 1085 (format port "#!~a
1085exec ~s ~s \"$@\" 1086exec ~s ~s \"$@\"
1086" 1087"
1088 (search-input-file inputs "/bin/bash")
1087 (string-append #$output "/bin/mono") 1089 (string-append #$output "/bin/mono")
1088 (string-append #$output "/lib/mono/4.5/resx2sr.exe")))) 1090 (string-append #$output "/lib/mono/4.5/resx2sr.exe"))))
1089 (chmod resx2sr #o755)))))))) 1091 (chmod resx2sr #o755))))))))
@@ -1934,113 +1936,771 @@ most of the heavy lifting.")
1934 1936
1935(define-public mono mono-6.12.0) 1937(define-public mono mono-6.12.0)
1936 1938
1937(define mono-system-collections-immutable-bootstrap 1939(define-public mono-system-collections-immutable-bootstrap
1938 (package 1940 (hidden-package
1939 (name "mono-system-collections-immutable-bootstrap") 1941 (package
1940 (version 1942 (name "mono-system-collections-immutable-bootstrap")
1941 (package-version mono)) 1943 (version
1942 (source 1944 (package-version mono))
1943 (package-source mono)) 1945 (source
1944 (build-system gnu-build-system) 1946 (package-source mono))
1945 (native-inputs 1947 (build-system gnu-build-system)
1946 (list mono)) 1948 (native-inputs
1947 (arguments 1949 (list mono))
1948 (list #:phases 1950 (arguments
1949 #~(modify-phases %standard-phases 1951 (list #:tests? #f ; tests would require xunit which is not in the bootstrap path.
1950 (delete 'bootstrap) 1952 #:phases
1951 (add-after 'unpack 'prepare 1953 #~(modify-phases %standard-phases
1952 (lambda _ 1954 (add-after 'unpack 'prepare
1953 (chdir "external/corefx/src/System.Collections.Immutable/src") 1955 (lambda _
1954 (substitute* "../../Common/src/System/SR.cs" 1956 (chdir "external/corefx/src/System.Collections.Immutable/src")
1955 ;; I don't want to drag System.Security.AccessControl into the bootstrap path. 1957 (substitute* "../../Common/src/System/SR.cs"
1956 (("new ResourceManager[(]ResourceType[)]") 1958 ;; I don't want to drag System.Security.AccessControl into the bootstrap path.
1957 "new ResourceManager(\"System.Collections.Immutable\", typeof(SR).Assembly)")))) 1959 (("new ResourceManager[(]ResourceType[)]")
1958 (delete 'configure) 1960 "new ResourceManager(\"System.Collections.Immutable\", typeof(SR).Assembly)"))))
1959 (replace 'build 1961 (delete 'configure) ; no "configure" script exists
1960 (lambda* (#:key inputs #:allow-other-keys) 1962 (replace 'build
1961 (invoke "resx2sr" "-o" "SR.cs" "-n" "System.SR" 1963 (lambda* (#:key inputs #:allow-other-keys)
1962 "--warn-mismatch" 1964 (invoke "resx2sr" "-o" "SR.cs" "-n" "System.SR"
1963 "Resources/Strings.resx") 1965 "--warn-mismatch"
1964 (apply invoke "mcs" 1966 "Resources/Strings.resx")
1965 "-target:library" 1967 (apply invoke "mcs"
1966 "-langversion:7.2" 1968 "-target:library"
1969 "-langversion:7.2"
1967 ;;; mono can't do it: "-d:FEATURE_ITEMREFAPI" 1970 ;;; mono can't do it: "-d:FEATURE_ITEMREFAPI"
1968 "-out:System.Collections.Immutable.dll" 1971 "-out:System.Collections.Immutable.dll"
1969 "../../Common/src/System/Runtime/Versioning/NonVersionableAttribute.cs" 1972 "../../Common/src/System/Runtime/Versioning/NonVersionableAttribute.cs"
1970 "../../Common/src/System/SR.cs" 1973 "../../Common/src/System/SR.cs"
1971 (find-files "." "\\.cs$")))) 1974 (find-files "." "\\.cs$"))))
1972 (delete 'check) 1975 (replace 'install
1973 (replace 'install 1976 (lambda* (#:key outputs #:allow-other-keys)
1974 (lambda* (#:key outputs #:allow-other-keys) 1977 (let* ((lib-dir (string-append #$output "/lib/mono/4.5")))
1975 (let* ((lib-dir (string-append #$output "/lib/mono/4.5"))) 1978 (mkdir-p lib-dir)
1976 (mkdir-p lib-dir) 1979 (install-file "System.Collections.Immutable.dll"
1977 (install-file "System.Collections.Immutable.dll" 1980 lib-dir)))))))
1978 lib-dir))))))) 1981 (synopsis "System.Collections.Immutable library for bootstrapping")
1979 (synopsis "System.Collections.Immutable library for bootstrapping") 1982 (description "This package builds the System.Collections.Immutable library from
1980 (description "This package builds the System.Collections.Immutable library from
1981the source code included within the Mono source tree.") 1983the source code included within the Mono source tree.")
1982 (home-page "https://dot.net/") 1984 (home-page "https://dot.net/")
1983 (license license:expat))) 1985 (license license:expat))))
1986
1987(define-public mono-system-reflection-metadata-bootstrap
1988 (hidden-package
1989 (package
1990 (name "mono-system-reflection-metadata-bootstrap")
1991 ;; Upstream version 1.4.2; but for bootstrap packages it's more useful to have the mono version here.
1992 (version
1993 (package-version mono))
1994 (source
1995 (package-source mono))
1996 (build-system gnu-build-system)
1997 (inputs
1998 (list mono-system-collections-immutable-bootstrap)) ; not required: mono-system-buffers-bootstrap
1999 (native-inputs
2000 (list mono))
2001 (arguments
2002 (list #:tests? #f ; would require xunit which is not in the bootstrap path
2003 #:phases
2004 #~(modify-phases %standard-phases
2005 (add-after 'unpack 'chdir
2006 (lambda _
2007 (chdir "external/corefx/src/System.Reflection.Metadata/src")
2008 (substitute* "../../Common/src/System/SR.cs"
2009 ;; I don't want to drag System.Security.AccessControl into the bootstrap path.
2010 (("new ResourceManager[(]ResourceType[)]")
2011 "new ResourceManager(\"System.Collections.Immutable\", typeof(SR).Assembly)"))))
2012 (add-after 'chdir 'prepare
2013 (lambda* (#:key inputs #:allow-other-keys)
2014 (for-each
2015 (lambda (name)
2016 (if (file-exists? name)
2017 (delete-file name)
2018 (format #t "Warning: File ~s doesn't exist~%" name)))
2019 ;; We don't need those since they would be for different .NET standards.
2020 '("./System/Reflection/Internal/Utilities/CriticalDisposableObject.netstandard1.1.cs"
2021 "./System/Reflection/Internal/Utilities/EncodingHelper.netcoreapp.cs"
2022 "./System/Reflection/Internal/Utilities/FileStreamReadLightUp.netstandard1.1.cs"
2023 "./System/Reflection/Internal/Utilities/MemoryMapLightUp.netstandard1.1.cs"))))
2024 (delete 'configure) ; no "configure" script exists
2025 (replace 'build
2026 (lambda* (#:key inputs outputs #:allow-other-keys)
2027 (invoke "resx2sr" "-o" "SR.cs" "-n" "System.SR" "--warn-mismatch"
2028 "Resources/Strings.resx")
2029 (apply invoke "mcs"
2030 "-target:library"
2031 "-langversion:7.2"
2032 "-unsafe"
2033 "-out:System.Reflection.Metadata.dll"
2034 (string-append "-r:"
2035 (search-input-file inputs
2036 "/lib/mono/4.5/System.Collections.Immutable.dll"))
2037 "../../Common/src/System/SR.cs"
2038 (find-files "." "\\.cs$"))))
2039 (replace 'install
2040 (lambda* (#:key outputs #:allow-other-keys)
2041 (let* ((lib-dir (string-append #$output "/lib/mono/4.5")))
2042 (install-file "System.Reflection.Metadata.dll" lib-dir)))))))
2043 (synopsis "System.Reflection.Metadata library for bootstrapping")
2044 (description "This package builds the System.Reflection.Metadata library from
2045the source code included within the Mono source tree.")
2046 (home-page "https://dot.net/")
2047 (license license:expat))))
1984 2048
1985(define mono-system-reflection-metadata-bootstrap 2049;; too new version: 15.9.21.664
2050;; too old (no support for mono) version: 14.0
2051(define-public msbuild
1986 (package 2052 (package
1987 (name "mono-system-reflection-metadata-bootstrap") 2053 (name "msbuild")
1988 ;; Upstream version 1.4.2; but for bootstrap packages it's more useful to have the mono version here. 2054 (version "15.7.179")
1989 (version
1990 (package-version mono))
1991 (source 2055 (source
1992 (package-source mono)) 2056 (origin
2057 (method git-fetch)
2058 (uri (git-reference
2059 (url "https://github.com/dotnet/msbuild")
2060 (commit (string-append "v" version))))
2061 (file-name (git-file-name name version))
2062 (sha256
2063 (base32
2064 "1fhd4z9575lwgy6l3wisih7g6qd6j3wb99kz246028dzm0rh3cfh"))
2065 (patches
2066 (search-patches
2067 "mono-msbuild-15.7.179-fix-build.patch"
2068 "mono-msbuild-15.7.179-fix-resources.patch"))))
1993 (build-system gnu-build-system) 2069 (build-system gnu-build-system)
1994 (inputs 2070 (inputs
1995 (list mono-system-collections-immutable-bootstrap)) ; not required: mono-system-buffers-bootstrap 2071 (list bash-minimal
1996 (native-inputs 2072 mono mono-system-reflection-metadata-bootstrap
1997 (list mono)) 2073 mono-system-collections-immutable-bootstrap))
1998 (arguments 2074 (arguments
1999 (list #:phases 2075 (list #:tests? #f ; would require xunit which is not in the bootstrap path
2076 #:phases
2000 #~(modify-phases %standard-phases 2077 #~(modify-phases %standard-phases
2001 (delete 'bootstrap) 2078 (replace 'configure
2002 (add-after 'unpack 'chdir
2003 (lambda _ 2079 (lambda _
2004 (chdir "external/corefx/src/System.Reflection.Metadata/src") 2080 (define (generate-version-file filename version-str internals-list)
2005 (substitute* "../../Common/src/System/SR.cs" 2081 (call-with-output-file filename
2006 ;; I don't want to drag System.Security.AccessControl into the bootstrap path. 2082 (lambda (port)
2007 (("new ResourceManager[(]ResourceType[)]") 2083 (format port
2008 "new ResourceManager(\"System.Collections.Immutable\", typeof(SR).Assembly)")))) 2084 "[assembly: System.Reflection.AssemblyVersion(\"~a\")]~%"
2009 (add-after 'chdir 'prepare 2085 version-str)
2010 (lambda* (#:key inputs #:allow-other-keys) 2086 (format port
2011 (for-each 2087 "[assembly: System.Reflection.AssemblyFileVersion(\"~a\")]~%"
2012 (lambda (name) 2088 version-str)
2013 (if (file-exists? name) 2089 ;; TODO: and commit id, if any.
2014 (delete-file name) 2090 (format port
2015 (format #t "Warning: File ~s doesn't exist~%" name))) 2091 "[assembly: System.Reflection.AssemblyInformationalVersion(\"~a\")]~%"
2016 ;; We don't need those since they would be for different .NET standards. 2092 version-str)
2017 '("./System/Reflection/Internal/Utilities/CriticalDisposableObject.netstandard1.1.cs" 2093 (for-each
2018 "./System/Reflection/Internal/Utilities/EncodingHelper.netcoreapp.cs" 2094 (lambda (internal-name)
2019 "./System/Reflection/Internal/Utilities/FileStreamReadLightUp.netstandard1.1.cs" 2095 (format port
2020 "./System/Reflection/Internal/Utilities/MemoryMapLightUp.netstandard1.1.cs")))) 2096 "[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(\"~a\")]~%"
2021 (delete 'configure) 2097 internal-name))
2098 internals-list))))
2099 (let ((version #$(package-version this-package)))
2100 (substitute* "src/Build/Resources/AssemblyResources.cs"
2101 ;; There's a caller that has a caller that checks for null.
2102 ;;
2103 ;; But if this check is here, the high-level fallback will
2104 ;; not work since it only falls back on null, not on
2105 ;; exception.
2106 ;;
2107 ;; So what's this about?! Remove it.
2108 (("ErrorUtilities.VerifyThrow[(]resource != null, .*")
2109 "\n"))
2110 (substitute* "src/Shared/AssemblyNameExtension.cs"
2111 (("\\<ISerializable\\>")
2112 "System.Runtime.Serialization.ISerializable")
2113 (("\\<StreamingContext\\>")
2114 "System.Runtime.Serialization.StreamingContext")
2115 (("\\<SerializationInfo\\>")
2116 "System.Runtime.Serialization.SerializationInfo"))
2117 ;; ThisAssembly would have been generated by MSBuild--which we don't have yet.
2118 (substitute* '("src/Shared/CommunicationsUtilities.cs"
2119 "src/Tasks/StronglyTypedResourceBuilder.cs")
2120 (("ThisAssembly[.]AssemblyInformationalVersion")
2121 (string-append "\"" version "\""))
2122 (("ThisAssembly[.]Version")
2123 (string-append "\"" version "\"")))
2124 (substitute* "src/Shared/FrameworkLocationHelper.cs"
2125 ;; That is unused anyway.
2126 (("^using Microsoft.Build.Evaluation;")
2127 ""))
2128 (substitute* '("src/Tasks/AspNetCompiler.cs"
2129 "src/Tasks/AxTlbBaseTask.cs"
2130 "src/Tasks/AxImp.cs"
2131 "src/Tasks/TlbImp.cs"
2132 "src/Tasks/Exec.cs"
2133 "src/Tasks/ResGen.cs"
2134 "src/Tasks/LC.cs"
2135 "src/Tasks/SGen.cs"
2136 "src/Tasks/WinMDExp.cs")
2137 (("protected override bool ValidateParameters")
2138 "protected internal override bool ValidateParameters")
2139 (("override protected bool ValidateParameters") ; SGen.cs
2140 "protected internal override bool ValidateParameters"))
2141 (substitute* "src/Shared/Modifiers.cs"
2142 (("^using Microsoft.Build.Internal;")
2143 ""))
2144 (substitute* "src/MSBuild/OutOfProcTaskHostNode.cs"
2145 (("^using Microsoft.Build.BackEnd;")
2146 "using Microsoft.Build.BackEnd;
2147using Microsoft.Build.BackEnd.Components.Caching;"))
2148 (generate-version-file "Version-Framework.cs" version
2149 '("Microsoft.Build.Utilities.Core"
2150 "Microsoft.Build.Tasks.Core"
2151 "Microsoft.Build.Tasks"
2152 "Microsoft.Build"))
2153 (generate-version-file "Version-Utilities.cs" version
2154 '("Microsoft.Build"
2155 "Microsoft.Build.Tasks.Core"
2156 "Microsoft.Build.Tasks"
2157 "MSBuild"))
2158 (generate-version-file "Version.cs" version
2159 '("MSBuild"))
2160 (generate-version-file "Version-exe.cs" version
2161 '()))))
2022 (replace 'build 2162 (replace 'build
2023 (lambda* (#:key inputs outputs #:allow-other-keys) 2163 (lambda* (#:key inputs #:allow-other-keys)
2024 (invoke "resx2sr" "-o" "SR.cs" "-n" "System.SR" "--warn-mismatch" 2164 (let* ((mcs-flags '("-langversion:7.2" "-unsafe" "-d:NET472" "-d:STRONG_NAME"
2025 "Resources/Strings.resx") 2165 "-d:MONO" "-d:STANDALONEBUILD"
2026 (apply invoke "mcs" 2166 ;; Otherwise the build would fail.
2027 "-target:library" 2167 "-d:FEATURE_COM_INTEROP"
2028 "-langversion:7.2" 2168 ;; Otherwise it would try to load shell32.
2029 "-unsafe" 2169 "-d:FEATURE_SPECIAL_FOLDERS"
2030 "-out:System.Reflection.Metadata.dll" 2170 ;"-d:FEATURE_BINARY_SERIALIZATION"
2031 ; ,(string-append "-r:" buffers-dll) 2171 ;"-d:FEATURE_ASSEMBLY_LOADFROM"
2032 (string-append "-r:" 2172 ;"-d:FEATURE_RESX_RESOURCE_READER"
2033 (search-input-file inputs 2173 "-d:FEATURE_RESGENCACHE"
2034 "/lib/mono/4.5/System.Collections.Immutable.dll")) 2174 "-d:FEATURE_CODEDOM"
2035 "../../Common/src/System/SR.cs" 2175 ;"-d:FEATURE_SYSTEM_CONFIGURATION"
2036 (find-files "." "\\.cs$")))) 2176 "-d:FEATURE_APPDOMAIN"
2037 (delete 'check) 2177 ;"-d:FEATURE_APM" ; ?
2178 "-d:FEATURE_TYPE_INVOKEMEMBER"
2179 "-d:FEATURE_APPDOMAIN_UNHANDLED_EXCEPTION")))
2180 (mkdir "artifacts")
2181
2182 ;;; --- 1. Build Microsoft.Build.Framework.dll
2183
2184 ;;; Note: No generating SR.cs for now.
2185
2186 (invoke "resgen" "src/Shared/Resources/Strings.shared.resx"
2187 "artifacts/Microsoft.Build.Framework.Strings.shared.resources")
2188
2189 (apply invoke "mcs"
2190 (append mcs-flags
2191 '("-target:library" "-out:artifacts/Microsoft.Build.Framework.dll"
2192 "-resource:artifacts/Microsoft.Build.Framework.Strings.shared.resources"
2193 "-r:System.Xaml.dll"
2194 "Version-Framework.cs")
2195 (find-files "src/Framework" "\\.cs$")
2196 (list "src/Shared/Constants.cs"
2197 "src/Shared/BinaryWriterExtensions.cs")))
2198
2199 ;;; --- 2. Build Microsoft.Build.Utilities.Core.dll
2200
2201 ;; No resx2sr since src/Utilities/AssemblyResources.cs is hand-written.
2202 (invoke "resgen" "src/Shared/Resources/Strings.shared.resx"
2203 "artifacts/Microsoft.Build.Utilities.Core.Strings.shared.resources")
2204 (invoke "resgen" "src/Utilities/Resources/Strings.resx"
2205 "artifacts/Microsoft.Build.Utilities.Core.Strings.resources")
2206 (apply invoke "mcs"
2207 (append mcs-flags
2208 '("-target:library" "-out:artifacts/Microsoft.Build.Utilities.Core.dll"
2209 "-resource:artifacts/Microsoft.Build.Utilities.Core.Strings.shared.resources"
2210 "-resource:artifacts/Microsoft.Build.Utilities.Core.Strings.resources"
2211 "-r:System.Runtime.Serialization.dll"
2212 "-r:artifacts/Microsoft.Build.Framework.dll"
2213 "src/Utilities/AssemblyResources.cs"
2214 "Version-Utilities.cs")
2215 (map (lambda (f) (string-append "src/Utilities/" f))
2216 '("SDKManifest.cs"
2217 "ApiContract.cs"
2218 "SDKType.cs"
2219 "Logger.cs"
2220 "TrackedDependencies/FlatTrackingData.cs"
2221 "TrackedDependencies/CanonicalTrackedOutputFiles.cs"
2222 "TrackedDependencies/CanonicalTrackedInputFiles.cs"
2223 "TrackedDependencies/CanonicalTrackedFilesHelper.cs"
2224 "TrackedDependencies/FileTracker.cs"
2225 "TrackedDependencies/DependencyTableCache.cs"
2226 "AssemblyFolders/AssemblyFoldersExInfo.cs"
2227 "AssemblyFolders/AssemblyFoldersFromConfigInfo.cs"
2228 "AssemblyInfo.cs"
2229 "ProcessorArchitecture.cs"
2230 "FxCopExclusions/Microsoft.Build.Utilities.Suppressions.cs"
2231 "PlatformManifest.cs"
2232 "ExtensionSDK.cs"
2233 "CommandLineBuilder.cs"
2234 "TaskItem.cs"
2235 "ToolTask.cs"
2236 "TargetPlatformSDK.cs"
2237 "AppDomainIsolatedTask.cs"
2238 "Task.cs"
2239 "ProcessExtensions.cs"
2240 "MuxLogger.cs"))
2241 (map (lambda (f) (string-append "src/Shared/" f))
2242 '("FxCopExclusions/Microsoft.Build.Shared.Suppressions.cs"
2243 "EncodingStringWriter.cs"
2244 "EncodingUtilities.cs"
2245 "CopyOnWriteDictionary.cs"
2246 "Tracing.cs"
2247 "TaskLoggingHelper.cs"
2248 "TaskLoggingHelperExtension.cs"
2249 "EventArgsFormatting.cs"
2250 "FileDelegates.cs" ; req by tasks
2251 "NativeMethodsShared.cs" ; again ???
2252 "MSBuildNameIgnoreCaseComparer.cs"
2253 "BuildEventFileInfo.cs"
2254 "ErrorUtilities.cs"
2255 "EscapingUtilities.cs"
2256 "FileUtilities.cs"
2257 "FileUtilities.GetFolderPath.cs"
2258 "TempFileUtilities.cs"
2259 "Modifiers.cs"
2260 "FileUtilitiesRegex.cs"
2261 "HybridDictionary.cs"
2262 "IConstrainedEqualityComparer.cs"
2263 "ResourceUtilities.cs"
2264 "StringBuilderCache.cs"
2265 "Traits.cs"
2266 "IElementLocation.cs"
2267 "INodePacket.cs"
2268 "INodePacketFactory.cs"
2269 "INodePacketHandler.cs"
2270 "INodePacketTranslatable.cs"
2271 "INodePacketTranslator.cs"
2272 "ExceptionHandling.cs"
2273 "ReadOnlyEmptyCollection.cs"
2274 "OpportunisticIntern.cs"
2275 "AssemblyUtilities.cs"
2276 "ReadOnlyEmptyDictionary.cs"
2277 "CanonicalError.cs"
2278 "VisualStudioLocationHelper.cs"
2279 "AssemblyFolders/Serialization/AssemblyFolderItem.cs"
2280 "AssemblyFolders/Serialization/AssemblyFolderCollection.cs"
2281 "BuildEnvironmentHelper.cs"
2282 "EnvironmentUtilities.cs"
2283 "VersionUtilities.cs"
2284 "InternalErrorException.cs"))))
2285
2286 ;;; --- 3. Build Microsoft.Build.Tasks.Core.dll
2287
2288 ;; No resx2sr since src/Tasks/AssemblyResources.cs is
2289 ;; hand-written.
2290 (invoke "resgen" "src/Tasks/Resources/Strings.resx"
2291 "artifacts/Microsoft.Build.Tasks.Core.Strings.resources")
2292 (apply invoke "mcs"
2293 (append mcs-flags
2294 `("-d:MICROSOFT_BUILD_TASKS"
2295 "-target:library"
2296 "-out:artifacts/Microsoft.Build.Tasks.Core.dll"
2297 "-resource:artifacts/Microsoft.Build.Tasks.Core.Strings.resources,Microsoft.Build.Tasks.Core.Strings"
2298 "-r:System.Xml.Linq.dll"
2299 "-r:artifacts/Microsoft.Build.Framework.dll"
2300 ;; This should contain ToolLocationHelper--but it's impossible.
2301 "-r:artifacts/Microsoft.Build.Utilities.Core.dll"
2302 "-r:System.Windows.Forms.dll" ; ResXDataNode
2303 ,(string-append "-r:"
2304 (search-input-file inputs
2305 "/lib/mono/4.5/System.Reflection.Metadata.dll"))
2306 ,(string-append "-r:"
2307 (search-input-file inputs
2308 "lib/mono/4.5/System.Collections.Immutable.dll"))
2309 "Version.cs")
2310 (map (lambda (f) (string-append "src/Tasks/" f))
2311 '(;; Otherwise impossible to use since it requires weird things.
2312 "../Utilities/ToolLocationHelper.cs"
2313 "Delegate.cs"
2314 "StrongNameUtils.cs"
2315 "AssemblyRegistrationCache.cs"
2316 "StateFileBase.cs"
2317 "AppDomainIsolatedTaskExtension.cs"
2318 "SdkToolsPathUtility.cs"
2319 "StronglyTypedResourceBuilder.cs"
2320 "Al.cs" "AppConfig/AppConfig.cs"
2321 "AppConfig/AppConfigException.cs"
2322 "AppConfig/BindingRedirect.cs"
2323 "AppConfig/DependentAssembly.cs"
2324 "AppConfig/RuntimeSection.cs"
2325 "AspNetCompiler.cs"
2326 "AssignCulture.cs"
2327 "AssignLinkMetadata.cs"
2328 "AssignProjectConfiguration.cs"
2329 "AssignTargetPath.cs"
2330 "AssemblyDependency/AssemblyFoldersExResolver.cs"
2331 "AssemblyDependency/AssemblyFoldersFromConfig/AssemblyFoldersFromConfigCache.cs"
2332 "AssemblyDependency/AssemblyFoldersFromConfig/AssemblyFoldersFromConfigResolver.cs"
2333 "AssemblyDependency/AssemblyFoldersResolver.cs"
2334 "AssemblyDependency/AssemblyInformation.cs"
2335 "AssemblyDependency/AssemblyNameReference.cs"
2336 "AssemblyDependency/AssemblyNameReferenceAscendingVersionComparer.cs"
2337 "AssemblyDependency/AssemblyResolution.cs"
2338 "AssemblyDependency/AssemblyResolutionConstants.cs"
2339 "AssemblyDependency/BadImageReferenceException.cs"
2340 "AssemblyDependency/CandidateAssemblyFilesResolver.cs"
2341 "AssemblyDependency/ConflictLossReason.cs"
2342 "AssemblyDependency/CopyLocalState.cs"
2343 "AssemblyDependency/DependencyResolutionException.cs"
2344 "AssemblyDependency/DirectoryResolver.cs"
2345 "AssemblyDependency/DisposableBase.cs"
2346 "AssemblyDependency/FrameworkPathResolver.cs"
2347 "AssemblyDependency/GacResolver.cs"
2348 "AssemblyDependency/GlobalAssemblyCache.cs"
2349 "AssemblyDependency/HintPathResolver.cs"
2350 "AssemblyDependency/InstalledAssemblies.cs"
2351 "AssemblyDependency/InvalidReferenceAssemblyNameException.cs"
2352 "AssemblyDependency/NoMatchReason.cs"
2353 "AssemblyDependency/RawFilenameResolver.cs"
2354 "AssemblyDependency/Reference.cs"
2355 "AssemblyDependency/ReferenceResolutionException.cs"
2356 "AssemblyDependency/ReferenceTable.cs"
2357 "AssemblyDependency/ResolutionSearchLocation.cs"
2358 "AssemblyDependency/Resolver.cs"
2359 "AssemblyDependency/ResolveAssemblyReference.cs"
2360 "AssemblyDependency/TaskItemSpecFilenameComparer.cs"
2361 "AssemblyDependency/UnificationReason.cs"
2362 "AssemblyDependency/UnificationVersion.cs"
2363 "AssemblyDependency/UnifiedAssemblyName.cs"
2364 "AssemblyDependency/WarnOrErrorOnTargetArchitectureMismatchBehavior.cs"
2365 "AssemblyDependency/GenerateBindingRedirects.cs"
2366 "AssemblyFolder.cs" "AssemblyInfo.cs" "AssemblyRemapping.cs"
2367 "AxImp.cs"
2368 "AxTlbBaseTask.cs"
2369 "BuildCacheDisposeWrapper.cs"
2370 "CallTarget.cs"
2371 "CodeTaskFactory.cs"
2372 "CombinePath.cs"
2373 "CommandLineBuilderExtension.cs"
2374 "ComReferenceResolutionException.cs"
2375 "ComReferenceTypes.cs"
2376 "ComReferenceWrapperInfo.cs"
2377 "ConvertToAbsolutePath.cs"
2378 "Copy.cs"
2379 "CreateCSharpManifestResourceName.cs"
2380 "CreateItem.cs"
2381 "CreateManifestResourceName.cs"
2382 "CreateProperty.cs"
2383 "CreateVisualBasicManifestResourceName.cs"
2384 "CSharpParserUtilities.cs"
2385 "Culture.cs"
2386 "CultureInfoCache.cs"
2387 "Delete.cs"
2388 "Dependencies.cs"
2389 "DependencyFile.cs"
2390 "Error.cs"
2391 "ErrorFromResources.cs"
2392 "Exec.cs"
2393 "ExtractedClassName.cs"
2394 "FileIO/ReadLinesFromFile.cs"
2395 "FileIO/WriteLinesToFile.cs"
2396 "FileState.cs"
2397 "FindAppConfigFile.cs"
2398 "FindInList.cs"
2399 "FindInvalidProjectReferences.cs"
2400 "FormatUrl.cs"
2401 "FormatVersion.cs"
2402 "FxCopExclusions/Microsoft.Build.Tasks.Suppressions.cs"
2403 "GenerateResource.cs"
2404 "GetAssemblyIdentity.cs"
2405 "GetFrameworkPath.cs"
2406 "GetFrameworkSDKPath.cs"
2407 "GetInstalledSDKLocations.cs"
2408 "GetReferenceAssemblyPaths.cs"
2409 "GetSDKReferenceFiles.cs"
2410 "Hash.cs"
2411 "IAnalyzerHostObject.cs"
2412 "ICscHostObject.cs"
2413 "ICscHostObject2.cs"
2414 "ICscHostObject3.cs"
2415 "ICscHostObject4.cs"
2416 "IComReferenceResolver.cs"
2417 "IVbcHostObject.cs"
2418 "IVbcHostObject2.cs"
2419 "IVbcHostObject3.cs"
2420 "IVbcHostObject4.cs"
2421 "IVbcHostObject5.cs"
2422 "IVbcHostObjectFreeThreaded.cs"
2423 "InstalledSDKResolver.cs"
2424 "InvalidParameterValueException.cs"
2425 "LC.cs"
2426 "ListOperators/FindUnderPath.cs"
2427 "ListOperators/RemoveDuplicates.cs"
2428 "LockCheck.cs" "MakeDir.cs"
2429 "ManifestUtil/ApplicationIdentity.cs"
2430 "ManifestUtil/AssemblyIdentity.cs"
2431 "ManifestUtil/AssemblyReference.cs"
2432 "ManifestUtil/AssemblyReferenceCollection.cs"
2433 "ManifestUtil/BaseReference.cs"
2434 "ManifestUtil/CngLightup.cs"
2435 "ManifestUtil/ComImporter.cs"
2436 "ManifestUtil/CompatibleFramework.cs"
2437 "ManifestUtil/CompatibleFrameworkCollection.cs"
2438 "ManifestUtil/Constants.cs"
2439 "ManifestUtil/ConvertUtil.cs"
2440 "ManifestUtil/EmbeddedManifestReader.cs"
2441 "ManifestUtil/FileAssociation.cs"
2442 "ManifestUtil/FileAssociationCollection.cs"
2443 "ManifestUtil/FileReference.cs"
2444 "ManifestUtil/FileReferenceCollection.cs"
2445 "ManifestUtil/ManifestFormatter.cs"
2446 "ManifestUtil/MetadataReader.cs"
2447 "ManifestUtil/NativeMethods.cs"
2448 "ManifestUtil/OutputMessage.cs"
2449 "ManifestUtil/PathUtil.cs"
2450 "ManifestUtil/RSAPKCS1SHA256SignatureDescription.cs"
2451 "ManifestUtil/Util.cs"
2452 "ManifestUtil/XmlNamespaces.cs"
2453 "ManifestUtil/XmlUtil.cs"
2454 "ManifestUtil/XPaths.cs"
2455 "Message.cs"
2456 "Move.cs"
2457 "MSBuild.cs"
2458 "NativeMethods.cs"
2459 "ParserState.cs"
2460 "RCWForCurrentContext.cs"
2461 "RedistList.cs"
2462 "RegisterAssembly.cs"
2463 "RemoveDir.cs"
2464 "RequiresFramework35SP1Assembly.cs"
2465 "ResGen.cs"
2466 "ResGenDependencies.cs"
2467 "ResolveCodeAnalysisRuleSet.cs"
2468 "ResolveKeySource.cs"
2469 "ResolveManifestFiles.cs"
2470 "ResolveNonMSBuildProjectOutput.cs"
2471 "ResolveProjectBase.cs"
2472 "ResolveSDKReference.cs"
2473 "SGen.cs"
2474 "StrongNameException.cs"
2475 "System.Design.cs"
2476 "TaskExtension.cs"
2477 "Telemetry.cs"
2478 "TlbImp.cs"
2479 "ToolTaskExtension.cs"
2480 "Touch.cs"
2481 "UnregisterAssembly.cs"
2482 "VisualBasicParserUtilities.cs"
2483 "Warning.cs"
2484 "WinMDExp.cs"
2485 "WriteCodeFragment.cs"
2486 "XmlPeek.cs"
2487 "XmlPoke.cs"
2488 "XslTransformation.cs"
2489 "AssemblyDependency/AssemblyMetadata.cs"))
2490 (append
2491 (map (lambda (f) (string-append "src/Shared/LanguageParser/" f))
2492 '("CSharptokenCharReader.cs"
2493 "CSharptokenizer.cs"
2494 "tokenChar.cs"
2495 "token.cs"
2496 "VisualBasictokenCharReader.cs"
2497 "VisualBasictokenizer.cs"
2498 "CSharptokenEnumerator.cs"
2499 "StreamMappedString.cs"
2500 "tokenCharReader.cs"
2501 "tokenEnumerator.cs"
2502 "VisualBasictokenEnumerator.cs"))
2503 '("src/Shared/AssemblyNameExtension.cs"
2504 "src/Shared/Constants.cs"
2505 "src/Shared/NGen.cs"
2506 "src/Shared/PropertyParser.cs"
2507 "src/Shared/ConversionUtilities.cs"
2508 "src/Shared/MetadataConversionUtilities.cs"
2509 "src/Shared/AssemblyNameComparer.cs"
2510 "src/Shared/AssemblyNameReverseVersionComparer.cs"
2511 "src/Shared/FileMatcher.cs"
2512 "src/Shared/RegistryHelper.cs"
2513 "src/Shared/StrongNameHelpers.cs"
2514 "src/Shared/AssemblyFolders/AssemblyFoldersFromConfig.cs" ; class
2515 ;; Requires Evaluation.
2516 "src/Shared/FrameworkLocationHelper.cs"))))
2517
2518 ;;; --- 4. Build Microsoft.Build.dll (The Main Engine)
2519
2520 ;; src/Build/Resources/AssemblyResources.cs was
2521 ;; hand-written to fall-back to EXE resources,
2522 ;; so no resx2sr here.
2523
2524 (invoke "resgen" "src/Shared/Resources/Strings.shared.resx"
2525 "artifacts/Microsoft.Build.Strings.shared.resources")
2526 (invoke "resgen" "src/Build/Resources/Strings.resx"
2527 "artifacts/Microsoft.Build.Strings.resources")
2528 (invoke "resgen" "src/MSBuild/Resources/Strings.resx"
2529 "artifacts/Microsoft.Build.Strings.commandline.resources")
2530
2531 (apply invoke "mcs"
2532 (append mcs-flags
2533 `("-d:BUILD_ENGINE"
2534 "-d:FEATURE_ASSEMBLY_LOADFROM"
2535 "-d:FEATURE_SYSTEM_CONFIGURATION"
2536 "-target:library"
2537 "-out:artifacts/Microsoft.Build.dll"
2538 "-resource:artifacts/Microsoft.Build.Strings.shared.resources,Microsoft.Build.Strings.shared.resources"
2539 "-resource:artifacts/Microsoft.Build.Strings.resources,Microsoft.Build.Strings.resources"
2540 "-resource:artifacts/Microsoft.Build.Strings.commandline.resources,Microsoft.Build.Strings.commandline.resources"
2541
2542 "-r:System.Configuration.dll"
2543 "-r:System.Threading.Tasks.Dataflow.dll"
2544 "-r:System.IO.Compression.dll"
2545 "-r:artifacts/Microsoft.Build.Framework.dll"
2546 ,(string-append "-r:"
2547 (search-input-file inputs
2548 "/lib/mono/4.5/System.Collections.Immutable.dll"))
2549 "Version.cs")
2550 (filter (lambda (name)
2551 (not (string-contains name "/Originals/")))
2552 (find-files "src/Build" "\\.cs$"))
2553 (map (lambda (f) (string-append "src/Shared/" f))
2554 '("CollectionHelpers.cs"
2555 "Constants.cs"
2556 "EscapingUtilities.cs"
2557 "FileUtilities.cs"
2558 "FileUtilitiesRegex.cs"
2559 "TempFileUtilities.cs"
2560 "FileUtilities.GetFolderPath.cs"
2561 "InterningBinaryReader.cs"
2562 "MSBuildNameIgnoreCaseComparer.cs"
2563 "NativeMethodsShared.cs"
2564 "ResourceUtilities.cs"
2565 "StringBuilderCache.cs"
2566 "Traits.cs"
2567 "IKeyed.cs"
2568 "Pair.cs"
2569 "EscapingStringExtensions/EscapingStringExtensions.cs"
2570 "NodeShutdown.cs"
2571 "NodeEngineShutdownReason.cs"
2572 "NodePacketFactory.cs"
2573 "INodeEndpoint.cs"
2574 "NodeBuildComplete.cs"
2575 "LogMessagePacketBase.cs"
2576 "NodeEndpointOutOfProcBase.cs"
2577 "ProjectFileErrorUtilities.cs"
2578 "TaskHostConfiguration.cs"
2579 "TaskHostTaskCancelled.cs"
2580 "TaskHostTaskComplete.cs"
2581 "ToolsetElement.cs"
2582 "TaskEngineAssemblyResolver.cs"
2583 "RegisteredTaskObjectCacheBase.cs"
2584 "TypeLoader.cs"
2585 "LoadedType.cs"
2586 "AssemblyLoadInfo.cs"
2587 "ReuseableStringBuilder.cs"
2588 "TaskParameter.cs"
2589 "TaskParameterTypeVerifier.cs"
2590 "OutOfProcTaskHostTaskResult.cs"
2591 "VisualStudioConstants.cs"
2592 "CommunicationsUtilities.cs"
2593 "XMakeAttributes.cs"
2594 "XMakeElements.cs"
2595 ;; Yes, again. It has a feature flag check.
2596 "TaskLoggingHelper.cs"
2597 "TaskLoggingHelperExtension.cs"
2598 "AssemblyNameComparer.cs"
2599 "EncodingUtilities.cs"
2600 "BuildEventFileInfo.cs"
2601 "CopyOnWriteDictionary.cs"
2602 "FileDelegates.cs"
2603 "HybridDictionary.cs"
2604 "IConstrainedEqualityComparer.cs"
2605 "IElementLocation.cs"
2606 "INodePacket.cs"
2607 "INodePacketFactory.cs"
2608 "INodePacketHandler.cs"
2609 "INodePacketTranslatable.cs"
2610 "INodePacketTranslator.cs"
2611 "NGen.cs"
2612 "OpportunisticIntern.cs"
2613 "ErrorUtilities.cs"
2614 "ExceptionHandling.cs"
2615 "AssemblyUtilities.cs"
2616 "AwaitExtensions.cs"
2617 "BuildEnvironmentHelper.cs"
2618 "ConversionUtilities.cs"
2619 "EnvironmentUtilities.cs"
2620 "EventArgsFormatting.cs"
2621 "FileMatcher.cs"
2622 "FrameworkLocationHelper.cs"
2623 "NodePacketTranslator.cs"
2624 "ProjectErrorUtilities.cs"
2625 "ProjectWriter.cs"
2626 "PropertyParser.cs"
2627 "ReadOnlyEmptyCollection.cs"
2628 "ReadOnlyEmptyDictionary.cs"
2629 "TaskLoader.cs"
2630 "ThreadPoolExtensions.cs"
2631 "Tracing.cs"
2632 "VersionUtilities.cs"
2633 "XmlUtilities.cs"
2634 "VisualStudioLocationHelper.cs"
2635 "Modifiers.cs"
2636 "ReadOnlyCollection.cs"
2637 "AssemblyNameExtension.cs"
2638 "BufferedReadStream.cs"
2639 "CanonicalError.cs"
2640 "EncodingStringWriter.cs"
2641 "InternalErrorException.cs"))))
2642
2643 ;;; --- 5. Build MSBuild.exe (the executable)
2644
2645 ;; no resx2sr since src/MSBuild/AssemblyResources.cs is hand-written.
2646 (invoke "resgen" "src/MSBuild/Resources/Strings.resx"
2647 "artifacts/MSBuild.Strings.resources")
2648 (invoke "resgen" "src/Shared/Resources/Strings.shared.resx"
2649 "artifacts/MSBuild.Strings.shared.resources")
2650 (apply invoke "mcs"
2651 (append mcs-flags
2652 '("-target:exe"
2653 "-out:artifacts/MSBuild.exe"
2654 ;; Add the correct logical names (RHS) for BOTH resource files.
2655 "-resource:artifacts/MSBuild.Strings.resources,MSBuild.Strings.resources"
2656 "-resource:artifacts/MSBuild.Strings.shared.resources,MSBuild.Strings.shared.resources"
2657 "-r:artifacts/Microsoft.Build.dll"
2658 "-r:artifacts/Microsoft.Build.Framework.dll"
2659 "-r:artifacts/Microsoft.Build.Tasks.Core.dll"
2660 "Version-exe.cs")
2661 (find-files "src/MSBuild" "\\.cs$")
2662 '("src/Shared/QuotingUtilities.cs"
2663 "src/Shared/ExceptionHandling.cs"))))))
2038 (replace 'install 2664 (replace 'install
2039 (lambda* (#:key outputs #:allow-other-keys) 2665 (lambda* (#:key inputs outputs #:allow-other-keys)
2040 (let* ((lib-dir (string-append #$output "/lib/mono/4.5"))) 2666 (let* ((lib-dir (string-append #$output "/lib/mono/msbuild"))
2041 (install-file "System.Reflection.Metadata.dll" lib-dir))))))) 2667 (bin-dir (string-append #$output "/bin")))
2042 (synopsis "System.Reflection.Metadata library for bootstrapping") 2668 (mkdir-p lib-dir)
2043 (description "This package builds the System.Reflection.Metadata library from 2669 (mkdir-p bin-dir)
2044the source code included within the Mono source tree.") 2670 (for-each (lambda (file)
2045 (home-page "https://dot.net/") 2671 (install-file file lib-dir))
2672 (find-files "artifacts" "(\\.dll|\\.exe)$"))
2673 (for-each (lambda (file)
2674 (install-file file lib-dir))
2675 (find-files "src/Tasks" "\\.(targets|props|tasks)$"))
2676 (substitute* '("src/MSBuild/app.amd64.config"
2677 "src/MSBuild/app.config")
2678 (("</configuration>")
2679 (string-append "<runpath path=\""
2680 (dirname
2681 (search-input-file inputs
2682 "/lib/mono/4.5/System.Reflection.Metadata.dll"))
2683 ":"
2684 (dirname
2685 (search-input-file inputs
2686 "/lib/mono/4.5/System.Collections.Immutable.dll"))
2687 "\"/></configuration>")))
2688 (copy-file #$(if (target-x86-64? (or (%current-target-system)
2689 (%current-system)))
2690 "src/MSBuild/app.amd64.config"
2691 "src/MSBuild/app.config")
2692 (string-append lib-dir "/MSBuild.exe.config"))
2693 (let* ((msbuild-exe (string-append lib-dir "/MSBuild.exe"))
2694 (wrapper (string-append bin-dir "/msbuild")))
2695 (call-with-output-file wrapper
2696 (lambda (port)
2697 (format port "#!~a
2698exec ~s ~s \"$@\"~%"
2699 (search-input-file inputs "/bin/bash")
2700 (search-input-file inputs "/bin/mono")
2701 msbuild-exe)))
2702 (chmod wrapper #o755))))))))
2703 (synopsis "Microsoft Build Engine (MSBuild) for mono")
2704 (description "This package provides MSBuild, the build tool for .NET.")
2705 (home-page "https://github.com/dotnet/msbuild")
2046 (license license:expat))) 2706 (license license:expat)))