blob: 8f02b160939ceb683a09ef35eab68ed553ef728f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Maintained by the Gentoo Common Lisp project
# irc: #gentoo-lisp, herd: <common-lisp@gentoo.org>, list: <gentoo-lisp@gentoo.org>
#
# This eclass supports the installation of Common Lisp libraries
#
# Public functions:
#
# common-lisp-install path [<other_paths>...]
# recursively install sources
#
# common-lisp-symlink-asdf [<paths>...]
# create symlinks in $CLSYSTEMROOT to asdf files
#
# common-lisp-export-impl-args lisp-implementation
# export a few variables containing the switches necessary
# to make the CL implementation perform basic functions:
# * CL_NORC: don't load initfiles
# * CL_LOAD: load a certain file
# * CL_EVAL: eval a certain expression at startup
#
inherit eutils
# CL packages in the overlay don't have their tarballs on the mirrors
# so it's useless to mirror them
RESTRICT="mirror"
CLSOURCEROOT="${ROOT%/}"/usr/share/common-lisp/source
CLSYSTEMROOT="${ROOT%/}"/usr/share/common-lisp/systems
# Sources will be installed into ${CLSOURCEROOT}/${CLPACKAGE}/
# Any asdf files will be symlinked in ${CLSYSTEMROOT}/${CLSYSTEM} as they may be
# in an arbitrarily deeply nested directory under ${CLSOURCEROOT}/${CLPACKAGE}/
# To override, set these after inheriting this eclass
CLPACKAGE="${PN}"
CLSYSTEMS="${PN}"
RDEPEND="virtual/commonlisp"
EXPORT_FUNCTIONS src_install
absolute-path-p() {
[[ $# = 1 ]] || die "${FUNCNAME[0]} must receive one argument"
[[ ${1} = /* ]]
}
common-lisp-install-source() {
[[ $# = 2 ]] || die "${FUNCNAME[0]} must receive exactly two arguments"
local source="${1}"
local target="${CLSOURCEROOT}/${CLPACKAGE}/${2}"
insinto "${target}"
doins -r "${source}" || die "Failed to install ${source} into $(dirname "${target}")"
}
common-lisp-install() {
[[ $# = 0 ]] && die "${FUNCNAME[0]} must receive at least one argument"
for path in "$@"; do
if absolute-path-p "${path}" ; then
die "Cannot install files with absolute path: ${path}"
fi
common-lisp-install-source "${path}" "$(dirname "${path}")"
done
}
common-lisp-install-single-system() {
[[ $# != 1 ]] && die "${FUNCNAME[0]} must receive exactly one argument"
local file="${CLSOURCEROOT%/}/${CLPACKAGE}/${1}.asd"
[[ -f "${D}"/${file} ]] || die "${D}/${file} does not exist"
dosym "${file}" "${CLSYSTEMROOT%/}/$(basename ${file})"
}
# Symlink asdf files
# if no arguments received, default to the contents of ${CLSYSTEMS}
common-lisp-symlink-asdf() {
dodir "${CLSYSTEMROOT}"
[[ $# = 0 ]] && set - ${CLSYSTEMS}
for package in "$@" ; do
common-lisp-install-single-system "${package}"
done
}
common-lisp-system-symlink() {
die "common-lisp-system-symlink() has been renamed to common-lisp-symlink-asdf()"
}
common-lisp-2_src_install() {
common-lisp-install *.{lisp,asd}
common-lisp-symlink-asdf
for i in README HEADER TODO CHANGELOG ChangeLog CHANGES BUGS CONTRIBUTORS *NEWS ; do
[[ -f ${i} ]] && dodoc ${i}
done
}
common-lisp-export-impl-args() {
if [[ $# != 1 ]]; then
eerror "Usage: ${0} lisp-implementation"
die "${0}: wrong number of arguments: $#"
fi
case ${1} in
clisp)
CL_NORC="-norc"
CL_LOAD="-i"
CL_EVAL="-x"
;;
clozure|ccl|openmcl)
CL_NORC="--no-init"
CL_LOAD="--load"
CL_EVAL="--eval"
;;
cmucl)
CL_NORC="-nositeinit -noinit"
CL_LOAD="-load"
CL_EVAL="-eval"
;;
ecl)
CL_NORC="-norc"
CL_LOAD="-load"
CL_EVAL="-eval"
;;
sbcl)
CL_NORC="--sysinit /dev/null --userinit /dev/null"
CL_LOAD="--load"
CL_EVAL="--eval"
;;
*)
die ${1} is not supported by ${0}
;;
esac
export CL_NORC CL_LOAD CL_EVAL
}
|