commit: aa4dca9af20224f56c25937f9f979ddba7ca8dac Author: Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me> AuthorDate: Wed Oct 11 10:05:12 2023 +0000 Commit: Horodniceanu Andrei <a.horodniceanu <AT> proton <DOT> me> CommitDate: Fri Nov 17 20:54:03 2023 +0000 URL: https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=aa4dca9a
dmd.eclass: support EAPI 7 and 8 Signed-off-by: Horodniceanu Andrei <a.horodniceanu <AT> proton.me> eclass/dmd.eclass | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/eclass/dmd.eclass b/eclass/dmd.eclass index 0555f47..7d9e1f5 100644 --- a/eclass/dmd.eclass +++ b/eclass/dmd.eclass @@ -1,6 +1,7 @@ # @ECLASS: dmd.eclass # @MAINTAINER: # Marco Leise <[email protected]> +# @SUPPORTED_EAPIS: 6 7 8 # @BLURB: Captures most of the logic for installing DMD # @DESCRIPTION: # Helps with the maintenance of the various DMD versions by capturing common @@ -21,9 +22,11 @@ if [[ ${_ECLASS_ONCE_DMD} != "recur -_+^+_- spank" ]] ; then _ECLASS_ONCE_DMD="recur -_+^+_- spank" -if has ${EAPI:-0} 0 1 2 3 4 5; then - die "EAPI must be >= 6 for dmd packages." -fi +case ${EAPI:-0} in + 6) inherit eapi7-ver ;; + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac DESCRIPTION="Reference compiler for the D programming language" HOMEPAGE="http://dlang.org/" @@ -32,7 +35,7 @@ HTML_DOCS="html/*" # DMD supports amd64/x86 exclusively MULTILIB_COMPAT=( abi_x86_{32,64} ) -inherit multilib-build eapi7-ver toolchain-funcs +inherit desktop edos2unix multilib-build toolchain-funcs # @FUNCTION: dmd_eq # @DESCRIPTION: @@ -271,7 +274,7 @@ EOF einfo "Installing ${PN}..." # From version 2.066 on, dmd will find dmd.conf in the executable directory, if we # call it through a symlink in /usr/bin - dmd_ge 2.066 && dosym "../../${PREFIX}/bin/dmd" "${ROOT}/usr/bin/dmd-${SLOT}" + dmd_ge 2.066 && dosym "../../${PREFIX}/bin/dmd" "/usr/bin/dmd-${SLOT}" into ${PREFIX} dobin "$(dmd_gen_exe_dir)/dmd" @@ -319,7 +322,7 @@ EOF einstalldocs insinto "/usr/share/doc/${PF}/html" doins "${FILESDIR}/dmd-doc.png" - make_desktop_entry "xdg-open ${ROOT}usr/share/doc/${PF}/html/d/index.html" "DMD ${PV}" "${ROOT}usr/share/doc/${PF}/html/dmd-doc.png" "Development" + make_desktop_entry "xdg-open ${EPREFIX}/usr/share/doc/${PF}/html/d/index.html" "DMD ${PV}" "${EPREFIX}/usr/share/doc/${PF}/html/dmd-doc.png" "Development" fi if use examples; then insinto ${PREFIX}/samples @@ -330,14 +333,14 @@ EOF dmd_pkg_postinst() { # Update active dmd - "${ROOT}"/usr/bin/eselect dlang update dmd + "${ROOT%/}"/usr/bin/eselect dlang update dmd use examples && elog "Examples can be found in: /${PREFIX}/samples" use doc && elog "HTML documentation is in: /usr/share/doc/${PF}/html" } dmd_pkg_postrm() { - "${ROOT}"/usr/bin/eselect dlang update dmd + "${ROOT%/}"/usr/bin/eselect dlang update dmd } dmd_foreach_abi() {
