commit:     cb8aca55c8e7964608b8d2ebc27a19ec455c4df9
Author:     Chema Alonso Josa <nimiux <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 21:21:06 2017 +0000
Commit:     José María Alonso <nimiux <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 21:21:06 2017 +0000
URL:        https://gitweb.gentoo.org/proj/lisp.git/commit/?id=cb8aca55

common-lisp-3.eclass: Adds CLIMPLEMENTATIONS variable and 
common-lisp-find-lisp-impl function

 eclass/common-lisp-3.eclass | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/eclass/common-lisp-3.eclass b/eclass/common-lisp-3.eclass
index f0f0b0da..9acf17e3 100644
--- a/eclass/common-lisp-3.eclass
+++ b/eclass/common-lisp-3.eclass
@@ -15,6 +15,11 @@ inherit eutils
 # so it's useless to mirror them
 RESTRICT="mirror"
 
+# @ECLASS-VARIABLE: CLIMPLEMENTATIONS
+# @DESCRIPTION:
+# Common Lisp implementations
+CLIMPLEMENTATIONS="sbcl clisp clozurecl cmucl ecls gcl"
+
 # @ECLASS-VARIABLE: CLSOURCEROOT
 # @DESCRIPTION:
 # Default path of Common Lisp libraries sources. Sources will
@@ -165,11 +170,23 @@ common-lisp-3_src_install() {
        done
 }
 
+# @FUNCTION: common-lisp-find-lisp-impl
+# @USAGE: common-lisp-find-lisp-impl
+# @DESCRIPTION:
+# Outputs an installed Common Lisp implementation. Transverses
+# CLIMPLEMENTATIONS to find it.
+common-lisp-find-lisp-impl() {
+       for lisp in ${CLIMPLEMENTATIONS} ; do
+               [[ "$(best_version dev-lisp/${lisp})" ]] && echo "${lisp}" && 
return
+       done
+       die "No CommonLisp implementation found"
+}
+
 # @FUNCTION: common-lisp-export-impl-args
 # @USAGE: common-lisp-export-impl-args <lisp-implementation>
 # @DESCRIPTION:
-#   Export a few variables containing the switches necessary
-#   to make the CL implementation perform basic functions:
+# Export a few variables containing the switches necessary
+# to make the CL implementation perform basic functions:
 #   * CL_BINARY: Common Lisp implementation
 #   * CL_NORC: don't load syste-wide or user-specific initfiles
 #   * CL_LOAD: load a certain file

Reply via email to