summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 381a19433699daaee94c8cfcc9fc44607713f3d2 (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
# Maintainer: Declan Hoare <declanhoare at exemail dot com dot au>
pkgname=ilspymono-git
pkgver=r2.933d582
pkgrel=1
pkgdesc="CLI reflector for Mono based on ILSpy"
arch=('any')
url="http://github.com/andreif/ILSpyMono"
license=('MIT' 'LGPL2.1' 'custom:MSPL')
depends=('mono')
makedepends=('git')
provides=('ilspymono')
conflicts=('ilspymono')
options=('!strip')
source=("git://github.com/andreif/ILSpy.git"
		"git://github.com/icsharpcode/AvalonEdit.git"
		"git://github.com/icsharpcode/NRefactory.git"
		"git://github.com/jbevain/cecil.git"
		"git://github.com/andreif/ILSpyMono.git")
md5sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')

pkgver() {
  cd ILSpyMono
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd ILSpy
	git submodule init
	git config submodule.AvalonEdit.url "$srcdir/AvalonEdit"
	git config submodule.NRefactory.url "$srcdir/NRefactory"
	git config submodule.cecil.url "$srcdir/cecil"
	git config submodule.ILSpyMono.git "$srcdir/ILSpyMono"
	git submodule update
}

build() {
	cd ILSpy/ILSpyMono
	xbuild /p:Configuration=Release ILSpyMono.csproj
}

package() {
	mkdir -pv "${pkgdir}/usr/"{bin,lib/mono/ilspymono}
	cp ILSpy/ILSpyMono/bin/Release/* "${pkgdir}/usr/lib/mono/ilspymono"
	cat > "${pkgdir}/usr/bin/ilspymono" << EOF
#!/bin/sh
mono /usr/lib/mono/ilspymono/ILSpyMono.exe \$@
EOF
	chmod +x "${pkgdir}/usr/bin/ilspymono"
	# It's kinda tricky - ILSpyMono uses a very straightforward MIT license, but it contains
	# code from ILSpy, which uses a combination of MIT, LGPL, and MS-PL licenses for its
	# various components. On top of that, the MIT license file references the two secondary
	# licenses by filename, and since it doesn't seem like a good idea to invalidate or modify
	# the license, I decided to install both of them next to the main license by their original
	# filenames, even though the LGPL2.1 is an Arch standard license.
	install -D -m644 ILSpy/ILSpyMono/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	install -D -m644 ILSpy/doc/license.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.ILSpy"
	install -D -m644 ILSpy/doc/LGPL.txt "${pkgdir}/usr/share/licenses/${pkgname}/LGPL.txt"
	install -D -m644 ILSpy/doc/MS-PL.txt "${pkgdir}/usr/share/licenses/${pkgname}/MS-PL.txt"
}