aboutsummaryrefslogtreecommitdiffstats
path: root/community/dtools/APKBUILD
blob: 74a9d9c4cb493678b6a8087149f2c0faed80871f (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
56
57
58
59
60
# Contributor: Mathias LANG <pro.mathias.lang@gmail.com>
# Maintainer: Mathias LANG <pro.mathias.lang@gmail.com>
#
# There are 4 'public' tools in the repository as of v2.090.1
# In addition, there are a few 'build' tools which could be
# useful (and can be trivially added if needed).
#
# Out of those 4 public tools, only 'dman' has heavy dependencies,
# as it rely on building dlang.org (and by extension DMD & co),
# so it is excluded from this package.
pkgname=dtools
pkgver=2.095.1
pkgrel=0
pkgdesc="Ancillary tools for the D programming language compiler"
url="https://github.com/dlang/tools"
arch="x86_64 aarch64"
license="BSL-1.0"
makedepends="ldc llvm-libunwind-dev"
subpackages="$pkgname-ddemangle $pkgname-rdmd $pkgname-dustmite"
source="tools-$pkgver.tar.gz::https://github.com/dlang/tools/archive/v$pkgver.tar.gz
		0001-Add-workaround-for-broken-test.patch"

builddir="$srcdir/tools-$pkgver/"
_outputdir="$builddir/alpine-build/"

build() {
	ldmd2 -O -release "$builddir/ddemangle.d" -of"$_outputdir/ddemangle"
	ldmd2 -O -release "$builddir/DustMite/dustmite.d" "$builddir/DustMite/splitter.d" "$builddir/DustMite/polyhash.d" -of"$_outputdir/dustmite"
	ldmd2 -O -release "$builddir/rdmd.d" -of"$_outputdir/rdmd"
}

check() {
	ldmd2 -run "$builddir/rdmd_test.d" --rdmd-default-compiler=ldmd2 "$_outputdir/rdmd"
}

package() {
	depends="$pkgname-ddemangle $pkgname-dustmite $pkgname-rdmd"

	install -s -D "$_outputdir/ddemangle" "$pkgdir/usr/bin/ddemangle"
	install -s -D "$_outputdir/dustmite" "$pkgdir/usr/bin/dustmite"
	install -s -D "$_outputdir/rdmd" "$pkgdir/usr/bin/rdmd"
}

ddemangle() {
	mkdir -p "$subpkgdir/usr/bin/"
	mv "$pkgdir/usr/bin/ddemangle" "$subpkgdir/usr/bin/ddemangle"
}

dustmite() {
	mkdir -p "$subpkgdir/usr/bin/"
	mv "$pkgdir/usr/bin/dustmite" "$subpkgdir/usr/bin/dustmite"
}

rdmd() {
	mkdir -p "$subpkgdir/usr/bin/"
	mv "$pkgdir/usr/bin/rdmd" "$subpkgdir/usr/bin/rdmd"
}

sha512sums="176d55bcdc99fc56c236f44c7a32d75dd2ca8a7ea3dc635ebe949f64d1fc4a6f7e4e61c342e94ff0d3431df9cc4c16b73133a40d013774e1d6406b4e51b19567  tools-2.095.1.tar.gz
6064a7de3f2e6e031544ffa35823ad198c403f2415a98485df03b2a701cafbfc6ab1640bca71fa5caf4722c36e07bf604a42e6bbeaabe9e9d24d4d86206d8320  0001-Add-workaround-for-broken-test.patch"