aboutsummaryrefslogtreecommitdiffstats
path: root/testing/dmd/APKBUILD
blob: 96db37231b1a30d28888e72b5bd07f2bd291eb37 (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
# Contributor: Mathias LANG <pro.mathias.lang@gmail.com>
# Maintainer: Mathias LANG <pro.mathias.lang@gmail.com>
pkgname="dmd"
pkgver="2.090.1"
pkgrel=0
pkgdesc="D Programming Language reference compiler"
url="https://github.com/dlang/dmd"
# TODO: Enable on x86 once LDC-1.20.1 is out (and enabled on x86)
arch="x86_64"
license="BSL-1.0"
depends="libexecinfo-dev tzdata"
makedepends="ldc"
checkdepends="bash diffutils gdb grep"
source="dmd-$pkgver.tar.gz::https://github.com/dlang/dmd/archive/v$pkgver.tar.gz
		druntime-$pkgver.tar.gz::https://github.com/dlang/druntime/archive/v$pkgver.tar.gz
		phobos-$pkgver.tar.gz::https://github.com/dlang/phobos/archive/v$pkgver.tar.gz

		dmd-install-config.conf
		10-dmd-musl.patch
		20-dmd-remove-tests.patch
		"

prepare() {
	# The Makefiles make some assumption about the directory structure
	ln -s "$srcdir/dmd-$pkgver/" "$srcdir/dmd"
	ln -s "$srcdir/druntime-$pkgver/" "$srcdir/druntime"
	ln -s "$srcdir/phobos-$pkgver/" "$srcdir/phobos"

	builddir="$srcdir"
	default_prepare
}

build() {
	# Compile with the host compiler
	make -C "$srcdir/dmd/" -f posix.mak HOST_DMD=ldmd2 ENABLE_RELEASE=1 INSTALL_DIR="$srcdir/install" install
	make -C "$srcdir/druntime/" -f posix.mak ENABLE_RELEASE=1 INSTALL_DIR="$srcdir/install" install
	make -C "$srcdir/phobos/" -f posix.mak ENABLE_RELEASE=1 INSTALL_DIR="$srcdir/install" install
}

check() {
	make -C "$srcdir/dmd-$pkgver/" HOST_DMD=ldmd2 -f posix.mak test
# TODO: This currently does not pass - Some Druntime work needed
#	make -C "$srcdir/druntime-$pkgver/" -f posix.mak unittest
#	make -C "$srcdir/phobos-$pkgver/" -f posix.mak unittest
}

package() {
	mkdir -p "$pkgdir/usr/bin/" "$pkgdir/usr/lib/" "$pkgdir/etc/" "$pkgdir/usr/include/dmd/"

	mv "$srcdir"/install/linux/bin64/dmd "$pkgdir"/usr/bin/dmd
	cp "$srcdir"/dmd-install-config.conf "$pkgdir"/etc/dmd.conf
	mv "$srcdir"/install/linux/lib64/* "$pkgdir"/usr/lib/

	mv "$srcdir"/install/src/druntime/import/ "$pkgdir"/usr/include/dmd/druntime
	mv "$srcdir"/install/src/phobos/ "$pkgdir"/usr/include/dmd/phobos/
}

sha512sums="8750b2e15d74be5075dc68c91153db26d24f747b642075d9acd6c8470ad678cf83bcccce7f65ceea1e4c140f81b1240e2e99afe0ae73c627d6c626e391f441f8  dmd-2.090.1.tar.gz
2cee5f3edb386a91b6107bd700ac740617e82e9688716b3563dbc544a0c1c61edb15a9943f3e47db142e7dd3a714e54fa61c31c4a4914823192e97696dedbc34  druntime-2.090.1.tar.gz
4d1d7bfdac4b5a414a3c41e9cbe4b83a37a49d5d523960aa0d67c41697f8bdb2a92e300f0fe666cdc232ca650530502c8ca4d2ba0457170f3d1f6abd95c0a7af  phobos-2.090.1.tar.gz
123ec0f256a73030a5e5b4b87a7f2e0752320777b7fcd175a221807ec2917f5d6d88776c3448eab077eb7a2211dd4a3d64e3a556053b0f183eb058da437bc5da  dmd-install-config.conf
a41784325801f837a333cf4e550025f1f354de690a520529f12cba5e3b7ceddc63e8a9e9c3d06f858f421cfc8209f33eb0be967d39a75011cb07cfd56ac84177  10-dmd-musl.patch
e507dad7427a3386a851b4a6c79130253fd59ddac6a460f61f21d0af0e608674ccfe8c9d2ca8b906f1f519210698f9bdf5b4af24d4050112f8ee6f9e8bb2f274  20-dmd-remove-tests.patch"