diff options
author | Andrei Horodniceanu <a.horodniceanu@proton.me> | 2024-04-26 21:35:41 +0300 |
---|---|---|
committer | Andrei Horodniceanu <a.horodniceanu@proton.me> | 2024-04-26 22:47:45 +0300 |
commit | a2baa88e881a460177184473a321768bf1ac6549 (patch) | |
tree | d9bef5f3aedf59815f07dcfa6a99ed046aefd635 /dev-util | |
parent | dmd-r1.eclass: use dlang_get_abi_bits instead of _get_abi_bits (diff) | |
download | dlang-a2baa88e881a460177184473a321768bf1ac6549.tar.gz dlang-a2baa88e881a460177184473a321768bf1ac6549.tar.bz2 dlang-a2baa88e881a460177184473a321768bf1ac6549.zip |
dev-util/dlang-tools: add 2.108.0
Additional changes:
- enable tests
- remove mirror restriction. It has been added in
dlang-tools-2.067.1.ebuild but I coudn't find a reason for it nor is
it needed or required currently.
Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
Diffstat (limited to 'dev-util')
-rw-r--r-- | dev-util/dlang-tools/Manifest | 1 | ||||
-rw-r--r-- | dev-util/dlang-tools/dlang-tools-2.108.0.ebuild | 113 | ||||
-rw-r--r-- | dev-util/dlang-tools/files/2.108.0-rdmd-disable-make-test.patch | 13 | ||||
-rw-r--r-- | dev-util/dlang-tools/files/gdc-13-fix-parentheses.patch | 26 |
4 files changed, 153 insertions, 0 deletions
diff --git a/dev-util/dlang-tools/Manifest b/dev-util/dlang-tools/Manifest index 194a7b9..0b68e75 100644 --- a/dev-util/dlang-tools/Manifest +++ b/dev-util/dlang-tools/Manifest @@ -1,2 +1,3 @@ DIST dlang-tools-2.106.1.tar.gz 129644 BLAKE2B 014adf42be0c4f82b96d1857eff01e5927a5e179cf99e0928abb2300b7ed3e1e2719e2a38a0ff36dc776b61dcd5ae24affd18ed26a1eabdab1185430eeb888b3 SHA512 bed6ec6cf6287104ad1d5e79e8512094b1aec69be09206104ea58d4bff8af8c5f15012db0237aa195a58baa85a8d880b054ea66a7352fc0684218bfa563b2d32 DIST dlang-tools-2.107.0.tar.gz 128252 BLAKE2B 9d51eda89ab60ca1a98933c8e17ac4ea545d5c8f70ed7f9fec655e8888a37a5487a11345306fd02d7ab27c4ef3127795d4900d47db558ca0e337e163e6102dee SHA512 7e12f29eb230d7160b985bb6f892b8b267d51bdab96c9f75ab0d80d9fea596c106253f2673bfc54084f343116751c827e83aa8a27cad77c71b3475a0f9b2806d +DIST dlang-tools-2.108.0.tar.gz 128260 BLAKE2B de91759bfe75809450eb67c57d05872d5fb1d9a6dde82c3ad8af622fd2068d41290f60b121af60ea4d3a0c7eb555f2e498ab57872c7e7ecb882697a0a32282d7 SHA512 e962a3cebcbe7143fc558a4609f02e59c23b10be15eb1a65147bc49b54ed0b4eb8e3d040045cf9522536a7b016cffb18d66d6db9e26d619c19a2585e0917536a diff --git a/dev-util/dlang-tools/dlang-tools-2.108.0.ebuild b/dev-util/dlang-tools/dlang-tools-2.108.0.ebuild new file mode 100644 index 0000000..b086a62 --- /dev/null +++ b/dev-util/dlang-tools/dlang-tools-2.108.0.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Ancilliary tools for the D programming language compiler" +HOMEPAGE="http://dlang.org/" + +DLANG_SLOT="$(ver_cut 1-2)" + +BETA="$(ver_cut 4)" +VERSION="$(ver_cut 1-3)" + +if [[ -n "${BETA}" ]]; then + # We want to convert a Gentoo version string into an upstream one: 2.097.0_rc1 -> 2.097.0-rc.1 + VERSION="$(ver_rs 3 "-" 4 ".")" +fi +SRC_URI="https://codeload.github.com/dlang/tools/tar.gz/v${VERSION} -> dlang-tools-${VERSION}.tar.gz" +S="${WORKDIR}/tools-${VERSION}" + +LICENSE="Boost-1.0" + +SLOT="0" +KEYWORDS="~amd64 ~x86" + +TOOLS="ddemangle detab dustmite rdmd" +IUSE="+ddemangle detab dustmite +rdmd" + +DLANG_COMPAT=( dmd-2_{106..108} gdc-13 ldc2-1_{35..37} ) + +inherit desktop dlang-single xdg-utils + +PATCHES=( + # The make tests fails due to https://savannah.gnu.org/bugs/?65588 + "${FILESDIR}/2.108.0-rdmd-disable-make-test.patch" + "${FILESDIR}/gdc-13-fix-parentheses.patch" +) + +REQUIRED_USE="|| ( ${TOOLS[@]} ) ${DLANG_REQUIRED_USE}" +DEPEND=${DLANG_DEPS} +BDEPEND=${DLANG_DEPS} +RDEPEND=${DLANG_DEPS} + +src_compile() { + use ddemangle && dlang_compile_bin ddemangle ddemangle.d + use detab && dlang_compile_bin detab detab.d + use dustmite && dlang_compile_bin dustmite DustMite/dustmite.d DustMite/splitter.d DustMite/polyhash.d + use rdmd && dlang_compile_bin rdmd rdmd.d +} + +src_test() { + if use ddemangle; then + dlang_compile_bin ddemangle_ut ddemangle.d $(dlang_get_unittest_flag) + ./ddemangle_ut || die 'ddemangle unittests failed' + fi + if use dustmite; then + dlang_compile_bin dustmite_ut DustMite/dustmite.d DustMite/splitter.d DustMite/polyhash.d $(dlang_get_unittest_flag) + ./dustmite_ut || die 'dustmite unittests failed' + fi + if use rdmd; then + # Add an empty main since gdc doesn't support -main + echo 'void main(){}' >> rdmd.d + dlang_compile_bin rdmd_ut rdmd.d $(dlang_get_unittest_flag) + ./rdmd_ut || die 'rdmd unittests failed' + + # These tests fail with gdc, due to some quirks. + # + # On aarch64, -m64 is not supported by gdc. + # See: https://github.com/dlang/tools/pull/470 + # + # On other arches there is one test failing. See: + # https://github.com/dlang/tools/pull/469 for possible + # solutions. + # + # These issues have existed for a while so ignore the failures. + if [[ ${EDC} == gdc* ]]; then + ewarn "Some rdmd tests have been skipped" + else + dlang_compile_bin rdmd_test rdmd_test.d + local model + # Note that dlang_get_model_flag doesn't work here since it + # is only meant for multilib. + [[ ${ABI} == @(x86|amd64) ]] && model=-m$(dlang_get_abi_bits) + # One test uses make, it can be specified through $MAKE if needed. + ./rdmd_test -v \ + ${model} \ + --rdmd-default-compiler="$(dlang_get_dmdw)" \ + ./rdmd || die 'rdmd tests failed' + fi + + fi +} + +src_install() { + for tool in ${TOOLS}; do + if use "${tool}"; then + dobin "${tool}" + fi + done + + # file icons + for size in 16 22 24 32 48 256; do + newicon --size "${size}" --context mimetypes "${FILESDIR}/icons/${size}/dmd-source.png" text-x-dsrc.png + done +} + +pkg_postinst() { + xdg_icon_cache_update +} + +pkg_postrm() { + xdg_icon_cache_update +} diff --git a/dev-util/dlang-tools/files/2.108.0-rdmd-disable-make-test.patch b/dev-util/dlang-tools/files/2.108.0-rdmd-disable-make-test.patch new file mode 100644 index 0000000..9f9ba1b --- /dev/null +++ b/dev-util/dlang-tools/files/2.108.0-rdmd-disable-make-test.patch @@ -0,0 +1,13 @@ +diff --git a/rdmd_test.d b/rdmd_test.d +index 8815698..4119ced 100755 +--- a/rdmd_test.d ++++ b/rdmd_test.d +@@ -616,7 +616,7 @@ void runTests(string rdmdApp, string compiler, string model) + enforce(res.status == 1, res.output); + } + +- version (Posix) ++ version (none) + { + import std.conv : to; + auto makeVersion = execute(["make", "--version"]).output.splitLines()[0]; diff --git a/dev-util/dlang-tools/files/gdc-13-fix-parentheses.patch b/dev-util/dlang-tools/files/gdc-13-fix-parentheses.patch new file mode 100644 index 0000000..4820fc9 --- /dev/null +++ b/dev-util/dlang-tools/files/gdc-13-fix-parentheses.patch @@ -0,0 +1,26 @@ +diff --git a/DustMite/polyhash.d b/DustMite/polyhash.d +index 5fa9766..0b064d4 100644 +--- a/DustMite/polyhash.d ++++ b/DustMite/polyhash.d +@@ -290,8 +290,8 @@ if (is(T : long) && T.sizeof >= 2) + asm + { + "`~x86SignedOpPrefix!T~`mul`~x86SizeOpSuffix!T~` %3" +- : "=a" low, "=d" high +- : "a" a, "rm" b; ++ : "=a" (low), "=d" (high) ++ : "a" (a), "rm" (b); + } + `); + return typeof(return)(low, high); +@@ -363,8 +363,8 @@ if (is(T : long) && T.sizeof >= 2 && is(L == LongInt!T)) + asm + { + "`~x86SignedOpPrefix!T~`div`~x86SizeOpSuffix!T~` %4" +- : "=a" quotient, "=d" remainder +- : "a" low, "d" high, "rm" b; ++ : "=a" (quotient), "=d" (remainder) ++ : "a" (low), "d" (high), "rm" (b); + } + `); + return typeof(return)(quotient, remainder); |