summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba6f942e24d1d9ba5ff6e530267909ef23cb51e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Maintainer: Aaron Brodersen <aaron at abrodersen dot com>
pkgname=dotnet-cli
pkgver="1.0.0_preview2_003121"
pkgrel=3
pkgdesc="A command line utility for building, testing, packaging and running .NET Core applications and libraries"
arch=(x86_64)
url="https://www.microsoft.com/net/core"
license=('MIT')
groups=()
depends=('lldb' 'libunwind' 'icu' 'lttng-ust' 'openssl' 'curl')
makedepends=('cmake' 'make' 'clang' 'llvm' 'gettext')
provides=('dotnet')
conflicts=()
replaces=()
backup=()
options=(staticlibs)
install=

_coreclrver="1.0.4"
_corefxver="1.0.0"

_coreclr="coreclr-${_coreclrver}"
_corefx="corefx-${_corefxver}"

source=(
  "${_coreclr}.tar.gz::https://github.com/dotnet/coreclr/archive/v${_coreclrver}.tar.gz"
  "${_corefx}.tar.gz::https://github.com/dotnet/corefx/archive/v${_corefxver}.tar.gz"
  "${pkgname}-${pkgver}.tar.gz::https://go.microsoft.com/fwlink/?LinkID=816869"
  'gcc6-github-pull-5304.patch'
  'unused-attr-coreclr.patch'
  'unused-attr-corefx.patch'
  'readdir-corefx.patch')
noextract=("${pkgname}-${pkgver}.tar.gz")
sha256sums=('b49ba545fe632dfd5426669ca3300009a5ffd1ccf3c1cf82303dcf44044db33d'
            '98f9475ea42e5d55ad9402424e342a6c0ea7351f3fb5805a602132969b44b774'
            'dde9f8326583f351a89e57095dc523ba92560896cd1d4b8e0ca5ac7fd8499138'
            '0905f9f8e6e33a7a6e5f4acf9ec54ec3796400dce28f0d71c1d1d8bcd9b7e068'
            '8a33c449312f90660d431177f7ee0a36894b75749f79ecf8995c64d82197af90'
            '9ecdd0ca615b988b67cc4c6a9f5035fb3fb70b16d9281d07c17a28a784a6d4ab'
            'dcd3b066f8efec6a4fc5cf6c927c2a352e06dddb7725c3037044271d773474ca')

prepare() {
  cd "${srcdir}/${_coreclr}"
  patch -p1 < "${srcdir}/gcc6-github-pull-5304.patch"
  patch -p1 < "${srcdir}/unused-attr-coreclr.patch"

  cd "${srcdir}/${_corefx}"
  patch -p1 < "${srcdir}/unused-attr-corefx.patch"
  patch -p1 < "${srcdir}/readdir-corefx.patch"
}

build() {
  cd "${srcdir}/${_coreclr}"
  ./build.sh x64 release > /dev/null

  cd "${srcdir}/${_corefx}"
  ./build.sh native x64 release > /dev/null

}

_coreclr_files=(
  'libclrjit.so'
  'libcoreclr.so'
  'libcoreclrtraceptprovider.so'
  'libdbgshim.so'
  'libmscordaccore.so'
  'libmscordbi.so'
  'libsos.so'
  'libsosplugin.so'
  'System.Globalization.Native.so'
)

_corefx_files=(
  'System.IO.Compression.Native.so'
  'System.Native.a'
  'System.Native.so'
  'System.Net.Http.Native.so'
  'System.Net.Security.Native.so'
  'System.Security.Cryptography.Native.so'
)
 
_copy_file() {
  cp --force --preserve=mode $1 "$2/shared/Microsoft.NETCore.App/${_corefxver}/"
}

package() {
  local _outdir="${pkgdir}/opt/dotnet"
  mkdir -p "${_outdir}"

  tar -C "${_outdir}" -xzf "${srcdir}/${pkgname}-${pkgver}.tar.gz"

  local _clrdir="${srcdir}/${_coreclr}"

  for file in "${_coreclr_files[@]}"; do
      _copy_file "${_clrdir}/bin/Product/Linux.x64.Release/${file}" "${_outdir}"
  done

  local _fxdir="${srcdir}/${_corefx}"

  for file in "${_corefx_files[@]}"; do
      _copy_file "${_fxdir}/bin/Linux.x64.Release/Native/${file}" "${_outdir}"
  done

  mkdir -p "${pkgdir}/usr/bin/"
  ln -s "/opt/dotnet/dotnet" "${pkgdir}/usr/bin/dotnet"
  chown -R 0:0 "${_outdir}"
}

# vim:set ts=2 sw=2 et: