1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 [[ ${PV} = *9999* ]] && GIT_ECLASS="git-r3" || GIT_ECLASS=""
8 inherit common-lisp-3 ${GIT_ECLASS} elisp eutils
10 DESCRIPTION="SLIME, the Superior Lisp Interaction Mode (Extended)"
11 HOMEPAGE="http://common-lisp.net/project/slime/"
12 if [[ ${PV} != *9999* ]]; then
13 SRC_URI="https://github.com/slime/slime/archive/v${PV}.tar.gz -> ${P}.tar.gz"
16 LICENSE="GPL-2 xref? ( xref.lisp )"
18 if [[ ${PV} != *9999* ]]; then
19 KEYWORDS="amd64 ppc ~sparc x86"
22 RESTRICT=test # tests fail to contact sbcl
24 RDEPEND="virtual/commonlisp
27 >=sys-apps/texinfo-5.1
28 doc? ( virtual/texi2dvi )"
32 SITEFILE=70${PN}-gentoo.el
35 if [[ ${PV} == *9999* ]]; then
36 EGIT_REPO_URI="https://github.com/slime/slime.git"
37 ${GIT_ECLASS}_src_unpack
43 if [[ "${PV}" == "2.11" ]]; then
44 epatch "${FILESDIR}"/2.11/dont-load-sbcl-pprint.patch
46 epatch "${FILESDIR}"/2.0_p20130214/gentoo-module-load.patch
47 epatch "${FILESDIR}"/2.0_p20110617/gentoo-dont-call-init.patch
48 has_version ">=app-editors/emacs-24" && rm -f lib/cl-lib.el
50 # extract date of last update from ChangeLog, bug 233270
51 SLIME_CHANGELOG_DATE=$(awk '/^[-0-9]+ / { print $1; exit; }' ChangeLog)
52 [ -n "${SLIME_CHANGELOG_DATE}" ] || die "cannot determine ChangeLog date"
54 if [[ "${PV}" == "2.11" ]] || [[ "${PV}" == "2.12" ]]; then
55 # SLIME uses the changelog date to make sure that the emacs side and the CL side
56 # are in sync. We hardcode it instead of letting slime determine it at runtime
57 # because ChangeLog doesn't get installed to $EMACSDIR
58 epatch "${FILESDIR}"/2.11/gentoo-changelog-date.patch
60 epatch "${FILESDIR}"/2.15/gentoo-changelog-date.patch
63 # When starting slime in emacs, slime looks for ${S}/swank/backend.lisp as
64 # /usr/share/common-lisp/source/swank/swank-backend.lisp
72 sed -i "/(defvar \*swank-wire-protocol-version\*/s:nil:\"${SLIME_CHANGELOG_DATE}\":" swank.lisp \
73 || die "sed swank.lisp failed"
74 sed -i "s:@SLIME-CHANGELOG-DATE@:${SLIME_CHANGELOG_DATE}:" slime.el \
75 || die "sed slime.el failed"
76 sed -i "s/@itemx INIT-FUNCTION/@item INIT-FUNCTION/" doc/slime.texi \
77 || die "sed doc/slime.texi failed"
79 # Remove xref.lisp (which is non-free) unless USE flag is set
80 use xref || rm -f xref.lisp
85 BYTECOMPFLAGS="${BYTECOMPFLAGS} -L contrib -l slime" \
86 elisp-compile contrib/*.el lib/*.el
87 emake -j1 -C doc slime.info
90 VARTEXFONTS="${T}"/fonts \
91 emake -j1 -C doc slime.pdf
97 elisp-install ${PN} *.{el,elc} "${FILESDIR}"/swank-loader.lisp
98 sed "s:/usr/:${EPREFIX}&:g" "${FILESDIR}"/2.0_p20110617/${SITEFILE} \
99 >"${T}"/${SITEFILE} || die "sed failed"
100 elisp-site-file-install "${T}"/${SITEFILE}
101 cp "${FILESDIR}"/2.0_p20110617/swank.asd "${S}"
102 # remove upstream swank-loader, since it won't be used
103 rm "${S}"/swank-loader.lisp
104 common-lisp-install-sources *.lisp
105 common-lisp-install-asdf swank.asd
108 elisp-install ${PN}/contrib/ contrib/*.{el,elc,scm,goo}
109 common-lisp-install-sources contrib/*.lisp
112 elisp-install ${PN}/lib/ lib/*.{el,elc}
115 dodoc README.md ChangeLog CONTRIBUTING.md NEWS PROBLEMS
116 newdoc contrib/README.md README-contrib.md
117 newdoc contrib/ChangeLog ChangeLog.contrib
118 doinfo doc/slime.info
119 use doc && dodoc doc/*.pdf