aboutsummaryrefslogtreecommitdiffstats
path: root/community/ldc
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2020-03-01 23:19:51 +0100
committerRasmus Thomsen <oss@cogitri.dev>2020-03-02 10:46:24 +0100
commit72a4c23d109b8ea8248887634f5a628cb3d48b21 (patch)
tree7485318961d9ee8042d3b53cda9666ce4fdcb30e /community/ldc
parentd841e58042cd10f0928dbb6f99f510b68db2b782 (diff)
downloadaports-72a4c23d109b8ea8248887634f5a628cb3d48b21.tar.bz2
aports-72a4c23d109b8ea8248887634f5a628cb3d48b21.tar.xz
community/ldc: move from testing
Diffstat (limited to 'community/ldc')
-rw-r--r--community/ldc/01-conf.patch33
-rw-r--r--community/ldc/APKBUILD99
2 files changed, 132 insertions, 0 deletions
diff --git a/community/ldc/01-conf.patch b/community/ldc/01-conf.patch
new file mode 100644
index 0000000000..ad01f92d58
--- /dev/null
+++ b/community/ldc/01-conf.patch
@@ -0,0 +1,33 @@
+diff -urp a/ldc2.conf.in b/ldc2.conf.in
+--- a/ldc2.conf.in 2019-10-16 20:53:09.000000000 +0000
++++ b/ldc2.conf.in 2019-10-26 06:43:17.000000000 +0000
+@@ -18,6 +18,7 @@ default:
+ {
+ // default switches injected before all explicit command-line switches
+ switches = [
++ "-linker=bfd",
+ "-defaultlib=druntime-ldc",@ADDITIONAL_DEFAULT_LDC_SWITCHES@
+ ];
+ // default switches appended after all explicit command-line switches
+diff -urp a/ldc2_install.conf.in b/ldc2_install.conf.in
+--- a/ldc2_install.conf.in 2019-10-16 20:53:09.000000000 +0000
++++ b/ldc2_install.conf.in 2019-10-26 06:43:54.000000000 +0000
+@@ -18,6 +18,7 @@ default:
+ {
+ // default switches injected before all explicit command-line switches
+ switches = [
++ "-linker=bfd",
+ "-defaultlib=phobos2-ldc,druntime-ldc",@ADDITIONAL_DEFAULT_LDC_SWITCHES@
+ ];
+ // default switches appended after all explicit command-line switches
+diff -urp a/ldc2_phobos.conf.in b/ldc2_phobos.conf.in
+--- a/ldc2_phobos.conf.in 2019-10-16 20:53:09.000000000 +0000
++++ b/ldc2_phobos.conf.in 2019-10-26 06:51:09.000000000 +0000
+@@ -18,6 +18,7 @@ default:
+ {
+ // default switches injected before all explicit command-line switches
+ switches = [
++ "-linker=bfd",
+ "-defaultlib=phobos2-ldc,druntime-ldc",@ADDITIONAL_DEFAULT_LDC_SWITCHES@
+ ];
+ // default switches appended after all explicit command-line switches
diff --git a/community/ldc/APKBUILD b/community/ldc/APKBUILD
new file mode 100644
index 0000000000..d1008d7e3d
--- /dev/null
+++ b/community/ldc/APKBUILD
@@ -0,0 +1,99 @@
+# Contributor: Mathias LANG <pro.mathias.lang@gmail.com>
+# Maintainer: Mathias LANG <pro.mathias.lang@gmail.com>
+pkgname=ldc
+pkgver=1.20.0
+pkgrel=1
+pkgdesc="The LLVM-based D Compiler"
+url="https://github.com/ldc-developers/ldc"
+# LDC does not support host compiling on most of the architecture Alpine supports
+arch="x86_64"
+license="BSD-3-Clause AND BSL-1.0 AND ( Artistic-1.0 OR GPL-2.0-or-later ) AND NCSA AND MIT"
+depends="libexecinfo tzdata"
+makedepends="chrpath cmake curl-dev diffutils gdmd llvm9-dev llvm9-static libedit-dev libexecinfo-static zlib-dev"
+checkdepends="bash gdb grep llvm9-test-utils"
+# A user might want to install the '-runtime' subpackage when they have
+# a dynamically-linked D program.
+subpackages="$pkgname-runtime $pkgname-static"
+source="https://github.com/ldc-developers/ldc/releases/download/v$pkgver/ldc-$pkgver-src.tar.gz
+ 01-conf.patch
+ "
+builddir="$srcdir/ldc-$pkgver-src/"
+
+build() {
+ # First, build LDC using GDC
+ mkdir -p "$builddir/stage1"
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ cmake \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ -DD_COMPILER='gdmd' \
+ $CMAKE_CROSSOPTS -S "$builddir" -B "$builddir/stage1"
+ make -C "$builddir/stage1"
+
+ # Then, self-build
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DCMAKE_BUILD_TYPE=None \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ -DD_COMPILER="$builddir/stage1/bin/ldmd2" \
+ $CMAKE_CROSSOPTS "$builddir"
+ make
+
+ # Build the test runners
+ make all-test-runners
+
+ # CMake added the rpaths to the shared libs - strip them
+ chrpath -d "$builddir"/lib/*.so*
+}
+
+check() {
+ # Note: The testsuite does not parallelize well, as the 'clean' target get run in parallel.
+ # Hence '-j${JOBS}' was left out on purpose
+ #
+ # - dmd-testsuite takes too long to run and has more to do with language checks
+ # which are less relevant to us than platform integration tests
+ # - lit-test disabled because 'TEST 'LDC :: debuginfo/print_gdb.d' FAILED'
+ # Something to do with TLS variables not being printable in GDB
+ # - 'druntime-test-shared' fails, probably because it is using 'Object.factory'
+ # - 'druntime-test-stdcpp' fails for an unknown reason and is temporarily disabled
+ # - 'druntime-test-exceptions' fails for an unknown reason and is temporarily disabled
+ ctest --output-on-failure -E "dmd-testsuite|lit-tests|druntime-test-exceptions|druntime-test-shared|druntime-test-stdcpp"
+}
+
+package() {
+ depends="$pkgname-static=$pkgver-r$pkgrel"
+ make DESTDIR="$pkgdir" install
+}
+
+runtime() {
+ depends="libexecinfo-dev"
+ pkgdesc="Dynamic runtime library for D code compiled with $pkgname-$pkgver"
+
+ mkdir -p "$subpkgdir/usr/lib/"
+ for libn in "libdruntime" "libphobos2";
+ do
+ mv "$pkgdir"/usr/lib/$libn-ldc-shared.so* "$subpkgdir/usr/lib/"
+ done
+ mv "$pkgdir"/usr/lib/libldc-jit.so* "$subpkgdir/usr/lib"
+
+ mv "$pkgdir"/usr/lib/*.so* "$subpkgdir/usr/lib/"
+}
+
+static() {
+ depends="libexecinfo-static"
+ pkgdesc="$pkgdesc (static library)"
+
+ mkdir -p "$subpkgdir/usr/lib/"
+ mv "$pkgdir"/usr/lib/*.a "$subpkgdir/usr/lib/"
+}
+
+sha512sums="6a94400a9f28bc5fe0d12d5ab5aa188eb84d929c61ee79f3d87e9719f4e72cc1b658c4290d30e038ee6f741ca55f81007965102b0c591d75234aa4ea57d6f21f ldc-1.20.0-src.tar.gz
+eb86e4be0ecf72aaabbd5608c8056bb9cede035895e766330b6d14f14c06dc513fcecc1b6e56ab6fc9fc26c220a689cc8b1394a30a319189c414f1e067c1d983 01-conf.patch"