commit:     b42d51addcc361331686d6f92fd20ec29fac54c8
Author:     Andrei Horodniceanu <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Mon May 12 02:23:51 2025 +0000
Commit:     Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me>
CommitDate: Mon May 12 02:23:51 2025 +0000
URL:        https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=b42d51ad

dev-util/dfmt: add 0.15.2

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

 dev-util/dfmt/Manifest           |  1 +
 dev-util/dfmt/dfmt-0.15.2.ebuild | 68 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git a/dev-util/dfmt/Manifest b/dev-util/dfmt/Manifest
index 7b8fb9e..46d6057 100644
--- a/dev-util/dfmt/Manifest
+++ b/dev-util/dfmt/Manifest
@@ -1,3 +1,4 @@
 DIST dfmt-0.15.1.tar.gz 120509 BLAKE2B 
a50978d2070f53f47e0bfd959c72402847fbe5f1a9b25ddb48b7f3c62abf905e8264b494812320e13ea84718d4586bff2407ac7c96265aa5067271214b08fddf
 SHA512 
42c35905c90a68f351d1ffb4280d59394d38d81c0f8768dc964d310e9b03361bfc8ef817c9ea844e4867586f9be3160d88bf9b5fe96faf96bffe5254683d21ae
+DIST dfmt-0.15.2.tar.gz 123231 BLAKE2B 
2493b074df826bdfffe9bfc05bd7ee762865c44e48a1a717cbc989c34c6d436cf45c9d2007a81d82067c2acfdf2d03076501f1e7960f04b8566c155982b8cead
 SHA512 
105e0baaff2f78ec8bb3d2a94e0e5b765cf38c6aecc49cc7bef1b152184ace8dfbc741d370cf31f345837a8ece5faae4454de31a5fc9caa367f6159a5e912ef5
 DIST libdparse-fe6d1e38fb4fc04323170389cfec67ed7fd4e24a.tar.gz 158963 BLAKE2B 
4fc7b52921d0c163051b4115076a1473fd7138244bad8052e79298beaccb1ed3c737bbf0ae754f2596133d32cede71704e4ac43c486d69a4390e5654c1993bfa
 SHA512 
cb36b7bfc7d33c0c2c9be25bf4bea1abdbad7c7c9860bbbe725be7d5859255f937fb3b4a2241b47eb4131dd1879819e47704eaadeeb660d5b245008f594107cf
 DIST stdx-allocator-ae237cabd1843774cc78aad0729c914a3dd579db.tar.gz 103650 
BLAKE2B 
8d03c2dc76194b18da92261c533c402b87bda1964662070d02ceacbab3dda91a834c0c8bfe45feb1d9a3d7669f96a2a1f7b9a6b7eff7ea53069480d8de8fe15e
 SHA512 
893e5ecefac86a64b3a91f034cc9f42aabc264d111b40accf890b505ec9d077fcaac0b29fc202400448994e4ff021263beef7716798734cb9b71b6aad1aaf394

diff --git a/dev-util/dfmt/dfmt-0.15.2.ebuild b/dev-util/dfmt/dfmt-0.15.2.ebuild
new file mode 100644
index 0000000..7640397
--- /dev/null
+++ b/dev-util/dfmt/dfmt-0.15.2.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Dfmt is a formatter for D source code"
+HOMEPAGE="https://github.com/dlang-community/dfmt";
+
+LIBDPARSE="fe6d1e38fb4fc04323170389cfec67ed7fd4e24a"
+SRC_URI="
+       https://github.com/dlang-community/dfmt/archive/v${PV}.tar.gz -> 
${PN}-${PV}.tar.gz
+       
https://github.com/dlang-community/libdparse/archive/${LIBDPARSE}.tar.gz -> 
libdparse-${LIBDPARSE}.tar.gz
+       "
+LICENSE="Boost-1.0"
+
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+DLANG_COMPAT=( dmd-2_{106..111} gdc-1{3..5} ldc2-1_{35..40} )
+
+inherit dlang-single bash-completion-r1
+
+REQUIRED_USE=${DLANG_REQUIRED_USE}
+DEPEND=${DLANG_DEPS}
+BDEPEND=${DLANG_DEPS}
+RDEPEND=${DLANG_DEPS}
+
+src_prepare() {
+       mv -T "../libdparse-${LIBDPARSE}" libdparse || die "Couldn't move 
submodule libdparse"
+
+       default
+
+       mkdir bin || die "Failed to create 'bin' directory."
+       echo "v${PV}" > bin/githash.txt
+       touch githash
+
+       # Use our user's flags + $(INCLUDE_PATHS) defined in the makefile
+       export D_FLAGS="$(dlang_get_dmdw_dcflags) $(dlang_get_dmdw_ldflags) 
\$(IMPORTS)"
+       # Tests fail with -march=native and -O2 with 
<sys-devel/gcc-13.2.1_p20240330,
+       # probably https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114171 again.
+       if [[ ${EDC} == gdc-13 && ${D_FLAGS} == *-march=native* ]]; then
+               ewarn '-march=native has been removed from your flags.'
+               ewarn 'See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114171'
+               # Interestingly `-q,` is a valid gdmd flag.
+               export D_FLAGS=${D_FLAGS//-march=native}
+       fi
+}
+
+src_compile() {
+       emake DC="$(dlang_get_dmdw)" DMD_FLAGS="${D_FLAGS}"
+}
+
+src_test() {
+       # Let the makefile add -unittest -g, keeps our code simpler
+       emake bin/dfmt-test DC="$(dlang_get_dmdw)" DMD_COMMON_FLAGS="${D_FLAGS}"
+       ./bin/dfmt-test || die "Unittests failed"
+
+       cd tests || die
+
+       dlang_compile_bin "run_tests" "test.d"
+       ./run_tests || die "Tests failed"
+}
+
+src_install() {
+       dobin bin/dfmt
+       dodoc README.md LICENSE.txt
+       dobashcomp bash-completion/completions/dfmt
+}

Reply via email to