[35795] users/easieste/slime/Portfile

easieste at macports.org easieste at macports.org
Sun Apr 6 12:51:41 PDT 2008


Revision: 35795
          http://trac.macosforge.org/projects/macports/changeset/35795
Author:   easieste at macports.org
Date:     2008-04-06 12:51:40 -0700 (Sun, 06 Apr 2008)

Log Message:
-----------
proposed new structure

Modified Paths:
--------------
    users/easieste/slime/Portfile

Modified: users/easieste/slime/Portfile
===================================================================
--- users/easieste/slime/Portfile	2008-04-06 19:46:59 UTC (rev 35794)
+++ users/easieste/slime/Portfile	2008-04-06 19:51:40 UTC (rev 35795)
@@ -1,105 +1,184 @@
+# -*- 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
 # $Id$
 
-PortSystem 1.0
+PortSystem  1.0
 
-name		slime
-version		20070503
-epoch		20070503
-categories	lang
-maintainers	evenson at panix.com
+name        slime
+version     20080404
+epoch       20080404
+categories  lang
+platforms   darwin
+maintainers evenson at panix.com
 
-description	An Emacs mode for unifying Common Lisp development
+description An Emacs mode for unifying Common Lisp development
 
-long_description	\
-		SLIME extends Emacs with new support for interactive \
-		programming in Common Lisp. The features are \
-		centred around `slime-mode', an Emacs minor-mode \
-		that complements the standard `lisp-mode'. While \
-		`lisp-mode' supports editing Lisp source files, \
-		`slime-mode' adds support for interacting with a \
-		running Common Lisp process for compilation,\
-		debugging, documentation lookup, and so on. 
+long_description    \
+    SLIME extends Emacs with new support for interactive \
+    programming in Common Lisp. The features are \
+    centred around `slime-mode', an Emacs minor-mode \
+    that complements the standard `lisp-mode'. While \
+    `lisp-mode' supports editing Lisp source files, \
+    `slime-mode' adds support for interacting with a \
+    running Common Lisp process for compilation,\
+    debugging, documentation lookup, and so on. 
 
-homepage	http://common-lisp.net/project/slime/	
-master_sites	${homepage}
-fetch.type	cvs
-cvs.root	:pserver:anonymous at common-lisp.net:/project/slime/cvsroot
-cvs.module	slime
-cvs.password	anonymous
-cvs.date	${version}
-worksrcdir	slime
+homepage        http://common-lisp.net/project/slime/   
+master_sites    ${homepage}
+fetch.type      cvs
+cvs.root        :pserver:anonymous at common-lisp.net:/project/slime/cvsroot
+cvs.module      slime
+cvs.password    anonymous
+cvs.date        ${version}
+worksrcdir      slime
 
-use_configure	no
-depends_lib	port:emacs
-depends_run	port:sbcl
+use_configure   no
+depends_lib     port:emacs
 
-variant devel	{ depends_lib-append port:emacs-devel
-                  depends_lib-delete port:emacs
-		}
+variant app description "Build SLIME against editors/emacs-app" { 
+    depends_run-append port:emacs-app
+    depends_run-delete port:emacs
+}
 
-variant openmcl	{ depends_run-append port:openmcl
-                  depends_run-delete port:sbcl
-		}
+default_variants +sbcl
 
-variant clisp	{ depends_run-append port:clisp
-                  depends_run-delete port:sbcl
-		}
+variant sbcl description "Require lang/sbcl for SLIME" {
+    depends_run-append port:sbcl
+}
 
