aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorodniceanu Andrei <a.horodniceanu@proton.me>2024-01-04 00:08:55 +0200
committerHorodniceanu Andrei <a.horodniceanu@proton.me>2024-01-04 00:08:55 +0200
commit68edb2d343a252284207d5cc097acfae0de4a5c3 (patch)
tree0b3c1f5dfda8f12375d187eda672366e702cef86 /dev-lang
parentapp-eselect/eselect-dlang: add 20240103 (diff)
downloaddlang-68edb2d343a252284207d5cc097acfae0de4a5c3.tar.gz
dlang-68edb2d343a252284207d5cc097acfae0de4a5c3.tar.bz2
dlang-68edb2d343a252284207d5cc097acfae0de4a5c3.zip
dev-lang/ldc2: 1.35.0-r1 build D modules separately
Having this feature enabled, compared to building all D modules in one go, on my machine at least, lowers the amount of memory used and speeds up build times. Signed-off-by: Horodniceanu Andrei <a.horodniceanu@proton.me>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/ldc2/ldc2-1.35.0-r1.ebuild82
1 files changed, 82 insertions, 0 deletions
diff --git a/dev-lang/ldc2/ldc2-1.35.0-r1.ebuild b/dev-lang/ldc2/ldc2-1.35.0-r1.ebuild
new file mode 100644
index 0000000..cade36e
--- /dev/null
+++ b/dev-lang/ldc2/ldc2-1.35.0-r1.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build cmake llvm
+
+MY_PV="${PV//_/-}"
+MY_P="ldc-${MY_PV}-src"
+SRC_URI="https://github.com/ldc-developers/ldc/releases/download/v${MY_PV}/${MY_P}.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="LLVM D Compiler"
+HOMEPAGE="https://github.com/ldc-developers/ldc"
+KEYWORDS="~amd64 ~x86"
+LICENSE="BSD"
+SLOT="$(ver_cut 1-2)/$(ver_cut 3)"
+
+IUSE="static-libs"
+
+# Upstream supports LLVM 11.0 through 16.0.
+DEPEND="
+ || (
+ sys-devel/llvm:16
+ sys-devel/llvm:15
+ )
+ <sys-devel/llvm-17:="
+IDEPEND=">=app-eselect/eselect-dlang-20140709"
+RDEPEND="
+ ${DEPEND}
+ ${IDEPEND}"
+
+LLVM_MAX_SLOT=16
+PATCHES="${FILESDIR}/ldc2-1.15.0-link-defaultlib-shared.patch"
+
+# For now, we support amd64 multilib. Anyone is free to add more support here.
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+
+# Upstream supports "2.079-"
+DLANG_VERSION_RANGE="2.100-2.106"
+DLANG_PACKAGE_TYPE="single"
+
+inherit dlang
+
+src_prepare() {
+ cmake_src_prepare
+}
+
+d_src_configure() {
+ # Make sure libphobos2 is installed into ldc2's directory.
+ export LIBDIR_${ABI}="${LIBDIR_HOST}"
+ local mycmakeargs=(
+ -DD_VERSION=2
+ -DCMAKE_INSTALL_PREFIX=/usr/lib/ldc2/$(ver_cut 1-2)
+ -DD_COMPILER="${DMD} $(dlang_dmdw_dcflags)"
+ -DLDC_WITH_LLD=OFF
+ -DCOMPILE_D_MODULES_SEPARATELY=ON
+ )
+ use static-libs && mycmakeargs+=( -DBUILD_SHARED_LIBS=BOTH ) || mycmakeargs+=( -DBUILD_SHARED_LIBS=ON )
+ use abi_x86_32 && use abi_x86_64 && mycmakeargs+=( -DMULTILIB=ON )
+ cmake_src_configure
+}
+
+d_src_compile()
+{
+ cmake_src_compile
+}
+
+d_src_install() {
+ cmake_src_install
+
+ rm -rf "${ED}"/usr/share/bash-completion
+}
+
+pkg_postinst() {
+ # Update active ldc2
+ "${ROOT}"/usr/bin/eselect dlang update ldc2
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect dlang update ldc2
+}