commit: ba7512166cd29466f24db43dc7a927fa988b99ff
Author: Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Sun Jan 14 10:41:25 2024 +0000
Commit: Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
CommitDate: Sun Jan 14 10:43:54 2024 +0000
URL: https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=ba751216
dev-lang/ldc2: add 1.36.0
Additional changes:
- force disable LDC_ENABLE_ASSERTIONS instead of defaulting to
LLVM_ENABLE_ASSERTIONS
- pass the -NDEBUG flag in the same manner as sys-devel/llvm to prevent
linking errors.
Signed-off-by: Horodniceanu Andrei <a.horodniceanu <AT> proton.me>
dev-lang/ldc2/Manifest | 1 +
dev-lang/ldc2/ldc2-1.36.0.ebuild | 87 ++++++++++++++++++++++++++++++++++++++++
eclass/dlang-compilers.eclass | 1 +
profiles/use.desc | 1 +
4 files changed, 90 insertions(+)
diff --git a/dev-lang/ldc2/Manifest b/dev-lang/ldc2/Manifest
index 49e6954..77ede1e 100644
--- a/dev-lang/ldc2/Manifest
+++ b/dev-lang/ldc2/Manifest
@@ -2,3 +2,4 @@ DIST ldc-1.32.2-src.tar.gz 8116363 BLAKE2B
2fb0c2c01bc6257dcaeca75318e241ebdb9b6
DIST ldc-1.33.0-src.tar.gz 8139266 BLAKE2B
6c2efd0765307815563bc7bd775f1faef3f5e19c82e4aee038f668dd00a2521fa58bd32f6a45d2bc5a3854f31a2d7bd47b1be255aeafc0a4206f72d663b0021f
SHA512
ef5a42934e24caf947b63ef29a62205b07b539a59292266877f2d5f5ecf06272e1fc3ca83772d02eda203e4b166fbcea788b804740b8780b07a4643e4b51bf70
DIST ldc-1.34.0-src.tar.gz 8176200 BLAKE2B
048975a3142da860540ba5378be5214884eb44e2f4492e95aa124a669ccf53bbcf9ccce24f12946948265af5a0de1f5771d21f196052ab53275aa8bb7d0dfb2e
SHA512
c4ceda1d448b91f706719cdea141cb705f9996ea3f86c107620f13e2f50f6a29724a69b5e3b01c51e13dd4e50ba29a280785ce0789188641c90738d774300a06
DIST ldc-1.35.0-src.tar.gz 8241960 BLAKE2B
fb531841e57225f82cddf5135d0b0da98624d33aba76a1d39d98b13deb319556eaad3599ba1461f9f509c6b7b535632b85805de2433bae4ccf50c691c116da3f
SHA512
f85871832455a8e3208f7f905b04ac249a988f8ea2cfe81ed2a67b56404d11a08653b13b6019f45d9dbcf6fbd60086e6aabb13307908d1bbf6d86bd91462dfaa
+DIST ldc-1.36.0-src.tar.gz 8551871 BLAKE2B
b0f09128ab37e332f2eebab3288cac687f91b696ba758d9ecd6fc4d98dc70d13e6fc4e02878028ac530cc9d9449d1148c8c3ed052fecfb18c95bd76437537467
SHA512
e8060ae30ddf659c51b2e57989b14f1d94c58537a3aa0c5afd3cf2906503d66421598014c33fdeb063a5aaea00034b4b11769a2c07cc2dabd7644840241183b4
diff --git a/dev-lang/ldc2/ldc2-1.36.0.ebuild b/dev-lang/ldc2/ldc2-1.36.0.ebuild
new file mode 100644
index 0000000..f6837c0
--- /dev/null
+++ b/dev-lang/ldc2/ldc2-1.36.0.ebuild
@@ -0,0 +1,87 @@
+# 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 ~arm64 ~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:17
+ sys-devel/llvm:16
+ sys-devel/llvm:15
+ )
+ <sys-devel/llvm-18:="
+IDEPEND=">=app-eselect/eselect-dlang-20140709"
+RDEPEND="
+ ${DEPEND}
+ ${IDEPEND}"
+
+LLVM_MAX_SLOT=17
+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}"
+ # We disable assertions so we have to apply the same workaround as for
+ # sys-devel/llvm: add -DNDEBUG to CPPFLAGS.
+ local CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ 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
+ -DLDC_ENABLE_ASSERTIONS=OFF
+ )
+ 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
+}
diff --git a/eclass/dlang-compilers.eclass b/eclass/dlang-compilers.eclass
index fa02ccc..73155e2 100644
--- a/eclass/dlang-compilers.eclass
+++ b/eclass/dlang-compilers.eclass
@@ -45,6 +45,7 @@ dlang-compilers_declare_versions() {
["1.33"]="2.103 amd64 ~arm64 x86"
["1.34"]="2.104 amd64 ~arm64 x86"
["1.35"]="2.105 amd64 ~arm64 x86"
+ ["1.36"]="2.106 ~amd64 ~arm64 ~x86"
)
}
diff --git a/profiles/use.desc b/profiles/use.desc
index 651e261..3e5463d 100644
--- a/profiles/use.desc
+++ b/profiles/use.desc
@@ -11,3 +11,4 @@ ldc2-1_32 - Build for ldc2 1.32
ldc2-1_33 - Build for ldc2 1.33
ldc2-1_34 - Build for ldc2 1.34
ldc2-1_35 - Build for ldc2 1.35
+ldc2-1_36 - Build for ldc2 1.36