commit:     41e4d31b2efa40b3b5f44bee9ee51ea04865cc78
Author:     Andrei Horodniceanu <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Wed Jul  2 03:05:32 2025 +0000
Commit:     Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
CommitDate: Wed Jul  2 03:05:32 2025 +0000
URL:        https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=41e4d31b

dev-util/gdmd: add 15.20250517

Signed-off-by: Andrei Horodniceanu <a.horodniceanu <AT> proton.me>

 dev-util/gdmd/Manifest                |  1 +
 dev-util/gdmd/gdmd-15.20250517.ebuild | 75 +++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+)

diff --git a/dev-util/gdmd/Manifest b/dev-util/gdmd/Manifest
index 0866ade..6ad2503 100644
--- a/dev-util/gdmd/Manifest
+++ b/dev-util/gdmd/Manifest
@@ -1 +1,2 @@
 DIST gdmd-0.1.0.tar.gz 7794 BLAKE2B 
f613c1faf7abb9f72990e21dfdf21e69f4d83fde5d7d6a8a0ccac16a21c0cf39f2d03b2fba7f9b19009b1e2198413c99653635a32cbad48bb8b5dfbf5da1ebab
 SHA512 
54c1b56e252feb024d400a03df7d7b3e5942f98ce6542d77030659ec09bba3770426fc88e143550d24be8272dfa4ff510de8335badfbf9ae6e5f5b6063216fd3
+DIST gdmd-b3b72f59252f09275941f706806ed80d68308db1.tar.gz 9055 BLAKE2B 
6a14c3c3be3fe0cf673d8ac564c898779fd5b94c1ef8a5546826d6d8ab962ea6160d7f49e1cba67554d07552a7b02d5a713989340376ab232a80fb797b55bab1
 SHA512 
e8d1ed3d1a4b4c25157d9ec70369bd6cc209ce8265265921251dc506febc71ef1888f9b2395836f16d5f50d6c7e02d8f50b2169dcd83962dcdc60d5278f444f6

diff --git a/dev-util/gdmd/gdmd-15.20250517.ebuild 
b/dev-util/gdmd/gdmd-15.20250517.ebuild
new file mode 100644
index 0000000..7c5971a
--- /dev/null
+++ b/dev-util/gdmd/gdmd-15.20250517.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit prefix
+
+DESCRIPTION="Wrapper script for gdc that emulates the dmd command"
+HOMEPAGE="https://www.gdcproject.org/";
+
+COMMIT="b3b72f59252f09275941f706806ed80d68308db1"
+SRC_URI="https://github.com/D-Programming-GDC/gdmd/archive/${COMMIT}.tar.gz -> 
gdmd-${COMMIT}.tar.gz"
+S="${WORKDIR}/gdmd-${COMMIT}"
+LICENSE="GPL-3+"
+
+SLOT="$(ver_cut 1)"
+KEYWORDS="~amd64 ~arm64 ~x86"
+RESTRICT="test" # no tests
+
+RDEPEND="
+       dev-lang/perl
+       sys-devel/gcc:${SLOT}[d]
+"
+
+PATCHES="${FILESDIR}/${PN}-no-dmd-conf.patch"
+
+src_prepare() {
+       hprefixify dmd-script
+       default
+}
+
+src_compile() {
+       :
+}
+
+src_install() {
+       local binPath="/usr/${CHOST}/gcc-bin/${SLOT}"
+       exeinto "${binPath}"
+       newexe dmd-script "${CHOST}-gdmd"
+       dosym "${CHOST}-gdmd" "${binPath}/gdmd"
+
+       dosym -r "${binPath}/${CHOST}-gdmd" "/usr/bin/${CHOST}-gdmd-${SLOT}"
+       dosym -r "${binPath}/${CHOST}-gdmd" "/usr/bin/gdmd-${SLOT}"
+}
+
+pkg_postinst() {
+       maybe_update_gcc_config
+}
+
+# We can't really call gcc-config in postrm since it won't know which
+# symlinks under /usr/bin were left by us. If it turns out to be a
+# problem we could try to remove the symlink manually.
+
+maybe_update_gcc_config() {
+       # Call gcc-config if the current configuration if for the same slot
+       # we are installing to. This is needed to make gdmd available in
+       # $PATH.
+
+       local CTARGET=${CTARGET:-${CHOST}}
+
+       # Logic taken from toolchain.eclass and simplified a little
+       local curr_config
+       curr_config=$(gcc-config -c ${CTARGET} 2>&1) || return 0
+
+       local curr_config_ver=$(gcc-config -S ${curr_config} | awk '{print $2}')
+       local curr_specs=$(gcc-config -S ${curr_config} | awk '{print $3}')
+
+       if [[ ${curr_config_ver} == ${SLOT} && ! ${curr_specs} ]]; then
+               # We should call gcc-config to make sure the addition of gdmd is
+               # propagated in $PATH. Don't do anything if not on a traditional
+               # layout, the risk of breaking something outweights having the
+               # script in $PATH.
+               gcc-config "${CTARGET}-${SLOT}"
+       fi
+}

Reply via email to