-post-patch	{ reinplace "s|/usr/local|${prefix}/share|g" \
-		    ${worksrcpath}/doc/makefile
+variant openmcl description "Require lang/openmcl for SLIME" { 
+    depends_run-append port:openmcl
 }
 
-pre-build	{ global emacs_binary
-		  if {[ variant_isset devel ]} {
-		  	set emacs_binary [ glob ${prefix}/bin/emacs\-* ]
-		  	ui_msg "emacs binary name is ${emacs_binary}"
-		  } else {
-			set emacs_binary	${prefix}/bin/emacs
-		  }
+variant clisp description "Require lang/clisp for SLIME" { 
+    depends_run-append port:clisp
 }
-			
-build		{ cd ${worksrcpath}
-		  upvar #0 emacs_binary emacs_bin
-		  system "${emacs_bin}			\
-   		  	  --batch			\
-			  --directory .			\
-			  --funcall batch-byte-compile	\
-			  slime.el			\
-			  hyperspec.el			\
-			  tree-widget.el"
 
-		  cd ${worksrcpath}/doc
-		  system "make slime.info"
+post-patch { 
+    reinplace "s|/usr/local|${prefix}/share|g" \
+        ${worksrcpath}/doc/makefile
 }
 
-destroot	{ cd ${worksrcpath}
-		  set site_lisp_dest ${destroot}${prefix}/share/emacs/site-lisp/slime
-		  xinstall -m 755 -d ${site_lisp_dest}
+configure { 
+    global slime_emacs_binary
+    global slime_site_lisp_dest
+    global slime_site_lisp_contrib
+    global slime_byte_compile_p
+    global slime_site_lisp_dest_contrib
+    if {[ variant_isset app ]} {
+        set slime_emacs_binary /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs 
+        set slime_site_lisp_dest ${destroot}/Applications/MacPorts/Emacs.app/Contents/Resources/site-lisp
+        set slime_site_lisp_contrib /Applications/MacPorts/Emacs.app/Contents/Resources/site-lisp 
+    } else {
+        set slime_emacs_binary ${prefix}/bin/emacs
+        set slime_site_lisp_dest ${destroot}${prefix}/share/emacs/site-lisp/slime
+        set slime_site_lisp_contrib ${prefix}/share/emacs/site-lisp/contrib
+    }
 
-		  foreach file [glob *.el *.elc *.lisp ChangeLog] {
-			xinstall -m 644 ${file} ${site_lisp_dest}
-		  }
+    set slime_site_lisp_dest_contrib ${slime_site_lisp_dest}/contrib
+    
+    # kludge if 'emacs+carbon' is installed
+    if {[regexp carbon [join [registry_installed emacs]]]} {
+        set slime_emacs_binary /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs
+    }
 
-		  xinstall -m 644 ${worksrcpath}/doc/slime.info ${destroot}${prefix}/share/info  
+   if {! [file executable ${slime_emacs_binary}]} {
+       set slime_byte_compile_p 0
+       ui_msg "Couldn't find an executable Emacs image so won't byte compile."
+   } else {
+       set slime_byte_compile_p 1
+       ui_msg "Emacs binary used for byte compilation is ${slime_emacs_binary}"
+   }
 }
+            
+build { 
+    cd ${worksrcpath}
+    upvar #0 slime_emacs_binary emacs_bin
+    if {${slime_byte_compile_p}} {
+        system "${emacs_bin} \
+              --batch  --directory .  --funcall batch-byte-compile \
+              slime.el \
+              slime-autoloads.el \
+              hyperspec.el"         
 
-post-activate	{ ui_msg "To use SLIME, you need to have a Common Lisp installed with which"
-		  ui_msg "you wish to interact.  At the moment, 'openmcl', 'sbcl', and"
-		  ui_msg "'clisp' all work."
-		  ui_msg ""
-		  ui_msg "MacPorts also has 'gcl' (broken on OS X)."
-		  ui_msg ""
-		  ui_msg "Then put the following in your ~/.emacs:"
-		  ui_msg " (require 'slime)"
-		  ui_msg " (slime-setup)"
-		  ui_msg " (setq inferior-lisp-program \"sbcl\")"
-		  ui_msg ""
-		  ui_msg "Replace 'sbcl' with the name of the Common Lisp exectuable"
-		  ui_msg "if you wish to use a different lisp."
-		  ui_msg ""
-		  ui_msg "Then, 'M-x slime' from Emacs should connect you to your chosen"
-		  ui_msg "Lisp environment."
-		  ui_msg ""
-		  ui_msg "You may have to exit and restart Emacs to get slime completely installed."
+        cd ${worksrcpath}/contrib
+        system "${emacs_bin} \
+              --batch \
+              --directory .  --directory .. \
+              --funcall batch-byte-compile  \
+              bridge.el \
+              inferior-slime.el \
+              slime-asdf.el \
+              slime-parse.el \
+              slime-autodoc.el \
+              slime-banner.el \
+              slime-c-p-c.el \
+              slime-editing-commands.el \
+              slime-fancy-inspector.el \
+              slime-fancy.el \
+              slime-fuzzy.el \
+              slime-highlight-edits.el \
+              slime-indentation.el \
+              slime-motd.el \
+              slime-parse.el \
+              slime-presentation-streams.el \
+              slime-presentations.el \
+              slime-references.el \
+              slime-scheme.el \
+              slime-scratch.el \
+              slime-tramp.el \
+              slime-typeout-frame.el \
+              slime-xref-browser.el"
+    }
+
+    cd ${worksrcpath}/doc
+    system "make slime.info"
 }
 
+destroot    { 
+    cd ${worksrcpath}
+    xinstall -m 755 -d ${slime_site_lisp_dest}
+    
+    foreach file [glob *.el *.elc *.lisp ChangeLog] {
+        xinstall -m 644 ${file} ${slime_site_lisp_dest}
+    }
+
+    cd ${worksrcpath}/contrib
+    xinstall -m 755 -d ${slime_site_lisp_dest_contrib}
+    foreach file [glob *.el *.elc *.lisp ChangeLog] {
+        xinstall -m 644 ${file} ${slime_site_lisp_dest_contrib}
+    }
+          
+    xinstall -m 644 ${worksrcpath}/doc/slime.info ${destroot}${prefix}/share/info  
+}
+
+post-activate   { 
+    ui_msg "To use SLIME, you need to have a Common Lisp installed with which"
+    ui_msg "you wish to interact.  At the moment, 'openmcl', 'sbcl', and"
+    ui_msg "'clisp' all work. By default, MacPorts SLIME installs 'sbcl' as a"
+    ui_msg "dependency."
+    ui_msg ""
+    ui_msg "Then put the following in your ~/.emacs:"
+    ui_msg ""
+    ui_msg "(require 'slime-autoloads)"
+    ui_msg "(setq slime-lisp-implementations"
+    ui_msg "     \`((sbcl (\"/opt/local/bin/sbcl\"))"
+    ui_msg "       (clisp (\"/opt/local/bin/clisp\"))))"
+    ui_msg "(add-hook \'lisp-mode-hook"
+    ui_msg "           (lambda ()"
+    ui_msg "             (cond ((not (featurep \'slime))"
+    ui_msg "                    (require \'slime) "
+	ui_msg	"                    (normal-mode)))))"
+    ui_msg ""
+    ui_msg "(eval-after-load \"slime\""
+    ui_msg "   \'(slime-setup '(slime-fancy slime-banner)))"
+    ui_msg ""
+    ui_msg "Populate the initialization list in SLIME-LISP-IMPLEMENTATIONS" 
+    ui_msg "with the correct paths to the Common Lisp exectuables you wish to use."
+    ui_msg ""
+    ui_msg "Then, 'M-x slime' from Emacs should connect you to the first"
+    ui_msg "CL implementation in the list. 'C-- M-x slime' will present"
+    ui_msg "an interactive chooser for additional implementations in the list."
+    ui_msg ""
+}
+
+

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080406/6704a77b/attachment.html


More information about the macports-changes mailing list