diff options
author | Geod24 <pro.mathias.lang@gmail.com> | 2019-08-16 16:22:10 +0900 |
---|---|---|
committer | Rasmus Thomsen <oss@cogitri.dev> | 2020-03-02 11:42:29 +0100 |
commit | 99910d9bf16077800a7a8f708d787785121a01a4 (patch) | |
tree | dc1999b98b95329b53aaa4010d7a39d9051eb376 /testing/dmd | |
parent | 72a4c23d109b8ea8248887634f5a628cb3d48b21 (diff) | |
download | aports-99910d9bf16077800a7a8f708d787785121a01a4.tar.bz2 aports-99910d9bf16077800a7a8f708d787785121a01a4.tar.xz |
testing/dmd: new aport
D Programming Language reference compiler
https://github.com/dlang/dmd
Diffstat (limited to 'testing/dmd')
-rw-r--r-- | testing/dmd/10-dmd-musl.patch | 26 | ||||
-rw-r--r-- | testing/dmd/20-dmd-remove-tests.patch | 28 | ||||
-rw-r--r-- | testing/dmd/APKBUILD | 63 | ||||
-rw-r--r-- | testing/dmd/dmd-install-config.conf | 5 |
4 files changed, 122 insertions, 0 deletions
diff --git a/testing/dmd/10-dmd-musl.patch b/testing/dmd/10-dmd-musl.patch new file mode 100644 index 0000000000..36a413b7e0 --- /dev/null +++ b/testing/dmd/10-dmd-musl.patch @@ -0,0 +1,26 @@ +diff -Nurp a/dmd/src/dmd/link.d b/dmd/src/dmd/link.d +--- a/dmd/src/dmd/link.d ++++ b/dmd/src/dmd/link.d +@@ -746,6 +746,8 @@ + argv.push("-lrt"); + // Link against libdl for phobos usage of dlopen + argv.push("-ldl"); ++ // Musl ++ argv.push("-lexecinfo"); + } + if (global.params.verbose) + { +diff -Nurp a/dmd/src/dmd/mars.d b/dmd/src/dmd/mars.d +--- a/dmd/src/dmd/mars.d ++++ b/dmd/src/dmd/mars.d +@@ -1194,7 +1194,10 @@ void addDefaultVersionIdentifiers(const ref Param params) + // See https://github.com/dlang/dmd/pull/8020 + // And https://wiki.osdev.org/Target_Triplet + version (CRuntime_Musl) ++ { + VersionCondition.addPredefinedGlobalIdent("CRuntime_Musl"); ++ VersionCondition.addPredefinedGlobalIdent("ExtExecinfo_BSDFmt"); ++ } + else + VersionCondition.addPredefinedGlobalIdent("CRuntime_Glibc"); + VersionCondition.addPredefinedGlobalIdent("CppRuntime_Gcc"); diff --git a/testing/dmd/20-dmd-remove-tests.patch b/testing/dmd/20-dmd-remove-tests.patch new file mode 100644 index 0000000000..bdab43fd12 --- /dev/null +++ b/testing/dmd/20-dmd-remove-tests.patch @@ -0,0 +1,28 @@ +diff -Nurp a/dmd/test/runnable/gdb4181.d b/dmd/test/runnable/gdb4181.d +deleted file mode 100644 +--- a/dmd/test/runnable/gdb4181.d ++++ /dev/null +@@ -1,23 +0,0 @@ +-/* +-REQUIRED_ARGS: -g +-PERMUTE_ARGS: +-GDB_SCRIPT: +---- +-b 22 +-r +-echo RESULT= +-p 'gdb.x' + 'gdb.STest.y' +---- +-GDB_MATCH: RESULT=.*33 +-*/ +-module gdb; +- +-int x; +-struct STest { static int y; } +- +-void main() +-{ +- x = 11; +- STest.y = 22; +- // BP +-} diff --git a/testing/dmd/APKBUILD b/testing/dmd/APKBUILD new file mode 100644 index 0000000000..96db37231b --- /dev/null +++ b/testing/dmd/APKBUILD @@ -0,0 +1,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" diff --git a/testing/dmd/dmd-install-config.conf b/testing/dmd/dmd-install-config.conf new file mode 100644 index 0000000000..d0ba9cac9d --- /dev/null +++ b/testing/dmd/dmd-install-config.conf @@ -0,0 +1,5 @@ +[Environment32] +DFLAGS=-I%@P%/../usr/include/dmd/druntime/ -I%@P%/../usr/include/dmd/phobos/ -L-L%@P%/../lib/ -L--export-dynamic + +[Environment64] +DFLAGS=-I%@P%/../usr/include/dmd/druntime/ -I%@P%/../usr/include/dmd/phobos/ -L-L%@P%/../lib/ -L--export-dynamic -fPIC |