summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-06-16 12:40:20 +0200
committerUlrich Müller <ulm@gentoo.org>2023-06-16 20:19:09 +0200
commitbcbae3ec398b3ce5f0785b56a84601f1819ad610 (patch)
tree8a3c1a5dc70b01464c0ed6fa92bbc30b08d5bf5e
parentdev-scheme/guile-lib: drop - already in ::gentoo (diff)
downloadlisp-master.tar.gz
lisp-master.tar.bz2
lisp-master.zip
common-lisp-3.eclass: Sync from gentoo repositoryHEADmaster
Keep inheriting eutils in EAPI 6 for now. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--eclass/common-lisp-3.eclass40
1 files 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 <common-lisp@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|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