# Contributor: Mathias LANG # Maintainer: Mathias LANG pkgname=dmd pkgver=2.091.0 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="b0ed5d6933db54094d6cbe88b56d40410f089b660452031831f66dc19b6e94c38b6b71df7897ee05fdb5d11c6489a6607cc17e20c3653c98d3619c44f5235e50 dmd-2.091.0.tar.gz 49142f9bb9568f82d26dee480c12c1709195f1a8e8a098b83c95e1241cdc0046c632f4fa8821aecb9855cccccbc52b78efe11d8dcc31acd380e0d9d5bf32c03c druntime-2.091.0.tar.gz a9ff10fa13edf74f86b1895467b0f6353722ad5022cc4dc21290e50dd6ec570312171e2a00c9c38f1f8921b348bd97aef25191a1d65d1e45449227016dc40016 phobos-2.091.0.tar.gz 123ec0f256a73030a5e5b4b87a7f2e0752320777b7fcd175a221807ec2917f5d6d88776c3448eab077eb7a2211dd4a3d64e3a556053b0f183eb058da437bc5da dmd-install-config.conf a41784325801f837a333cf4e550025f1f354de690a520529f12cba5e3b7ceddc63e8a9e9c3d06f858f421cfc8209f33eb0be967d39a75011cb07cfd56ac84177 10-dmd-musl.patch e507dad7427a3386a851b4a6c79130253fd59ddac6a460f61f21d0af0e608674ccfe8c9d2ca8b906f1f519210698f9bdf5b4af24d4050112f8ee6f9e8bb2f274 20-dmd-remove-tests.patch"