summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eb042b86b9794172a1ee516ebf4826901b3048b6 (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
# Maintainer: Dan Printzell <arch@vild.io>

pkgname=('dfmt-git')
pkgver=0.5.0.r4.ea72aa5
pkgrel=2
pkgdesc="Dfmt is a formatter for D source code "
arch=('i686' 'x86_64')
url="https://github.com/dlang-community/dfmt"
license=("BSL")
groups=('dlang')
makedepends=('dmd' 'git')
depends=('libphobos')
provides=('dfmt')
conflicts=('dfmt')

source=(
	"git+https://github.com/dlang-community/dfmt"
	"git+https://github.com/Hackerpilot/libdparse"
)
sha256sums=(
	'SKIP'
	'SKIP'
)

pkgver() {
	cd "$srcdir/dfmt"
	git describe --long --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g;s/\.rc./rc/g'
}

prepare() {
	cd "$srcdir/dfmt"

	git submodule init
	git config submodule.libdparse.url "$srcdir/libdparse"
	git submodule update
}

build() {
	cd "$srcdir/dfmt"
	make
}

package() {
	# binaries
	install -Dm755 "$srcdir/dfmt/bin/dfmt" "$pkgdir/usr/bin/dfmt"

	# license
	install -Dm644 "$srcdir/dfmt/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}