From bcbae3ec398b3ce5f0785b56a84601f1819ad610 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Fri, 16 Jun 2023 12:40:20 +0200 Subject: common-lisp-3.eclass: Sync from gentoo repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep inheriting eutils in EAPI 6 for now. Signed-off-by: Ulrich Müller --- eclass/common-lisp-3.eclass | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/eclass/common-lisp-3.eclass b/eclass/common-lisp-3.eclass index d68b4250..7afb63bd 100644 --- a/eclass/common-lisp-3.eclass +++ b/eclass/common-lisp-3.eclass @@ -1,15 +1,26 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: common-lisp-3.eclass # @MAINTAINER: # Common Lisp project +# @SUPPORTED_EAPIS: 6 7 # @BLURB: functions to support the installation of Common Lisp libraries # @DESCRIPTION: # Since Common Lisp libraries share similar structure, this eclass aims # to provide a simple way to write ebuilds with these characteristics. -inherit eutils +case ${EAPI} in + 6|7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ -z ${_COMMON_LISP_3_ECLASS} ]]; then +_COMMON_LISP_3_ECLASS=1 + +case ${EAPI} in + 6) inherit eutils ;; +esac # @ECLASS_VARIABLE: CLIMPLEMENTATIONS # @DESCRIPTION: @@ -36,8 +47,6 @@ CLPACKAGE="${PN}" PDEPEND="virtual/commonlisp" -EXPORT_FUNCTIONS src_compile src_install - # @FUNCTION: common-lisp-3_src_compile # @DESCRIPTION: # Since there's nothing to build in most cases, default doesn't do @@ -120,7 +129,17 @@ common-lisp-install-sources() { if [[ -f ${path} ]] ; then common-lisp-install-one-source ${fpredicate} "${path}" "$(dirname "${path}")" elif [[ -d ${path} ]] ; then - common-lisp-install-sources -t ${ftype} $(find "${path}" -type f) + local files + # test can be dropped in EAPI 8 which guarantees bash-5.0 + if [[ ${BASH_VERSINFO[0]} -ge 5 ]]; then + readarray -d '' files < <(find "${path}" -type f -print0 \ + || die "cannot traverse ${path}") + else + # readarray has no -d option in bash-4.2 + readarray -t files < <(find "${path}" -type f -print \ + || die "cannot traverse ${path}") + fi + common-lisp-install-sources -t ${ftype} "${files[@]}" else die "${path} is neither a regular file nor a directory" fi @@ -136,7 +155,7 @@ common-lisp-install-one-asdf() { [[ $# != 1 ]] && die "${FUNCNAME[0]} must receive exactly one argument" # the suffix «.asd» is optional - local source=${1/.asd}.asd + local source=${1%.asd}.asd common-lisp-install-one-source true "${source}" "$(dirname "${source}")" local target="${CLSOURCEROOT%/}/${CLPACKAGE}/${source}" dosym "${target}" "${CLSYSTEMROOT%/}/$(basename ${target})" @@ -164,9 +183,7 @@ common-lisp-install-asdf() { common-lisp-3_src_install() { common-lisp-install-sources . common-lisp-install-asdf - for i in AUTHORS README* HEADER TODO* CHANGELOG Change[lL]og CHANGES BUGS CONTRIBUTORS *NEWS* ; do - [[ -f ${i} ]] && dodoc ${i} - done + einstalldocs } # @FUNCTION: common-lisp-find-lisp-impl @@ -197,6 +214,7 @@ common-lisp-export-impl-args() { CL_BINARY="${1}" case "${CL_BINARY}" in sbcl) + CL_BINARY="${CL_BINARY} --non-interactive" CL_NORC="--sysinit /dev/null --userinit /dev/null" CL_LOAD="--load" CL_EVAL="--eval" @@ -234,3 +252,7 @@ common-lisp-export-impl-args() { esac export CL_BINARY CL_NORC CL_LOAD CL_EVAL } + +fi + +EXPORT_FUNCTIONS src_compile src_install -- cgit v1.2.3-65-gdbad