commit: a71b6049cec777cc4091d4587dcfce17b5fba18e Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> AuthorDate: Fri Jun 16 10:40:20 2023 +0000 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> CommitDate: Fri Jun 16 10:40:52 2023 +0000 URL: https://gitweb.gentoo.org/proj/lisp.git/commit/?id=a71b6049
common-lisp-3.eclass: Sync from gentoo repository Keep inheriting eutils in EAPI 6 for now. Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> eclass/common-lisp-3.eclass | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/eclass/common-lisp-3.eclass b/eclass/common-lisp-3.eclass index d68b4250..0c4d1d0c 100644 --- a/eclass/common-lisp-3.eclass +++ b/eclass/common-lisp-3.eclass @@ -1,15 +1,23 @@ -# 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 <common-l...@gentoo.org> +# @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) inherit eutils ;; + 7) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ -z ${_COMMON_LISP_3_ECLASS} ]]; then +_COMMON_LISP_3_ECLASS=1 # @ECLASS_VARIABLE: CLIMPLEMENTATIONS # @DESCRIPTION: @@ -36,8 +44,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 +126,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 +152,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 +180,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 +211,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 +249,7 @@ common-lisp-export-impl-args() { esac export CL_BINARY CL_NORC CL_LOAD CL_EVAL } + +fi + +EXPORT_FUNCTIONS src_compile src_install