archrelease: copy trunk to community-any
[ArchLinux/community.git] / dotnet-core / trunk / PKGBUILD
blob89d9d853cca4fad7831cdb543cadc5a19d8dc68f
1 # Maintainer: Maxime Gauduin <alucryd@archlinux.org>
2 # Contributor: Kristian Mosegaard <kristian@mosen.me>
3 # Contributor: Max Liebkies <mail@maxliebkies.de>
4 # Contributor: Krzysztof Bogacki <krzysztof.bogacki@leancode.pl>
6 pkgbase=dotnet-core
7 pkgname=(
8  dotnet-host
9  dotnet-runtime
10  aspnet-runtime
11  dotnet-sdk
12  netstandard-targeting-pack
13  dotnet-targeting-pack
14  aspnet-targeting-pack
16 pkgver=7.0.3.sdk103
17 pkgrel=1
18 _bootstrapver=7.0.102-4
19 arch=(x86_64)
20 url=https://www.microsoft.com/net/core
21 license=(MIT)
22 makedepends=(
23   bash
24   clang
25   cmake
26   git
27   icu
28   inetutils
29   krb5
30   libgit2
31   libunwind
32   libxml2
33   lldb
34   llvm
35   lttng-ust2.12
36   nodejs
37   openssl
38   systemd
39   zlib
41 optdepends=('bash-completion: Bash completion support')
42 options=(
43   !lto
44   staticlibs
46 _tag=276c71d299f6f6dcc3abfd6b3f1fb90c667b4aaa
47 source=(
48   dotnet-installer::git+https://github.com/dotnet/installer.git#tag=${_tag}
49   https://dotnetcli.azureedge.net/source-built-artifacts/assets/Private.SourceBuilt.Artifacts.${_bootstrapver}.tar.gz
50   https://github.com/dotnet/runtime/commit/31e4f404c218eae7ba999c4df5346d30f971451c.patch
51   dotnet.sh
53 noextract=(Private.SourceBuilt.Artifacts.${_bootstrapver}.tar.gz)
54 b2sums=('SKIP'
55         'bbfb246342116aa57dd95673bf5130e4b2f42a5301ba4009683254189e18e1c0af32c373d68a101749b20667353eb77ff792c20a3336ef53a7b1eb2646ea5304'
56         '36e3dcba3be4d6c3a77cdb92287acaaae681078730d9e94dce3025e926b9691c4439a8b790ca4ece643b8162bdcd7d93d2a3860610841f0b282e8e21c0873446'
57         '4a64e3ee550e296bdde894f9202c6f372934cc29154f47d302599b4c368825a96a7b786faa6109a24a1101ff130fd9e4d0ccba094ec91e7f2ca645725bf71b34')
59 prepare() {
60   cd dotnet-installer
61   # fix bootstrap
62   git remote set-url origin https://github.com/dotnet/installer.git
65 pkgver() {
66   cd dotnet-installer
68   if [[ $(git describe --tags) != v7.0.* ]]; then
69     msg "Invalid SDK version"
70     exit 1
71   fi
73   local _standardver=$(xmllint --xpath "//*[local-name()='NETStandardLibraryRefPackageVersion']/text()" eng/Versions.props)
75   if [[ $_standardver != 2.1.0 ]]; then
76     msg "Invalid Standard version '$_standardver'"
77     exit 1
78   fi
80   local _newbootstrapver=$(xmllint --xpath "//*[local-name()='PrivateSourceBuiltArtifactsPackageVersion']/text()" eng/Versions.props)
82   if [[ $_newbootstrapver != $_bootstrapver ]]; then
83     msg "Invalid Bootstrap version '$_newbootstrapver'"
84     exit 1
85   fi
87   local _sdkver=$(xmllint --xpath "//*[local-name()='VersionSDKMinor']/text()" eng/Versions.props)$(xmllint --xpath "//*[local-name()='VersionFeature']/text()" eng/Versions.props)
88   local _runtimever=$(xmllint --xpath "//*[local-name()='MicrosoftNETCoreAppRuntimewinx64PackageVersion']/text()" eng/Versions.props)
90   echo "${_runtimever}.sdk${_sdkver}"
93 build() {
94   export COMPlus_LTTng=0
95   export VERBOSE=1
96   export OPENSSL_ENABLE_SHA1_SIGNATURES=1
98   CFLAGS=$(echo $CFLAGS  | sed -e 's/-fstack-clash-protection//' )
99   CXXFLAGS=$(echo $CXXFLAGS  | sed -e 's/-fstack-clash-protection//' )
100   export EXTRA_CFLAGS="$CFLAGS"
101   export EXTRA_CXXFLAGS="$CXXFLAGS"
102   export EXTRA_LDFLAGS="$LDFLAGS"
103   unset CFLAGS
104   unset CXXFLAGS
105   unset LDFLAGS
107   cd dotnet-installer
109   ./build.sh \
110     /p:ArcadeBuildTarball=true \
111     /p:TarballDir="${srcdir}"/sources
113   cd ../sources
115   pushd src/runtime
116   sed -i -E 's|( /p:BuildDebPackage=false)|\1 /p:EnablePackageValidation=false|' eng/SourceBuild.props
117   sed -i -E 's|( /p:BuildDebPackage=false)|\1 --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE|' eng/SourceBuild.props
118   # https://github.com/dotnet/runtime/issues/79196
119   patch -Np1 -i "${srcdir}"/31e4f404c218eae7ba999c4df5346d30f971451c.patch
120   popd
122   ln -sf "${srcdir}"/Private.SourceBuilt.Artifacts.${_bootstrapver}.tar.gz packages/archive/
124   ./prep.sh --bootstrap
125   ./build.sh \
126     -- \
127     /v:n \
128     /p:ContinueOnPrebuiltBaselineError=true \
129     /p:LogVerbosity=n \
130     /p:MinimalConsoleLogOutput=false \
131     /p:PrebuiltPackagesPath="${srcdir}"/sources/packages \
132     /p:SkipPortableRuntimeBuild=true
135 package_dotnet-host() {
136   pkgdesc='A generic driver for the .NET Core Command Line Interface'
137   depends=(
138     gcc-libs
139     glibc
140   )
141   optdepends=('bash-completion: Bash completion support')
143   cd sources/artifacts/x64/Release
145   install -dm 755 "${pkgdir}"/{etc/profile.d,usr/{bin,lib,share/{dotnet,licenses/dotnet-host}}}
146   bsdtar -xf dotnet-sdk-${pkgver%.*.sdk*}.${pkgver#*sdk}-arch-x64.tar.gz -C "${pkgdir}"/usr/share/dotnet/ --no-same-owner dotnet host
147   bsdtar -xf dotnet-sdk-${pkgver%.*.sdk*}.${pkgver#*sdk}-arch-x64.tar.gz -C "${pkgdir}"/usr/share/licenses/dotnet-host/ --no-same-owner LICENSE.txt ThirdPartyNotices.txt
148   ln -s /usr/share/dotnet/dotnet "${pkgdir}"/usr/bin/dotnet
149   ln -s /usr/share/dotnet/host/fxr/${pkgver%.sdk*}/libhostfxr.so "${pkgdir}"/usr/lib/libhostfxr.so
150   install -Dm 644 ../../../src/sdk/scripts/register-completions.bash "${pkgdir}"/usr/share/bash-completion/completions/dotnet
151   install -Dm 644 ../../../src/sdk/scripts/register-completions.zsh "${pkgdir}"/usr/share/zsh/site-functions/_dotnet
152   install -Dm 644 ../../../../dotnet.sh -t "${pkgdir}"/etc/profile.d/
155 package_dotnet-runtime() {
156   pkgdesc='The .NET Core runtime'
157   depends=(
158     dotnet-host
159     gcc-libs
160     glibc
161     icu
162     libgssapi_krb5.so
163     libunwind
164     zlib
165     openssl
166   )
168   optdepends=('lttng-ust2.12: CoreCLR tracing')
169   provides=(dotnet-runtime-7.0)
170   conflicts=(dotnet-runtime-7.0)
172   cd sources/artifacts/x64/Release
174   install -dm 755 "${pkgdir}"/usr/share/{dotnet,licenses}
175   bsdtar -xf dotnet-sdk-${pkgver%.*.sdk*}.${pkgver#*sdk}-arch-x64.tar.gz -C "${pkgdir}"/usr/share/dotnet/ --no-same-owner shared/Microsoft.NETCore.App
176   ln -s dotnet-host "${pkgdir}"/usr/share/licenses/dotnet-runtime
179 package_aspnet-runtime() {
180   pkgdesc='The ASP.NET Core runtime'
181   depends=(dotnet-runtime)
182   provides=(aspnet-runtime-7.0)
183   conflicts=(aspnet-runtime-7.0)
185   cd sources/artifacts/x64/Release
187   install -dm 755 "${pkgdir}"/usr/share/{dotnet,licenses}
188   bsdtar -xf dotnet-sdk-${pkgver%.*.sdk*}.${pkgver#*sdk}-arch-x64.tar.gz -C "${pkgdir}"/usr/share/dotnet/ --no-same-owner shared/Microsoft.AspNetCore.App
189   ln -s dotnet-host "${pkgdir}"/usr/share/licenses/aspnet-runtime
192 package_dotnet-sdk() {
193   pkgdesc='The .NET Core SDK'
194   depends=(
195     dotnet-runtime
196     dotnet-targeting-pack
197     glibc
198     gcc-libs
199     netstandard-targeting-pack
200   )
201   optdepends=('aspnet-targeting-pack: Build ASP.NET Core applications')
202   provides=(dotnet-sdk-7.0)
203   conflicts=(dotnet-sdk-7.0)
205   cd sources/artifacts/x64/Release
207   install -dm 755 "${pkgdir}"/usr/share/{dotnet,licenses}
208   bsdtar -xf dotnet-sdk-${pkgver%.*.sdk*}.${pkgver#*sdk}-arch-x64.tar.gz -C "${pkgdir}"/usr/share/dotnet/ --no-same-owner sdk sdk-manifests templates
209   ln -s dotnet-host "${pkgdir}"/usr/share/licenses/dotnet-sdk
212 package_netstandard-targeting-pack() {
213   pkgdesc='The .NET Standard targeting pack'
214   provides=(netstandard-targeting-pack-2.1)
215   conflicts=(netstandard-targeting-pack-2.1)
217   cd sources/artifacts/x64/Release
219   install -dm 755 "${pkgdir}"/usr/share/{dotnet,licenses}
220   bsdtar -xf dotnet-sdk-${pkgver%.*.sdk*}.${pkgver#*sdk}-arch-x64.tar.gz -C "${pkgdir}"/usr/share/dotnet/ --no-same-owner packs/NETStandard.Library.Ref
221   ln -s dotnet-host "${pkgdir}"/usr/share/licenses/netstandard-targeting-pack
224 package_dotnet-targeting-pack() {
225   pkgdesc='The .NET Core targeting pack'
226   depends=(netstandard-targeting-pack)
227   provides=(dotnet-targeting-pack-7.0)
228   conflicts=(dotnet-targeting-pack-7.0)
230   cd sources/artifacts/x64/Release
232   install -dm 755 "${pkgdir}"/usr/share/{dotnet,licenses}
233   bsdtar -xf dotnet-sdk-${pkgver%.*.sdk*}.${pkgver#*sdk}-arch-x64.tar.gz -C "${pkgdir}"/usr/share/dotnet/ --no-same-owner packs/Microsoft.NETCore.App.{Host.arch-x64,Ref}
234   ln -s dotnet-host "${pkgdir}"/usr/share/licenses/dotnet-targeting-pack
237 package_aspnet-targeting-pack() {
238   pkgdesc='The ASP.NET Core targeting pack'
239   depends=(dotnet-targeting-pack)
240   provides=(aspnet-targeting-pack-7.0)
241   conflicts=(aspnet-targeting-pack-7.0)
243   cd sources/artifacts/x64/Release
245   install -dm 755 "${pkgdir}"/usr/share/{dotnet,licenses}
246   bsdtar -xf dotnet-sdk-${pkgver%.*.sdk*}.${pkgver#*sdk}-arch-x64.tar.gz -C "${pkgdir}"/usr/share/dotnet/ --no-same-owner packs/Microsoft.AspNetCore.App.Ref
247   ln -s dotnet-host "${pkgdir}"/usr/share/licenses/aspnet-targeting-pack
250 # vim: ts=2 sw=2 et: