Ticket #14136: Portfile.2

File Portfile.2, 6.0 KB (added by jrhope, 16 years ago)

fixes to existing attachment

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    depends_lib-append port:emacs-app
41    depends_lib-delete port:emacs
42}
43
44default_variants +sbcl
45
46variant sbcl description "Require lang/sbcl for SLIME" {
47    depends_run-append port:sbcl
48}
49
50variant openmcl description "Require lang/openmcl for SLIME" { 
51    depends_run-append port:openmcl
52}
53
54variant clisp description "Require lang/clisp for SLIME" { 
55    depends_run-append port:clisp
56}
57
58post-patch { 
59    reinplace "s|/usr/local|${prefix}/share|g" \
60        ${worksrcpath}/doc/makefile
61}
62
63configure { 
64    global slime_emacs_binary
65    global slime_site_lisp_dest
66    global slime_site_lisp_contrib
67    global slime_byte_compile_p
68    global slime_site_lisp_dest_contrib
69    if {[ variant_isset app ]} {
70        set slime_emacs_binary /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs
71    } else {
72        # kludge if 'emacs+carbon' is installed
73        if {[regexp carbon [join [registry_installed emacs]]]} {
74            set slime_emacs_binary /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs
75        } else {
76            set slime_emacs_binary ${prefix}/bin/emacs
77        }
78    }
79    set slime_site_lisp_dest ${destroot}${prefix}/share/emacs/site-lisp/slime
80    set slime_site_lisp_contrib ${prefix}/share/emacs/site-lisp/contrib
81
82    set slime_site_lisp_dest_contrib ${slime_site_lisp_dest}/contrib
83   
84
85   if {! [file executable ${slime_emacs_binary}]} {
86       set slime_byte_compile_p 0
87       ui_msg "Couldn't find an executable Emacs image so won't byte compile."
88   } else {
89       set slime_byte_compile_p 1
90       ui_msg "Emacs binary used for byte compilation is ${slime_emacs_binary}"
91   }
92}
93           
94build { 
95    cd ${worksrcpath}
96    upvar #0 slime_emacs_binary emacs_bin
97    if {${slime_byte_compile_p}} {
98        system "${emacs_bin} \
99              --batch  --directory .  --funcall batch-byte-compile \
100              slime.el \
101              slime-autoloads.el \
102              hyperspec.el"         
103
104        cd ${worksrcpath}/contrib
105        system "${emacs_bin} \
106              --batch \
107              --directory .  --directory .. \
108              --funcall batch-byte-compile  \
109              bridge.el \
110              inferior-slime.el \
111              slime-asdf.el \
112              slime-parse.el \
113              slime-autodoc.el \
114              slime-banner.el \
115              slime-c-p-c.el \
116              slime-editing-commands.el \
117              slime-fancy-inspector.el \
118              slime-fancy.el \
119              slime-fuzzy.el \
120              slime-highlight-edits.el \
121              slime-indentation.el \
122              slime-motd.el \
123              slime-parse.el \
124              slime-presentation-streams.el \
125              slime-presentations.el \
126              slime-references.el \
127              slime-scheme.el \
128              slime-scratch.el \
129              slime-tramp.el \
130              slime-typeout-frame.el \
131              slime-xref-browser.el"
132    }
133
134    cd ${worksrcpath}/doc
135    system "make slime.info"
136}
137
138destroot    { 
139    cd ${worksrcpath}
140    xinstall -m 755 -d ${slime_site_lisp_dest}
141   
142    foreach file [glob *.el *.elc *.lisp ChangeLog] {
143        xinstall -m 644 ${file} ${slime_site_lisp_dest}
144    }
145
146    cd ${worksrcpath}/contrib
147    xinstall -m 755 -d ${slime_site_lisp_dest_contrib}
148    foreach file [glob *.el *.elc *.lisp ChangeLog] {
149        xinstall -m 644 ${file} ${slime_site_lisp_dest_contrib}
150    }
151         
152    xinstall -m 644 ${worksrcpath}/doc/slime.info ${destroot}${prefix}/share/info 
153}
154
155post-activate   { 
156    ui_msg "To use SLIME, you need to have a Common Lisp installed with which"
157    ui_msg "you wish to interact.  At the moment, 'openmcl', 'sbcl', and"
158    ui_msg "'clisp' all work. By default, MacPorts SLIME installs 'sbcl' as a"
159    ui_msg "dependency."
160    ui_msg ""
161    ui_msg "Then put the following in your ~/.emacs:"
162    ui_msg ""
163    ui_msg "(require 'slime-autoloads)"
164    ui_msg "(setq slime-lisp-implementations"
165    ui_msg "     \`((sbcl (\"/opt/local/bin/sbcl\"))"
166    ui_msg "       (clisp (\"/opt/local/bin/clisp\"))))"
167    ui_msg "(add-hook \'lisp-mode-hook"
168    ui_msg "           (lambda ()"
169    ui_msg "             (cond ((not (featurep \'slime))"
170    ui_msg "                    (require \'slime) "
171        ui_msg  "                    (normal-mode)))))"
172    ui_msg ""
173    ui_msg "(eval-after-load \"slime\""
174    ui_msg "   \'(slime-setup '(slime-fancy slime-banner)))"
175    ui_msg ""
176    ui_msg "Populate the initialization list in SLIME-LISP-IMPLEMENTATIONS" 
177    ui_msg "with the correct paths to the Common Lisp exectuables you wish to use."
178    ui_msg ""
179    ui_msg "Then, 'M-x slime' from Emacs should connect you to the first"
180    ui_msg "CL implementation in the list. 'C-- M-x slime' will present"
181    ui_msg "an interactive chooser for additional implementations in the list."
182    ui_msg ""
183}
184
185