Ticket #14136: Portfile

File Portfile, 6.1 KB (added by easye, 17 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 24798 2007-05-04 17:37:59Z pipping@macports.org $
3
4PortSystem  1.0
5
6name        slime
7version     20080216
8epoch       20080216
9categories  lang
10platforms   darwin
11maintainers evenson@panix.com
12
13description An Emacs mode for unifying Common Lisp development
14
15long_description    \
16    SLIME extends Emacs with new support for interactive \
17    programming in Common Lisp. The features are \
18    centred around `slime-mode', an Emacs minor-mode \
19    that complements the standard `lisp-mode'. While \
20    `lisp-mode' supports editing Lisp source files, \
21    `slime-mode' adds support for interacting with a \
22    running Common Lisp process for compilation,\
23    debugging, documentation lookup, and so on.
24
25homepage        http://common-lisp.net/project/slime/   
26master_sites    ${homepage}
27fetch.type      cvs
28cvs.root        :pserver:anonymous@common-lisp.net:/project/slime/cvsroot
29cvs.module      slime
30cvs.password    anonymous
31cvs.date        ${version}
32worksrcdir      slime
33
34use_configure   no
35depends_lib     port:emacs
36
37variant app description "Build SLIME against editors/emacs-app" { 
38    depends_run-append port:emacs-app
39    depends_run-delete port:emacs
40}
41
42default_variants +sbcl
43
44variant sbcl description "Require lang/sbcl for SLIME" {
45    depends_run-append port:sbcl
46}
47
48variant openmcl description "Require lang/openmcl for SLIME" { 
49    depends_run-append port:openmcl
50}
51
52variant clisp description "Require lang/clisp for SLIME" { 
53    depends_run-append port:clisp
54}
55
56post-patch { 
57    reinplace "s|/usr/local|${prefix}/share|g" \
58        ${worksrcpath}/doc/makefile
59}
60
61configure { 
62    global slime_emacs_binary
63    global slime_site_lisp_dest
64    global slime_site_lisp_contrib
65    global slime_byte_compile_p
66    global slime_site_lisp_dest_contrib
67    if {[ variant_isset app ]} {
68        set slime_emacs_binary /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs
69        set slime_site_lisp_dest ${destroot}/Applications/MacPorts/Emacs.app/Contents/Resources/site-lisp
70        set slime_site_lisp_contrib /Applications/MacPorts/Emacs.app/Contents/Resources/site-lisp
71    } else {
72        set slime_emacs_binary ${prefix}/bin/emacs
73        set slime_site_lisp_dest ${destroot}${prefix}/share/emacs/site-lisp/slime
74        set slime_site_lisp_contrib ${prefix}/share/emacs/site-lisp/contrib
75    }
76
77    set slime_site_lisp_dest_contrib ${slime_site_lisp_dest}/contrib
78   
79    # kludge if 'emacs+carbon' is installed
80    if {[regexp carbon [join [registry_installed emacs]]]} {
81        set slime_emacs_binary /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs
82    }
83
84   if {! [file executable ${slime_emacs_binary}]} {
85       set slime_byte_compile_p 0
86       ui_msg "Couldn't find an executable Emacs image so won't byte compile."
87   } else {
88       set slime_byte_compile_p 1
89       ui_msg "Emacs binary used for byte compilation is ${slime_emacs_binary}"
90   }
91}
92           
93build { 
94    cd ${worksrcpath}
95    upvar #0 slime_emacs_binary emacs_bin
96    if {${slime_byte_compile_p}} {
97        system "${emacs_bin} \
98              --batch  --directory .  --funcall batch-byte-compile \
99              slime.el \
100              slime-autoloads.el \
101              hyperspec.el"         
102
103        cd ${worksrcpath}/contrib
104        system "${emacs_bin} \
105              --batch \
106              --directory .  --directory .. \
107              --funcall batch-byte-compile  \
108              bridge.el \
109              inferior-slime.el \
110              slime-asdf.el \
111              slime-parse.el \
112              slime-autodoc.el \
113              slime-banner.el \
114              slime-c-p-c.el \
115              slime-editing-commands.el \
116              slime-fancy-inspector.el \
117              slime-fancy.el \
118              slime-fuzzy.el \
119              slime-highlight-edits.el \
120              slime-indentation.el \
121              slime-motd.el \
122              slime-parse.el \
123              slime-presentation-streams.el \
124              slime-presentations.el \
125              slime-references.el \
126              slime-scheme.el \
127              slime-scratch.el \
128              slime-tramp.el \
129              slime-typeout-frame.el \
130              slime-xref-browser.el"
131    }
132
133    cd ${worksrcpath}/doc
134    system "make slime.info"
135}
136
137destroot    { 
138    cd ${worksrcpath}
139    xinstall -m 755 -d ${slime_site_lisp_dest}
140   
141    foreach file [glob *.el *.elc *.lisp ChangeLog] {
142        xinstall -m 644 ${file} ${slime_site_lisp_dest}
143    }
144
145    cd ${worksrcpath}/contrib
146    xinstall -m 755 -d ${slime_site_lisp_dest_contrib}
147    foreach file [glob *.el *.elc *.lisp ChangeLog] {
148        xinstall -m 644 ${file} ${slime_site_lisp_dest_contrib}
149    }
150         
151    xinstall -m 644 ${worksrcpath}/doc/slime.info ${destroot}${prefix}/share/info 
152}
153
154post-activate   { 
155    ui_msg "To use SLIME, you need to have a Common Lisp installed with which"
156    ui_msg "you wish to interact.  At the moment, 'openmcl', 'sbcl', and"
157    ui_msg "'clisp' all work. By default, MacPorts SLIME installs 'sbcl' as a"
158    ui_msg "dependency."
159    ui_msg ""
160    ui_msg "Then put the following in your ~/.emacs:"
161    ui_msg ""
162    ui_msg "(require 'slime-autoloads)"
163    ui_msg "(setq slime-lisp-implementations"
164    ui_msg "     \`((sbcl (\"/opt/local/bin/sbcl\"))"
165    ui_msg "       (clisp (\"/opt/local/bin/clisp\"))))"
166    ui_msg "(add-hook \'lisp-mode-hook"
167    ui_msg "           (lambda ()"
168    ui_msg "             (cond ((not (featurep \'slime))"
169    ui_msg "                    (require \'slime) "
170        ui_msg  "                    (normal-mode)))))"
171    ui_msg ""
172    ui_msg "(eval-after-load \"slime\""
173    ui_msg "   \'(slime-setup '(slime-fancy slime-banner)))"
174    ui_msg ""
175    ui_msg "Populate the initialization list in SLIME-LISP-IMPLEMENTATIONS" 
176    ui_msg "with the correct paths to the Common Lisp exectuables you wish to use."
177    ui_msg ""
178    ui_msg "Then, 'M-x slime' from Emacs should connect you to the first"
179    ui_msg "CL implementation in the list. 'C-- M-x slime' will present"
180    ui_msg "an interactive chooser for additional implementations in the list."
181    ui_msg ""
182}
183
184