aboutsummaryrefslogtreecommitdiffstats
path: root/community/dub/APKBUILD
blob: 91ca7139fb2d4d71adaf132b8ab45c31931d310c (plain) (blame)
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
# Contributor: Mathias LANG <pro.mathias.lang@gmail.com>
# Maintainer: Mathias LANG <pro.mathias.lang@gmail.com>
pkgname=dub
pkgver=1.20.0
pkgrel=0
pkgdesc="Package and build management system for D"
url="http://code.dlang.org/"
arch="all !ppc64le" # GDC does not support PPC64le
license="MIT"
depends="libcurl"
makedepends="gcc-gdc gdmd bash curl-dev"
subpackages="$pkgname-zsh-completion:zsh:noarch $pkgname-doc:doc:noarch"
source="$pkgname-$pkgver.zip::https://github.com/dlang/dub/archive/v$pkgver.zip"

build() {
	DMD=gdmd GITVER="v$pkgver" gdmd -run "$builddir/build.d"

	# Build man pages
	"$builddir/bin/dub" scripts/man/gen_man.d
}

check() {
	bin/dub test
}

package() {
	install -s -D "$builddir/bin/dub" "$pkgdir/usr/bin/dub"
	install -Dm644 "$builddir/scripts/zsh-completion/_dub" "$pkgdir/usr/share/zsh/site-functions/_dub"
	mkdir -p "$pkgdir/usr/share/man/man1/"
	cp "$builddir"/scripts/man/*.1 "$pkgdir/usr/share/man/man1/"
}

zsh() {
	pkgdesc="Zsh completion for dub"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	mkdir -p "$subpkgdir"/usr/share/zsh/site-functions
	mv "$pkgdir"/usr/share/zsh/site-functions/* \
		"$subpkgdir"/usr/share/zsh/site-functions
}

doc() {
	pkgdesc="Man pages for dub"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel docs"

	gzip -9 "$pkgdir"/usr/share/man/man1/*
	mkdir -p "$subpkgdir"/usr/share/man/man1
	mv "$pkgdir"/usr/share/man/man1/* "$subpkgdir"/usr/share/man/man1/
	# Satisfy the linter
	rmdir "$pkgdir"/usr/share/man/man1/
}

sha512sums="ce24097e6ce5ad4acc43af0ef15f69d33aa0ee7717a96769d1125705ed2aa557554cacd8dd6831bc704d4fa93801dcb3f4603795b576c2e0802b20477d208d88  dub-1.20.0.zip"