summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e6b1e93398d0943c43bf065d00e7acebe5b41bf5 (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Maintainer: Krakn <dan.ray.beste@gmail.com>
# Contributor: Daniel Isenmann <daniel@archlinux.org>
# Contributor: Brice Carpentier <brice@dlfp.org>

pkgname='mono-git'
_gitname='mono'
pkgver=r112204.ee8c7c80b70
pkgrel=1
pkgdesc='Free implementation of the .NET platform including runtime and compiler'
url='http://www.mono-project.com/'
arch=('i686' 'x86_64')
license=('custom=MITX11' 'custom=MSPL' 'BSD' 'GPL' 'LGPL2.1' 'MPL')
depends=('ca-certificates' 'libgdiplus' 'python' 'zlib')
makedepends=('git' 'mono')
provides=('mono' 'monodoc')
conflicts=('mono' 'monodoc')
install="${_gitname}.install"
source=(
  'git+https://github.com/mono/mono.git'
  'git+https://github.com/mono/aspnetwebstack.git'
  'git+https://github.com/mono/Newtonsoft.Json.git'
  'git+https://github.com/mono/cecil.git'
  'git+https://github.com/mono/rx.git#branch=rx-oss-v2.2'
  'ikvm::git+https://github.com/mono/ikvm-fork.git'
  'git+https://github.com/mono/ikdasm.git'
  'binary-reference-assemblies::git+https://github.com/mono/reference-assemblies.git'
  'nunit-lite::git+https://github.com/mono/NUnitLite.git'
  'nuget-buildtasks::git+https://github.com/mono/NuGet.BuildTasks'
  'cecil-legacy::git+https://github.com/mono/cecil.git#branch=mono-legacy-0.9.5'
  'git+https://github.com/mono/boringssl.git#branch=mono'
  'git+https://github.com/mono/corefx.git'
  'git+https://github.com/mono/bockbuild.git'
  'git+https://github.com/mono/linker.git'
  'git+https://github.com/mono/roslyn-binaries.git'
  'git+https://github.com/mono/corert.git'
  'git+https://github.com/mono/xunit-binaries.git'
  'git+https://github.com/mono/api-doc-tools.git'
  'git+https://github.com/mono/api-snapshot.git'
  'mono.binfmt.d'
)
sha256sums=(
  'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
  'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
  '9a657fc153ef4ce23bf5fc369a26bf4a124e9304bde3744d04c583c54ca47425'
)

pkgver() {
	cd "${_gitname}"

  # Tags are 'broken' for now, use revisions since the beginning of
  # history:
  printf "r%s.%s"                  \
    "$(git rev-list --count HEAD)" \
    "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${_gitname}"

  local submodules=(
    'aspnetwebstack'
    'Newtonsoft.Json'
    'cecil'
    'rx'
    'ikvm'
    'ikdasm'
    'binary-reference-assemblies'
    'nunit-lite'
    'nuget-buildtasks'
    'cecil-legacy'
    'boringssl'
    'corefx'
    'bockbuild'
    'linker'
    'roslyn-binaries'
    'corert'
    'xunit-binaries'
    'api-doc-tools'
    'api-snapshot'
  )

  for module in "${submodules[@]}"; do
    local submodule="external/${module}"
    git submodule init "${submodule}"
    git config "submodule.${submodule}.url" "${srcdir}/${module}"
    git submodule update "${submodule}"
  done
}

build() {
  cd "${_gitname}"

  # Default prefix is /usr/local/
  # Default sysconfdir is /usr/local/etc/
  # Default sbindir is /usr/local/sbin/
  ./autogen.sh         \
    --prefix=/usr      \
    --sbindir=/usr/bin \
    --sysconfdir=/etc  \
    --with-mcs-docs=no

  # If a working installation of mono is not found, attempt to
  # bootstrap the project:
  if ! hash mono; then
    make get-monolite-latest
  fi
  
  make

  cd mcs/jay

  make
}

package() {
  install -D -m 644           \
    "${srcdir}/mono.binfmt.d" \
    "${pkgdir}/usr/lib/binfmt.d/mono.conf"

  cd "${_gitname}"

  make DESTDIR="${pkgdir}" install
  install	-D -m 644 \
    "LICENSE"       \
    "${pkgdir}/usr/share/licenses/${_gitname}/LICENSE"

  cd mcs/jay

  make                       \
    DESTDIR="${pkgdir}"      \
    prefix=/usr              \
    INSTALL=../../install-sh \
    install

  # Fix .pc file to be able to request mono on what it depends, fixes
  # go-oo build:
  sed -i -e           \
    "s:/2.0/:/4.5/:g" \
    "${pkgdir}/usr/lib/pkgconfig/mono-nunit.pc"
  sed -i -e                 \
    "s:#Requires:Requires:" \
    "${pkgdir}/usr/lib/pkgconfig/mono.pc"
}

# vim: ts=2 sw=2 et: