summaryrefslogtreecommitdiff
path: root/app-emacs/slime
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-emacs/slime
reinit the tree, so we can have metadata
Diffstat (limited to 'app-emacs/slime')
-rw-r--r--app-emacs/slime/Manifest21
-rw-r--r--app-emacs/slime/files/2.0_p20110617/70slime-gentoo.el15
-rw-r--r--app-emacs/slime/files/2.0_p20110617/gentoo-dont-call-init.patch16
-rw-r--r--app-emacs/slime/files/2.0_p20110617/swank.asd98
-rw-r--r--app-emacs/slime/files/2.0_p20130214/gentoo-module-load.patch84
-rw-r--r--app-emacs/slime/files/2.11/dont-load-sbcl-pprint.patch13
-rw-r--r--app-emacs/slime/files/2.11/gentoo-changelog-date.patch20
-rw-r--r--app-emacs/slime/files/2.15/gentoo-changelog-date.patch20
-rw-r--r--app-emacs/slime/files/70slime-gentoo.el13
-rw-r--r--app-emacs/slime/files/swank-loader.lisp4
-rw-r--r--app-emacs/slime/metadata.xml43
-rw-r--r--app-emacs/slime/slime-2.0_p20101103.ebuild82
-rw-r--r--app-emacs/slime/slime-2.11.ebuild125
-rw-r--r--app-emacs/slime/slime-2.12.ebuild125
-rw-r--r--app-emacs/slime/slime-2.15.ebuild125
15 files changed, 804 insertions, 0 deletions
diff --git a/app-emacs/slime/Manifest b/app-emacs/slime/Manifest
new file mode 100644
index 000000000000..2174996fbd85
--- /dev/null
+++ b/app-emacs/slime/Manifest
@@ -0,0 +1,21 @@
+AUX 2.0_p20110617/70slime-gentoo.el 573 SHA256 942bcba3b2ed32191f7e531ebeee15d8f35389adb7d89fe6c3e16088a59dab1a SHA512 022e0934c8dcdf208bdfed9810200c8b925059b75e87697760b7e8cc926569da607dc3b723988e1ec49d584c92cdea96afd46642090743e4e593c860a058523f WHIRLPOOL 8293dd3006ff1d63cea569f49bbf86a5c83c4fc780dbd7024070471cea8629ac25e716fc0e9dc5c9ecfc8e9f01a717b762f2aee622ac9b52c8899053c41583e6
+AUX 2.0_p20110617/gentoo-dont-call-init.patch 638 SHA256 ebe27ecb8748a26d943ac480e56a5059fc56ef18816359f8728c909c3875ffd4 SHA512 b99e0dc55e61fda9f21bca9661854b84166834b4330e5f46b10bfd2c3fb61f092046fe8553fdf2d7a7a6350adcd3827315ea681bb53a3ebfec3648b25ac72b84 WHIRLPOOL 8aac59a44df9a7bcb2f274c0262fd6a44fe2be7434e9d7e4e7c37e820f65cda30c237307d10fc992556542c4f8a1a14867846c551d8f129a352fdd6e663ec113
+AUX 2.0_p20110617/swank.asd 4348 SHA256 f87fa018d347616416705c15c0cd3c5dc3f27876ab4eabafd8e623ada389c8ea SHA512 323461a64953c4bd1ca94d68f6a36103c518c69938a205870cd1dcbeb0e3bccc6221a58bf8079ae5c7d17afe06c6732838cc3b2e418ca5dc225603ad3d309479 WHIRLPOOL c254ed1ea86d7e5d045dd450daf46c0bce02fa9dbde081be7afcb2ca1788ccfcbb784304b75ee264b10faf6c920db96934d345c8db8f9c821105cd6862cb71c7
+AUX 2.0_p20130214/gentoo-module-load.patch 3253 SHA256 cea107115bdf7b121a6684d92d2351d58ce008b22a6376cf4ad610e3e5d17be3 SHA512 6489627fad7ab80102b7127bc5e70f74856e0685fbbe4ae92a779f65425b30472ff554cce05e102d2fe652e8216ddcd0f51393651aa3818865a90a215417fcad WHIRLPOOL 56621f3ee5da2bcf3baca92d475844013ebe5e29777ff4000e1b931f2911cc0f8bff71d547596a07e20628302c75476a31d3ea1fff9eca639b9dde0e435959d9
+AUX 2.11/dont-load-sbcl-pprint.patch 556 SHA256 2da392bfd5588cfae087b74b703d8f103d34d446d58d3746c8905cc9fec7257f SHA512 5c0e49aad96da70c74cfda79e8d0654d87ee4996245a22f914ad75902e4acb1315a0c455920a27ca11a15465f8ebbd389655afc5083b0212d16b8541db4f88f4 WHIRLPOOL 7ae9bd2983031355d2014d3aac13baa2cd7168dcda45f1e7cb2c711e5323b8f314dba10369d542f4d3de258ba057db6d5aeae1487f6c23c4dc7f8d3df8d134f7
+AUX 2.11/gentoo-changelog-date.patch 803 SHA256 06d0ad4db7ad7b3013870cfc514677ed9bbfd42c02947a2754c4691da92463d7 SHA512 ae0f07c74988733a070bfd3ca4192ab3de7ebd5bab4705e6419f17986a833a35e0e4f84dad6c0e16cb051eb5ca612ae958a73f3cde327416eb4726a8139ac4b5 WHIRLPOOL c75dc8716606f17dbb4e6d8c726575b7645cb4cfef435e5aba212af683f7aaf85c33a4a2e55194f076ccb2edf3dd3a29681d22facf107aaa6cb5bf3ea097f6d2
+AUX 2.15/gentoo-changelog-date.patch 790 SHA256 15ce86cca6a41d8aeddb865744050b984a06337f082587b87cbce2156f50f0d5 SHA512 f5dd64feccd905d92743135dec9158e258f3bbae06032ab2059878701d9c308416e355ef2a9d01113df8a4763f4d2ce3d15d42e6ed36470065de079c495ca057 WHIRLPOOL a53d2f097cce84016fa624516eec11f7ca5c758eeddc90da3f66f70a52151a4b513e686792bb88d20ab7d47f9d64bc29a7a33c2a8ef87a7a0cd51145c1a3d8c2
+AUX 70slime-gentoo.el 526 SHA256 962ab66f1eb1a2ec4a52c61a59f4fc364978d21373c27f293be2fccccfe135db SHA512 94c84b4a91cad91f553c22cc9d61cb6a77aa0dd723571770159237e7d3e6f2ec0e3dc0a3e139a99bd820da67d019891db1e84d384fb96614f086b54e9bd5769e WHIRLPOOL d7940984922c92667c785a58e6741160083283e0a20a0bc0e277448ae10ba582b6e17ce940a90df8056cb22f50bd93236ded1c3eefc57abdd59776adb90e21c5
+AUX swank-loader.lisp 68 SHA256 1c42cd16fd6af8e377716c633adb9e0d6172df6001e2aa26eed6a33df420d015 SHA512 2d4c86b5ed9e19268356e6cc97a3693b005f20e40d16a94f4df99953108ce21ee46db6c951218bedb5ec34b086835476424af1ed863989bcd18a9123d03982a7 WHIRLPOOL c8966f6f977f855e9d9f83d16bd5805067f20f544afdbb38053520bfdaede1a70a2b8e3dc086ee97230dff9ac5094da1f20eb5700ee6c9486a0bd27e042af389
+DIST slime-2.0_p20101103-patches.tar.bz2 4730 SHA256 9cab942f4ea64ec2f0e127db3b5428513c51899e5518d9f8c2bd9143c644fd19 SHA512 7990a3ffa4a5867fe84e326034aa794d3396dd2a74125e256be33524e2e737e052094fa11f2f486db34dc619e89e9343d4c5d2f84f3972139c2c7ac33248ce2c WHIRLPOOL a11ebfdf6b9054ed07ea8af667a5ef909cbe129531ee63dd3b4556fedc4d0e334ed913423a23acab176312b1c781f3c25f1c499184d7f2c6bfe459d4b67c368b
+DIST slime-2.0_p20101103.tar.bz2 725888 SHA256 0596532fa8cb78e59f685557474bd0ac5d00a79ac84c361ab93f079797a4041f SHA512 cb0cc3232304ef6efec5e01d3660cc649abb3e5803f17c82785b154b6f0b581889ea3b2dcf261be39b16ff22c912c34c7ec84c400856f5c4a29fbeaf7c49851d WHIRLPOOL 3421ea5aa5ed96a3d7b552fe74804bc3e7e822dd21623c0b36f7f84d7ad726fa57d0eb496e15d4ef9ea5027f0c247a3ba8ae7ae46118851c3f0ed13ec1cf482f
+DIST slime-2.11.tar.gz 1054516 SHA256 d63962c22f983a52519fb51b5ca28183aeb23ff6892804d02311e54d73ec8b2a SHA512 9507a4460a2f0d5b4f0857824fcaa36f6efeb09aebde7ca682bdc0214b6a722e471180c34ddce26a8f94d7cf3aae959954565ada314729e803d36767afc3e850 WHIRLPOOL 530c5b341f2ca4a95c954cea848c67cfd027345691feb9c246eb56ecaf6c420b642ed1991f1d615dabc0ca1f54bc6b28482e57c800498cf25a17ce39a7dc0ba3
+DIST slime-2.12.tar.gz 1057243 SHA256 29d57d1036abe69cb62809b5bb31d08c76c3e0e559b7e601b9d76fb7a554d53b SHA512 f18c79cba3eb75761982f2d1f163aab8213b77fa72a689d110fe91b1aa40953516566adc5f771638eee95d33ba8b4c8842ddf99738804483ccfb76a00290b2a1 WHIRLPOOL b0b78101f114514c16cba823dee02aac8a1fee74d23d5623838c2fdedaaa4fda953e6ee9bfcfcd6cf5a174d245f4ba801596c16e0bb67c1729d73a69d0ebc0b1
+DIST slime-2.15.tar.gz 1072190 SHA256 bad1851ce99b7f40b0593dc91842b261b526e0af797e660184159dda05355f50 SHA512 15f943981e35995b225b168a3d1c2099f7205c2ff359fa209f164464caf05f9fab4d24906442d94ddeb4222f7116d09a832c7377baf95fbe02d6a98a721fd611 WHIRLPOOL ff2d8f76314c111782f7c96c6e509197b0620149e683ebbc91714d77d6a0d4b52ba10dad5d8590b321de3867188997876b13fff533ca49361161b8fcff9a48d2
+EBUILD slime-2.0_p20101103.ebuild 2480 SHA256 16a499ad4e413541847c7aa4d80172677b890cde07765a0d0f339b06a328cdfc SHA512 a3e0034f3758b83bd56a90944251e06571e59eda1fd9e0b040372972865720effe46c0f6a56911be705b5e4cabb710d1e6adebb5facb88393ac1c35897fe244f WHIRLPOOL b3d5b752fe16a01f948c64373fa148aed8564306e41ff8457473f54399d8d308b4c6fd25ca9bb17521d1a02686585196e7f0a009520ec68c98aaf551d6243b3e
+EBUILD slime-2.11.ebuild 3830 SHA256 8ea315d1451c8d457134d6885237956198c0c5bcbfebee9c04e100ddfd83170b SHA512 d6a7a7dfd111983bc323233d16b7b477432a33a45787600ae5e30ae224c087675a9ff3565bf772910947dd0bd83e3e4de7d0421626a77767fc7574de318288a9 WHIRLPOOL 75162e196f8b92c8daf278c3ed0d996ef7973f26464734f6b1c38c201f156a7082156386841e21051f22f5a63237b583a2a1d7ef1097f7363a95c08bd8116786
+EBUILD slime-2.12.ebuild 3830 SHA256 8ea315d1451c8d457134d6885237956198c0c5bcbfebee9c04e100ddfd83170b SHA512 d6a7a7dfd111983bc323233d16b7b477432a33a45787600ae5e30ae224c087675a9ff3565bf772910947dd0bd83e3e4de7d0421626a77767fc7574de318288a9 WHIRLPOOL 75162e196f8b92c8daf278c3ed0d996ef7973f26464734f6b1c38c201f156a7082156386841e21051f22f5a63237b583a2a1d7ef1097f7363a95c08bd8116786
+EBUILD slime-2.15.ebuild 3830 SHA256 8ea315d1451c8d457134d6885237956198c0c5bcbfebee9c04e100ddfd83170b SHA512 d6a7a7dfd111983bc323233d16b7b477432a33a45787600ae5e30ae224c087675a9ff3565bf772910947dd0bd83e3e4de7d0421626a77767fc7574de318288a9 WHIRLPOOL 75162e196f8b92c8daf278c3ed0d996ef7973f26464734f6b1c38c201f156a7082156386841e21051f22f5a63237b583a2a1d7ef1097f7363a95c08bd8116786
+MISC ChangeLog 3351 SHA256 200ebccb0514a39bef9d858fd7c7461ab87004fe161bd11cb4c23af569c4d095 SHA512 d498e5f81467a0dcca77e79a22966bfe8936945b7b4fb5de21ebed347233eb6f74d75a43a977bb6301d107f8a18722f8fdabff8109df8b55372dee1034d56dea WHIRLPOOL e1a7be676e004fbb6d13d3b29be1c9042f3023d4c787252626c583525957ae6854e9592e4a31a1d79b7c4f9e9644ccaa9457c82f6193211e8050229b017da3d9
+MISC ChangeLog-2015 18052 SHA256 d5f2845d224c070fafbb70896aaf73fd73609994093d7687c08a5fee4ee0f9db SHA512 6b5ba76b6bdde9c301bc089cf7982b5009636a714386ac766126e164790ffdb53e686d381c7d4dc0b0d3146cfadd7645f566cda2f1424d45f3b61874c0e938b4 WHIRLPOOL fb030dcff0451ed821e49642a3daf18811612ec28c1c5c95dff1c81828861ec73b39d48bcce372f40c4876584f355505dab1ba4afb4514063c70c49409d92a51
+MISC metadata.xml 1658 SHA256 6061586901a271ebb1126f118f64e09dc9b4a9d2dad299859b4a745320e3b46d SHA512 8147f1f31e699a4de10274a27f8c86427f9245050f2297d11804281f12ed9f7bbc1ae0ca615ffb009e7ce4a57b0c0395e4bc95cc5b043f0e24290660fe65b89a WHIRLPOOL 2531436fcf5c12e01d6d42d053b193e2622f3e59f023825348562f09fb87330c033c30d0349c3ad546314156a5f8c62e56fa2b9fdb925c8e9477104e6d127b90
diff --git a/app-emacs/slime/files/2.0_p20110617/70slime-gentoo.el b/app-emacs/slime/files/2.0_p20110617/70slime-gentoo.el
new file mode 100644
index 000000000000..358af67d918d
--- /dev/null
+++ b/app-emacs/slime/files/2.0_p20110617/70slime-gentoo.el
@@ -0,0 +1,15 @@
+;;; site-lisp configuration for SLIME
+
+(add-to-list 'load-path "@SITELISP@")
+(add-to-list 'load-path "@SITELISP@/contrib")
+(autoload 'slime-highlight-edits-mode "slime-highlight-edits")
+
+(require 'slime-autoloads)
+(slime-setup '(slime-fancy slime-asdf slime-banner))
+
+;; this allows us not to require dev-lisp/hyperspec
+;; (which is non-free) as a hard dependency
+(setq common-lisp-hyperspec-root
+ (if (file-exists-p "/usr/share/doc/hyperspec/HyperSpec")
+ "file:///usr/share/doc/hyperspec/HyperSpec/"
+ "http://www.lispworks.com/reference/HyperSpec/"))
diff --git a/app-emacs/slime/files/2.0_p20110617/gentoo-dont-call-init.patch b/app-emacs/slime/files/2.0_p20110617/gentoo-dont-call-init.patch
new file mode 100644
index 000000000000..410c3913a2a1
--- /dev/null
+++ b/app-emacs/slime/files/2.0_p20110617/gentoo-dont-call-init.patch
@@ -0,0 +1,16 @@
+Author: Stelian Ionescu <sionescu@cddr.org>
+Date: 2010-05-14
+Status: Gentoo-only
+Description: Dont' call SWANK-LOADER:INIT on startup since we don't use
+ the upstream swank-loader.lisp
+
+--- a/slime.el
++++ b/slime.el
+@@ -1323,7 +1323,6 @@ See `slime-start'."
+ `(progn
+ (load ,(slime-to-lisp-filename (expand-file-name loader))
+ :verbose t)
+- (funcall (read-from-string "swank-loader:init"))
+ (funcall (read-from-string "swank:start-server")
+ ,(slime-to-lisp-filename port-filename)
+ :coding-system ,encoding)))))
diff --git a/app-emacs/slime/files/2.0_p20110617/swank.asd b/app-emacs/slime/files/2.0_p20110617/swank.asd
new file mode 100644
index 000000000000..b33ca6e67cb0
--- /dev/null
+++ b/app-emacs/slime/files/2.0_p20110617/swank.asd
@@ -0,0 +1,98 @@
+;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
+
+(defpackage #:swank-system
+ (:use #:common-lisp #:asdf))
+
+(in-package #:swank-system)
+
+(defun load-user-init-file ()
+ "Load the user init file, return NIL if it does not exist."
+ (load (merge-pathnames (user-homedir-pathname)
+ (make-pathname :name ".swank" :type "lisp"))
+ :if-does-not-exist nil))
+
+(defun load-site-init-file ()
+ (load (make-pathname :name "site-init" :type "lisp"
+ :defaults (truename
+ (asdf:system-definition-pathname
+ (asdf:find-system :swank))))
+ :if-does-not-exist nil))
+
+(defclass no-load-file (cl-source-file) ())
+
+(defmethod perform ((op load-op) (c no-load-file)) nil)
+
+(defmacro define-swank-system (sysdep-files)
+ `(defsystem :swank
+ :description "Swank is the Common Lisp back-end to SLIME"
+ :serial t
+ :components ((:file "swank-backend")
+ (:file "nregex")
+ ,@(mapcar #'(lambda (component)
+ (if (atom component)
+ (list :file component)
+ component))
+ sysdep-files)
+ (:file "swank-match")
+ (:file "swank-rpc")
+ (:file "swank")
+ (:module "contrib"
+ :components ((:no-load-file "swank-c-p-c")
+ (:no-load-file "swank-arglists"
+ :depends-on ("swank-c-p-c"))
+ (:no-load-file "swank-asdf")
+ (:no-load-file "swank-clipboard")
+ (:no-load-file "swank-fancy-inspector")
+ (:no-load-file "swank-fuzzy"
+ :depends-on ("swank-c-p-c"))
+ (:no-load-file "swank-hyperdoc")
+ (:no-load-file "swank-indentation")
+ (:no-load-file "swank-listener-hooks")
+ (:no-load-file "swank-media")
+ (:no-load-file "swank-motd")
+ (:no-load-file "swank-package-fu")
+ (:no-load-file "swank-presentations")
+ (:no-load-file "swank-presentation-streams"
+ :depends-on ("swank-presentations"))
+ (:no-load-file "swank-sbcl-exts"
+ :depends-on ("swank-arglists"))
+ (:no-load-file "swank-snapshot")
+ (:no-load-file "swank-sprof"))))
+ :depends-on (#+sbcl sb-bsd-sockets)
+ :perform (load-op :after (op swank)
+ (load-site-init-file)
+ (load-user-init-file))))
+
+#+(or cmu scl sbcl openmcl clozurecl lispworks allegro clisp armedbear cormanlisp ecl)
+(define-swank-system
+ #+cmu (swank-source-path-parser swank-source-file-cache swank-cmucl)
+ #+scl (swank-source-path-parser swank-source-file-cache swank-scl)
+ #+sbcl (swank-source-path-parser swank-source-file-cache swank-sbcl swank-gray)
+ #+(or openmcl clozurecl) (metering
+ #.(if (and (find-package "CCL")
+ (fboundp (intern "COMPUTE-APPLICABLE-METHODS-USING-CLASSES" "CCL")))
+ 'swank-ccl
+ 'swank-openmcl)
+ swank-gray)
+ #+lispworks (swank-lispworks swank-gray)
+ #+allegro (swank-allegro swank-gray)
+ #+clisp (xref metering swank-clisp swank-gray)
+ #+armedbear (swank-abcl)
+ #+cormanlisp (swank-corman swank-gray)
+ #+ecl (swank-source-path-parser swank-source-file-cache swank-ecl swank-gray))
+
+#-(or cmu scl sbcl openmcl clozurecl lispworks allegro clisp armedbear cormanlisp ecl)
+(error "Your CL implementation is not supported !")
+
+(defpackage #:swank-loader
+ (:use #:common-lisp)
+ (:export #:*source-directory*))
+
+(in-package #:swank-loader)
+
+(defparameter *source-directory*
+ (asdf:component-pathname (asdf:find-system :swank)))
+
+;; (funcall (intern (string :warn-unimplemented-interfaces) :swank-backend))
+
+;; swank.asd ends here
diff --git a/app-emacs/slime/files/2.0_p20130214/gentoo-module-load.patch b/app-emacs/slime/files/2.0_p20130214/gentoo-module-load.patch
new file mode 100644
index 000000000000..c25a248d04ab
--- /dev/null
+++ b/app-emacs/slime/files/2.0_p20130214/gentoo-module-load.patch
@@ -0,0 +1,84 @@
+--- slime-9999-orig/contrib/swank-arglists.lisp 2012-08-14 06:50:34.000000000 +1000
++++ slime-9999/contrib/swank-arglists.lisp 2013-02-14 21:33:26.879124163 +1100
+@@ -9,8 +9,7 @@
+
+ (in-package :swank)
+
+-(eval-when (:compile-toplevel :load-toplevel :execute)
+- (swank-require :swank-c-p-c))
++(swank-require :swank-c-p-c)
+
+ ;;;; Utilities
+
+--- slime-9999-orig/contrib/swank-fuzzy.lisp 2013-02-02 20:48:51.000000000 +1100
++++ slime-9999/contrib/swank-fuzzy.lisp 2013-02-14 21:35:32.059873714 +1100
+@@ -10,9 +10,8 @@
+
+ (in-package :swank)
+
+-(eval-when (:compile-toplevel :load-toplevel :execute)
+- (swank-require :swank-util)
+- (swank-require :swank-c-p-c))
++(swank-require :swank-util)
++(swank-require :swank-c-p-c)
+
+ ;;; For nomenclature of the fuzzy completion section, please read
+ ;;; through the following docstring.
+--- slime-9999-orig/contrib/swank-sbcl-exts.lisp 2009-09-25 16:43:33.000000000 +1000
++++ slime-9999/contrib/swank-sbcl-exts.lisp 2013-02-14 21:33:26.880124185 +1100
+@@ -7,8 +7,7 @@
+
+ (in-package :swank)
+
+-(eval-when (:compile-toplevel :load-toplevel :execute)
+- (swank-require :swank-arglists))
++(swank-require :swank-arglists)
+
+ ;; We need to do this so users can place `slime-sbcl-exts' into their
+ ;; ~/.emacs, and still use any implementation they want.
+--- slime-9999-orig/swank.lisp 2013-01-11 20:00:30.000000000 +1100
++++ slime-9999/swank.lisp 2013-02-14 22:15:39.624982175 +1100
+@@ -2535,14 +2535,17 @@
+ "Load the module MODULE."
+ (dolist (module (ensure-list modules))
+ (unless (member (string module) *modules* :test #'string=)
+- (require module (if filename
+- (filename-to-pathname filename)
+- (module-filename module)))
++ (let ((*load-print* nil)
++ (*load-verbose* nil)
++ #+cmu (ext:*gc-verbose* nil))
++ (require module (if filename
++ (filename-to-pathname filename)
++ (module-filename module))))
+ (assert (member (string module) *modules* :test #'string=)
+ () "Required module ~s was not provided" module)))
+ *modules*)
+
+-(defvar *find-module* 'find-module
++(defvar *find-module* 'find-module-gentoo
+ "Pluggable function to locate modules.
+ The function receives a module name as argument and should return
+ the filename of the module (or nil if the file doesn't exist).")
+@@ -2572,6 +2575,21 @@
+ (some (lambda (dir) (some #'probe-file (module-canditates name dir)))
+ *load-path*)))
+
++(defun swank-fasl-pathname ()
++ (make-pathname :name nil :type nil
++ :defaults (car (asdf:output-files
++ (make-instance 'asdf:compile-op)
++ (car (asdf:module-components
++ (asdf:find-system :swank)))))))
++
++(defun append-dir (pathname dir)
++ (make-pathname :directory (append (pathname-directory pathname) dir)))
++
++(defun find-module-gentoo (module)
++ (or (let ((*load-path* (list (append-dir (swank-fasl-pathname) '("contrib"))
++ (append-dir swank-loader:*source-directory* '("contrib")))))
++ (find-module module))
++ (find-module module)))
+
+ ;;;; Macroexpansion
+
diff --git a/app-emacs/slime/files/2.11/dont-load-sbcl-pprint.patch b/app-emacs/slime/files/2.11/dont-load-sbcl-pprint.patch
new file mode 100644
index 000000000000..c7dafb6cb91a
--- /dev/null
+++ b/app-emacs/slime/files/2.11/dont-load-sbcl-pprint.patch
@@ -0,0 +1,13 @@
+diff --git a/contrib/swank-presentation-streams.lisp b/contrib/swank-presentation-streams.lisp
+index 0c24bda..bd5a990 100644
+--- a/contrib/swank-presentation-streams.lisp
++++ b/contrib/swank-presentation-streams.lisp
+@@ -65,7 +65,7 @@ be sensitive and remember what object it is in the repl if predicate is true"
+ (funcall ,continue)))))
+
+ ;;; Get pretty printer patches for SBCL at load (not compile) time.
+-#+sbcl
++#+#:disable-dangerous-patching ; #+sbcl
+ (eval-when (:load-toplevel)
+ (handler-bind ((simple-error
+ (lambda (c)
diff --git a/app-emacs/slime/files/2.11/gentoo-changelog-date.patch b/app-emacs/slime/files/2.11/gentoo-changelog-date.patch
new file mode 100644
index 000000000000..4d7669a34d29
--- /dev/null
+++ b/app-emacs/slime/files/2.11/gentoo-changelog-date.patch
@@ -0,0 +1,20 @@
+--- slime-2.11-orig/slime.el 2014-12-01 21:05:54.000000000 +1100
++++ slime-2.11/slime.el 2014-12-19 11:57:45.455393436 +1100
+@@ -134,16 +134,7 @@
+ "Return the datestring of the latest entry in the ChangeLog file.
+ Return nil if the ChangeLog file cannot be found."
+ (interactive "p")
+- (let ((changelog (expand-file-name "ChangeLog" slime-path))
+- (date nil))
+- (when (file-exists-p changelog)
+- (with-temp-buffer
+- (insert-file-contents-literally changelog nil 0 100)
+- (goto-char (point-min))
+- (setq date (symbol-name (read (current-buffer))))))
+- (when interactivep
+- (message "Slime ChangeLog dates %s." date))
+- date)))
++ "@SLIME-CHANGELOG-DATE@"))
+
+ (defvar slime-protocol-version nil)
+ (setq slime-protocol-version
diff --git a/app-emacs/slime/files/2.15/gentoo-changelog-date.patch b/app-emacs/slime/files/2.15/gentoo-changelog-date.patch
new file mode 100644
index 000000000000..c7e815f00fe6
--- /dev/null
+++ b/app-emacs/slime/files/2.15/gentoo-changelog-date.patch
@@ -0,0 +1,20 @@
+--- slime-2.15-orig/slime.el 2015-08-31 07:46:47.000000000 +1000
++++ slime-2.15/slime.el 2015-09-17 17:05:53.616659817 +1000
+@@ -138,16 +138,7 @@
+ "Return the datestring of the latest entry in the ChangeLog file.
+ Return nil if the ChangeLog file cannot be found."
+ (interactive "p")
+- (let ((changelog (slime--changelog-file-name))
+- (date nil))
+- (when (file-exists-p changelog)
+- (with-temp-buffer
+- (insert-file-contents-literally changelog nil 0 100)
+- (goto-char (point-min))
+- (setq date (symbol-name (read (current-buffer))))))
+- (when interactivep
+- (message "Slime ChangeLog dates %s." date))
+- date)))
++ "@SLIME-CHANGELOG-DATE@"))
+
+ (defvar slime-protocol-version nil)
+ (setq slime-protocol-version
diff --git a/app-emacs/slime/files/70slime-gentoo.el b/app-emacs/slime/files/70slime-gentoo.el
new file mode 100644
index 000000000000..6dfd505133e2
--- /dev/null
+++ b/app-emacs/slime/files/70slime-gentoo.el
@@ -0,0 +1,13 @@
+(add-to-list 'load-path "@SITELISP@")
+(add-to-list 'load-path "@SITELISP@/contrib")
+(autoload 'slime-highlight-edits-mode "slime-highlight-edits" nil t)
+
+(require 'slime-autoloads)
+(slime-setup '(slime-fancy slime-asdf slime-banner))
+
+;; this allows us not to require dev-lisp/hyperspec
+;; (which is non-free) as a hard dependency
+(setq common-lisp-hyperspec-root
+ (if (file-exists-p "/usr/share/doc/hyperspec/HyperSpec")
+ "file:///usr/share/doc/hyperspec/HyperSpec/"
+ "http://www.lispworks.com/reference/HyperSpec/"))
diff --git a/app-emacs/slime/files/swank-loader.lisp b/app-emacs/slime/files/swank-loader.lisp
new file mode 100644
index 000000000000..4d9b157312e6
--- /dev/null
+++ b/app-emacs/slime/files/swank-loader.lisp
@@ -0,0 +1,4 @@
+
+;; This file is NOT part of SLIME
+
+(asdf:oos 'asdf:load-op :swank)
diff --git a/app-emacs/slime/metadata.xml b/app-emacs/slime/metadata.xml
new file mode 100644
index 000000000000..17cb00f777c4
--- /dev/null
+++ b/app-emacs/slime/metadata.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>gnu-emacs@gentoo.org</email>
+ <name>Gentoo GNU Emacs project</name>
+</maintainer>
+<maintainer type="project">
+ <email>common-lisp@gentoo.org</email>
+ <name>Gentoo Common Lisp Project</name>
+</maintainer>
+<longdescription>
+ SLIME: The Superior Lisp Interaction Mode for Emacs. SLIME is a
+ fresh, new Emacs mode for Common Lisp development inspired by existing
+ systems such Emacs Lisp and ILISP. Feature highlights include:
+
+ * slime-mode: An Emacs minor-mode to enhance lisp-mode with:
+ o Code evaluation, compilation, and macroexpansion.
+ o Online documentation (describe, apropos, hyperspec).
+ o Definition finding (aka Meta-Point aka M-.).
+ o Symbol and package name completion.
+ o Automatic macro indentation based on &amp;body.
+ o Cross-reference interface (WHO-CALLS, etc).
+ o ... and more.
+
+ * SLDB: Common Lisp debugger with an Emacs-based user interface.
+
+ * REPL: The Read-Eval-Print Loop ("top-level") is written in Emacs
+ Lisp for tighter integration with Emacs. The REPL also has builtin
+ "shortcut" commands similar those of the McCLIM Listener.
+
+ * Compilation notes: SLIME is able to take compiler messages and
+ annotate them directly into source buffers.
+
+ * Inspector: Interactive object-inspector in an Emacs buffer.
+</longdescription>
+<use>
+ <flag name="xref">Install xref.lisp cross-referencing tool</flag>
+</use>
+<upstream>
+ <remote-id type="github">slime/slime</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/app-emacs/slime/slime-2.0_p20101103.ebuild b/app-emacs/slime/slime-2.0_p20101103.ebuild
new file mode 100644
index 000000000000..08e07702bc24
--- /dev/null
+++ b/app-emacs/slime/slime-2.0_p20101103.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=3
+
+inherit common-lisp elisp eutils
+
+DESCRIPTION="SLIME, the Superior Lisp Interaction Mode (Extended)"
+HOMEPAGE="http://common-lisp.net/project/slime/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+ mirror://gentoo/${P}-patches.tar.bz2"
+
+LICENSE="GPL-2 xref? ( xref.lisp )"
+SLOT="0"
+KEYWORDS="amd64 ppc ~sparc x86 ~amd64-linux ~x86-linux ~x86-macos"
+IUSE="doc xref"
+
+RDEPEND="virtual/commonlisp
+ dev-lisp/asdf"
+DEPEND="${RDEPEND}
+ doc? ( virtual/texi2dvi )"
+
+CLPACKAGE=swank
+SITEFILE="70${PN}-gentoo.el"
+
+src_prepare() {
+ EPATCH_SUFFIX=patch epatch
+ mv "${WORKDIR}/swank.asd" "${S}" || die
+
+ # extract date of last update from ChangeLog, bug 233270
+ SLIME_CHANGELOG_DATE=$(awk '/^[-0-9]+ / { print $1; exit; }' ChangeLog)
+ [ -n "${SLIME_CHANGELOG_DATE}" ] || die "cannot determine ChangeLog date"
+
+ sed -i '/^section :=/d' doc/Makefile || die
+ sed -i "/(defvar \*swank-wire-protocol-version\*/s:nil:\"${SLIME_CHANGELOG_DATE}\":" swank.lisp || die
+ sed -i "s:@SLIME-CHANGELOG-DATE@:${SLIME_CHANGELOG_DATE}:" slime.el || die
+ sed -i "s/@itemx INIT-FUNCTION/@item INIT-FUNCTION/" doc/slime.texi \
+ || die "sed doc/slime.texi failed"
+
+ # Remove xref.lisp (which is non-free) unless USE flag is set
+ use xref || rm -f xref.lisp
+}
+
+src_compile() {
+ elisp-compile *.el || die
+ BYTECOMPFLAGS="${BYTECOMPFLAGS} -L contrib -l slime" \
+ elisp-compile contrib/*.el || die
+ emake -j1 -C doc slime.info || die
+
+ if use doc; then
+ VARTEXFONTS="${T}/fonts" emake -j1 -C doc slime.pdf || die
+ fi
+}
+
+src_install() {
+ ## install core
+ elisp-install ${PN} *.{el,elc} "${FILESDIR}/swank-loader.lisp" || die
+ sed "s:/usr/:${EPREFIX}&:g" "${FILESDIR}/${SITEFILE}" >"${T}/${SITEFILE}" \
+ || die
+ elisp-site-file-install "${T}/${SITEFILE}" || die
+
+ # remove upstream swank-loader, since it won't be used
+ rm "${S}/swank-loader.lisp"
+
+ insinto "${CLSOURCEROOT%/}/swank"
+ doins *.lisp swank.asd || die
+ dodir "${CLSYSTEMROOT}" || die
+ dosym "${EPREFIX}${CLSOURCEROOT%/}/swank/swank.asd" \
+ "${CLSYSTEMROOT%/}/swank.asd" || die
+
+ ## install contribs
+ elisp-install ${PN}/contrib/ contrib/*.{el,elc,scm,goo} || die
+ insinto "${CLSOURCEROOT%/}/swank/contrib"
+ doins contrib/*.lisp || die
+
+ ## install docs
+ doinfo doc/slime.info || die
+ dodoc README* ChangeLog HACKING NEWS PROBLEMS
+ newdoc contrib/README README.contrib
+ newdoc contrib/ChangeLog ChangeLog.contrib
+ use doc && dodoc doc/slime.pdf
+}
diff --git a/app-emacs/slime/slime-2.11.ebuild b/app-emacs/slime/slime-2.11.ebuild
new file mode 100644
index 000000000000..bcab613a5c75
--- /dev/null
+++ b/app-emacs/slime/slime-2.11.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+[[ ${PV} = *9999* ]] && GIT_ECLASS="git-r3" || GIT_ECLASS=""
+
+inherit common-lisp-3 ${GIT_ECLASS} elisp eutils
+
+DESCRIPTION="SLIME, the Superior Lisp Interaction Mode (Extended)"
+HOMEPAGE="http://common-lisp.net/project/slime/"
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://github.com/slime/slime/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+LICENSE="GPL-2 xref? ( xref.lisp )"
+SLOT="0"
+if [[ ${PV} == *9999* ]]; then
+ KEYWORDS=""
+else
+ KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+fi
+IUSE="doc xref"
+RESTRICT=test # tests fail to contact sbcl
+
+RDEPEND="virtual/commonlisp
+ dev-lisp/asdf"
+DEPEND="${RDEPEND}
+ >=sys-apps/texinfo-5.1
+ doc? ( virtual/texi2dvi )"
+
+CLPACKAGE=swank
+CLSYSTEMS=swank
+SITEFILE=70${PN}-gentoo.el
+
+src_unpack() {
+ if [[ ${PV} == *9999* ]]; then
+ EGIT_REPO_URI="https://github.com/slime/slime.git"
+ ${GIT_ECLASS}_src_unpack
+ fi
+ elisp_src_unpack
+}
+
+src_prepare() {
+ if [[ "${PV}" == "2.11" ]]; then
+ epatch "${FILESDIR}"/2.11/dont-load-sbcl-pprint.patch
+ fi
+ epatch "${FILESDIR}"/2.0_p20130214/gentoo-module-load.patch
+ epatch "${FILESDIR}"/2.0_p20110617/gentoo-dont-call-init.patch
+ has_version ">=app-editors/emacs-24" && rm -f lib/cl-lib.el
+
+ # extract date of last update from ChangeLog, bug 233270
+ SLIME_CHANGELOG_DATE=$(awk '/^[-0-9]+ / { print $1; exit; }' ChangeLog)
+ [ -n "${SLIME_CHANGELOG_DATE}" ] || die "cannot determine ChangeLog date"
+
+ if [[ "${PV}" == "2.11" ]] || [[ "${PV}" == "2.12" ]]; then
+ # SLIME uses the changelog date to make sure that the emacs side and the CL side
+ # are in sync. We hardcode it instead of letting slime determine it at runtime
+ # because ChangeLog doesn't get installed to $EMACSDIR
+ epatch "${FILESDIR}"/2.11/gentoo-changelog-date.patch
+ else
+ epatch "${FILESDIR}"/2.15/gentoo-changelog-date.patch
+ fi
+
+ # When starting slime in emacs, slime looks for ${S}/swank/backend.lisp as
+ # /usr/share/common-lisp/source/swank/swank-backend.lisp
+ pushd swank || die
+ for i in *.lisp
+ do
+ mv ${i} ../swank-${i}
+ done
+ popd
+
+ sed -i "/(defvar \*swank-wire-protocol-version\*/s:nil:\"${SLIME_CHANGELOG_DATE}\":" swank.lisp \
+ || die "sed swank.lisp failed"
+ sed -i "s:@SLIME-CHANGELOG-DATE@:${SLIME_CHANGELOG_DATE}:" slime.el \
+ || die "sed slime.el failed"
+ sed -i "s/@itemx INIT-FUNCTION/@item INIT-FUNCTION/" doc/slime.texi \
+ || die "sed doc/slime.texi failed"
+
+ # Remove xref.lisp (which is non-free) unless USE flag is set
+ use xref || rm -f xref.lisp
+}
+
+src_compile() {
+ elisp-compile *.el || die
+ BYTECOMPFLAGS="${BYTECOMPFLAGS} -L contrib -l slime" \
+ elisp-compile contrib/*.el lib/*.el || die
+ emake -j1 -C doc slime.info || die "Cannot build info docs"
+
+ if use doc; then
+ VARTEXFONTS="${T}"/fonts \
+ emake -j1 -C doc slime.pdf || die "emake doc failed"
+ fi
+}
+
+src_install() {
+ ## install core
+ elisp-install ${PN} *.{el,elc} "${FILESDIR}"/swank-loader.lisp \
+ || die "Cannot install SLIME core"
+ sed "s:/usr/:${EPREFIX}&:g" "${FILESDIR}"/2.0_p20110617/${SITEFILE} \
+ >"${T}"/${SITEFILE} || die "sed failed"
+ elisp-site-file-install "${T}"/${SITEFILE} || die
+ cp "${FILESDIR}"/2.0_p20110617/swank.asd "${S}"
+ # remove upstream swank-loader, since it won't be used
+ rm "${S}"/swank-loader.lisp
+ common-lisp-install-sources *.lisp
+ common-lisp-install-asdf swank.asd
+
+ ## install contribs
+ elisp-install ${PN}/contrib/ contrib/*.{el,elc,scm,goo} \
+ || die "Cannot install contribs"
+ common-lisp-install-sources contrib/*.lisp
+
+ ## install lib
+ elisp-install ${PN}/lib/ lib/*.{el,elc} \
+ || die "Cannot install libs"
+
+ ## install docs
+ dodoc README.md ChangeLog CONTRIBUTING.md NEWS PROBLEMS
+ newdoc contrib/README.md README-contrib.md
+ newdoc contrib/ChangeLog ChangeLog.contrib
+ doinfo doc/slime.info
+ use doc && dodoc doc/*.pdf
+}
diff --git a/app-emacs/slime/slime-2.12.ebuild b/app-emacs/slime/slime-2.12.ebuild
new file mode 100644
index 000000000000..bcab613a5c75
--- /dev/null
+++ b/app-emacs/slime/slime-2.12.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+[[ ${PV} = *9999* ]] && GIT_ECLASS="git-r3" || GIT_ECLASS=""
+
+inherit common-lisp-3 ${GIT_ECLASS} elisp eutils
+
+DESCRIPTION="SLIME, the Superior Lisp Interaction Mode (Extended)"
+HOMEPAGE="http://common-lisp.net/project/slime/"
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://github.com/slime/slime/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+LICENSE="GPL-2 xref? ( xref.lisp )"
+SLOT="0"
+if [[ ${PV} == *9999* ]]; then
+ KEYWORDS=""
+else
+ KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+fi
+IUSE="doc xref"
+RESTRICT=test # tests fail to contact sbcl
+
+RDEPEND="virtual/commonlisp
+ dev-lisp/asdf"
+DEPEND="${RDEPEND}
+ >=sys-apps/texinfo-5.1
+ doc? ( virtual/texi2dvi )"
+
+CLPACKAGE=swank
+CLSYSTEMS=swank
+SITEFILE=70${PN}-gentoo.el
+
+src_unpack() {
+ if [[ ${PV} == *9999* ]]; then
+ EGIT_REPO_URI="https://github.com/slime/slime.git"
+ ${GIT_ECLASS}_src_unpack
+ fi
+ elisp_src_unpack
+}
+
+src_prepare() {
+ if [[ "${PV}" == "2.11" ]]; then
+ epatch "${FILESDIR}"/2.11/dont-load-sbcl-pprint.patch
+ fi
+ epatch "${FILESDIR}"/2.0_p20130214/gentoo-module-load.patch
+ epatch "${FILESDIR}"/2.0_p20110617/gentoo-dont-call-init.patch
+ has_version ">=app-editors/emacs-24" && rm -f lib/cl-lib.el
+
+ # extract date of last update from ChangeLog, bug 233270
+ SLIME_CHANGELOG_DATE=$(awk '/^[-0-9]+ / { print $1; exit; }' ChangeLog)
+ [ -n "${SLIME_CHANGELOG_DATE}" ] || die "cannot determine ChangeLog date"
+
+ if [[ "${PV}" == "2.11" ]] || [[ "${PV}" == "2.12" ]]; then
+ # SLIME uses the changelog date to make sure that the emacs side and the CL side
+ # are in sync. We hardcode it instead of letting slime determine it at runtime
+ # because ChangeLog doesn't get installed to $EMACSDIR
+ epatch "${FILESDIR}"/2.11/gentoo-changelog-date.patch
+ else
+ epatch "${FILESDIR}"/2.15/gentoo-changelog-date.patch
+ fi
+
+ # When starting slime in emacs, slime looks for ${S}/swank/backend.lisp as
+ # /usr/share/common-lisp/source/swank/swank-backend.lisp
+ pushd swank || die
+ for i in *.lisp
+ do
+ mv ${i} ../swank-${i}
+ done
+ popd
+
+ sed -i "/(defvar \*swank-wire-protocol-version\*/s:nil:\"${SLIME_CHANGELOG_DATE}\":" swank.lisp \
+ || die "sed swank.lisp failed"
+ sed -i "s:@SLIME-CHANGELOG-DATE@:${SLIME_CHANGELOG_DATE}:" slime.el \
+ || die "sed slime.el failed"
+ sed -i "s/@itemx INIT-FUNCTION/@item INIT-FUNCTION/" doc/slime.texi \
+ || die "sed doc/slime.texi failed"
+
+ # Remove xref.lisp (which is non-free) unless USE flag is set
+ use xref || rm -f xref.lisp
+}
+
+src_compile() {
+ elisp-compile *.el || die
+ BYTECOMPFLAGS="${BYTECOMPFLAGS} -L contrib -l slime" \
+ elisp-compile contrib/*.el lib/*.el || die
+ emake -j1 -C doc slime.info || die "Cannot build info docs"
+
+ if use doc; then
+ VARTEXFONTS="${T}"/fonts \
+ emake -j1 -C doc slime.pdf || die "emake doc failed"
+ fi
+}
+
+src_install() {
+ ## install core
+ elisp-install ${PN} *.{el,elc} "${FILESDIR}"/swank-loader.lisp \
+ || die "Cannot install SLIME core"
+ sed "s:/usr/:${EPREFIX}&:g" "${FILESDIR}"/2.0_p20110617/${SITEFILE} \
+ >"${T}"/${SITEFILE} || die "sed failed"
+ elisp-site-file-install "${T}"/${SITEFILE} || die
+ cp "${FILESDIR}"/2.0_p20110617/swank.asd "${S}"
+ # remove upstream swank-loader, since it won't be used
+ rm "${S}"/swank-loader.lisp
+ common-lisp-install-sources *.lisp
+ common-lisp-install-asdf swank.asd
+
+ ## install contribs
+ elisp-install ${PN}/contrib/ contrib/*.{el,elc,scm,goo} \
+ || die "Cannot install contribs"
+ common-lisp-install-sources contrib/*.lisp
+
+ ## install lib
+ elisp-install ${PN}/lib/ lib/*.{el,elc} \
+ || die "Cannot install libs"
+
+ ## install docs
+ dodoc README.md ChangeLog CONTRIBUTING.md NEWS PROBLEMS
+ newdoc contrib/README.md README-contrib.md
+ newdoc contrib/ChangeLog ChangeLog.contrib
+ doinfo doc/slime.info
+ use doc && dodoc doc/*.pdf
+}
diff --git a/app-emacs/slime/slime-2.15.ebuild b/app-emacs/slime/slime-2.15.ebuild
new file mode 100644
index 000000000000..bcab613a5c75
--- /dev/null
+++ b/app-emacs/slime/slime-2.15.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+[[ ${PV} = *9999* ]] && GIT_ECLASS="git-r3" || GIT_ECLASS=""
+
+inherit common-lisp-3 ${GIT_ECLASS} elisp eutils
+
+DESCRIPTION="SLIME, the Superior Lisp Interaction Mode (Extended)"
+HOMEPAGE="http://common-lisp.net/project/slime/"
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://github.com/slime/slime/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+LICENSE="GPL-2 xref? ( xref.lisp )"
+SLOT="0"
+if [[ ${PV} == *9999* ]]; then
+ KEYWORDS=""
+else
+ KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+fi
+IUSE="doc xref"
+RESTRICT=test # tests fail to contact sbcl
+
+RDEPEND="virtual/commonlisp
+ dev-lisp/asdf"
+DEPEND="${RDEPEND}
+ >=sys-apps/texinfo-5.1
+ doc? ( virtual/texi2dvi )"
+
+CLPACKAGE=swank
+CLSYSTEMS=swank
+SITEFILE=70${PN}-gentoo.el
+
+src_unpack() {
+ if [[ ${PV} == *9999* ]]; then
+ EGIT_REPO_URI="https://github.com/slime/slime.git"
+ ${GIT_ECLASS}_src_unpack
+ fi
+ elisp_src_unpack
+}
+
+src_prepare() {
+ if [[ "${PV}" == "2.11" ]]; then
+ epatch "${FILESDIR}"/2.11/dont-load-sbcl-pprint.patch
+ fi
+ epatch "${FILESDIR}"/2.0_p20130214/gentoo-module-load.patch
+ epatch "${FILESDIR}"/2.0_p20110617/gentoo-dont-call-init.patch
+ has_version ">=app-editors/emacs-24" && rm -f lib/cl-lib.el
+
+ # extract date of last update from ChangeLog, bug 233270
+ SLIME_CHANGELOG_DATE=$(awk '/^[-0-9]+ / { print $1; exit; }' ChangeLog)
+ [ -n "${SLIME_CHANGELOG_DATE}" ] || die "cannot determine ChangeLog date"
+
+ if [[ "${PV}" == "2.11" ]] || [[ "${PV}" == "2.12" ]]; then
+ # SLIME uses the changelog date to make sure that the emacs side and the CL side
+ # are in sync. We hardcode it instead of letting slime determine it at runtime
+ # because ChangeLog doesn't get installed to $EMACSDIR
+ epatch "${FILESDIR}"/2.11/gentoo-changelog-date.patch
+ else
+ epatch "${FILESDIR}"/2.15/gentoo-changelog-date.patch
+ fi
+
+ # When starting slime in emacs, slime looks for ${S}/swank/backend.lisp as
+ # /usr/share/common-lisp/source/swank/swank-backend.lisp
+ pushd swank || die
+ for i in *.lisp
+ do
+ mv ${i} ../swank-${i}
+ done
+ popd
+
+ sed -i "/(defvar \*swank-wire-protocol-version\*/s:nil:\"${SLIME_CHANGELOG_DATE}\":" swank.lisp \
+ || die "sed swank.lisp failed"
+ sed -i "s:@SLIME-CHANGELOG-DATE@:${SLIME_CHANGELOG_DATE}:" slime.el \
+ || die "sed slime.el failed"
+ sed -i "s/@itemx INIT-FUNCTION/@item INIT-FUNCTION/" doc/slime.texi \
+ || die "sed doc/slime.texi failed"
+
+ # Remove xref.lisp (which is non-free) unless USE flag is set
+ use xref || rm -f xref.lisp
+}
+
+src_compile() {
+ elisp-compile *.el || die
+ BYTECOMPFLAGS="${BYTECOMPFLAGS} -L contrib -l slime" \
+ elisp-compile contrib/*.el lib/*.el || die
+ emake -j1 -C doc slime.info || die "Cannot build info docs"
+
+ if use doc; then
+ VARTEXFONTS="${T}"/fonts \
+ emake -j1 -C doc slime.pdf || die "emake doc failed"
+ fi
+}
+
+src_install() {
+ ## install core
+ elisp-install ${PN} *.{el,elc} "${FILESDIR}"/swank-loader.lisp \
+ || die "Cannot install SLIME core"
+ sed "s:/usr/:${EPREFIX}&:g" "${FILESDIR}"/2.0_p20110617/${SITEFILE} \
+ >"${T}"/${SITEFILE} || die "sed failed"
+ elisp-site-file-install "${T}"/${SITEFILE} || die
+ cp "${FILESDIR}"/2.0_p20110617/swank.asd "${S}"
+ # remove upstream swank-loader, since it won't be used
+ rm "${S}"/swank-loader.lisp
+ common-lisp-install-sources *.lisp
+ common-lisp-install-asdf swank.asd
+
+ ## install contribs
+ elisp-install ${PN}/contrib/ contrib/*.{el,elc,scm,goo} \
+ || die "Cannot install contribs"
+ common-lisp-install-sources contrib/*.lisp
+
+ ## install lib
+ elisp-install ${PN}/lib/ lib/*.{el,elc} \
+ || die "Cannot install libs"
+
+ ## install docs
+ dodoc README.md ChangeLog CONTRIBUTING.md NEWS PROBLEMS
+ newdoc contrib/README.md README-contrib.md
+ newdoc contrib/ChangeLog ChangeLog.contrib
+ doinfo doc/slime.info
+ use doc && dodoc doc/*.pdf
+}