Opened 15 years ago

Last modified 10 years ago

#19971 new enhancement

haskell-mode.el Development version from cvs + support for emacs-app-devel

Reported by: marcin.zalewski@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: haskell-mode.el

Description

I wanted the haskell-mode version from CVS, and I wanted to have a variant for emacs-app-devel. Here is the resulting portfile:

PortSystem 1.0
name		haskell-mode.el
version		latest
categories	lang editors
maintainers	nomaintainer
platforms	darwin

description	An emacs major mode for editing haskell programs.
long_description	\
		Haskell-mode is a major Emacs mode for editing		\
		Haskell source code. It provides syntax highlighting	\
		and automatic indentation and comes with inf-haskell	\
		which allows interaction with an inferior Haskell	\
		interactive loop such as the one of Hugs  or GHCi.

distname	haskell-mode

homepage	//http://www-perso.iro.umontreal.ca/~monnier/elisp/
master_sites	${homepage}

fetch.type	cvs
cvs.root	:pserver:anoncvs@cvs.haskell.org:/cvs
cvs.password	cvs
cvs.module	fptools/CONTRIB/haskell-modes/emacs
worksrcdir	fptools/CONTRIB/haskell-modes/emacs

# checksums	md5 de5ff32478154a39bea3adb3b7ce0e94

depends_lib	port:emacs
depends_run	port:ghc

post-patch	{ reinplace s|ghci-program-path|${prefix}/bin/ghci|g ${worksrcpath}/inf-haskell.el }

variant emacs_devel	{ depends_lib-delete port:emacs
		  depends_lib-append port:emacs-devel
		}

variant emacs_app_devel {
        depends_lib-append      port:emacs-app-devel
        depends_lib-delete      port:emacs
}

use_configure	no
build		{}
destroot	{ 
		if {[variant_isset emacs_app_devel]} {
		  file mkdir ${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp
		  file copy  ${workpath}/${worksrcdir}	\
		             ${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp/$distname
		} else {
		  file mkdir ${destroot}${prefix}/share/emacs/site-lisp
		  file copy  ${workpath}/${worksrcdir}	\
		             ${destroot}${prefix}/share/emacs/site-lisp/$distname
		}
		}

post-activate	{ 
		if {[variant_isset emacs_app_devel]} {
		  ui_msg "To use this, put the following into your ~/.emacs:"
	          ui_msg "(load \"${applications_dir}/Emacs.app/Contents/Resources/site-lisp/${distname}/haskell-site-file\")"
		  ui_msg "(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)"
		  ui_msg "(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)"
		  ui_msg "(add-hook 'haskell-mode-hook 'font-lock-mode)"
		  ui_msg "(add-hook 'haskell-mode-hook 'imenu-add-menubar-index)"
		  ui_msg " "
		} else {
		  ui_msg "To use this, put the following into your ~/.emacs:"
	          ui_msg "(load \"${prefix}/share/emacs/site-lisp/${distname}/haskell-site-file\")"
		  ui_msg "(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)"
		  ui_msg "(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)"
		  ui_msg "(add-hook 'haskell-mode-hook 'font-lock-mode)"
		  ui_msg "(add-hook 'haskell-mode-hook 'imenu-add-menubar-index)"
		  ui_msg " "
		}		

}

I am not a portfile wizard, so maybe it can be done better. Also, it should be no problem at all to add a variant for emacs-app.

Change History (2)

comment:1 Changed 15 years ago by gwright@…

Owner: changed from macports-tickets@… to gwright@…

I'll give it a try and check it in if it works for me.

comment:2 Changed 10 years ago by mf2k (Frank Schima)

Keywords: emacs haskell mode removed
Owner: changed from gwright@… to macports-tickets@…
Version: 1.7.1

gwright has retired. See #43784.

Note: See TracTickets for help on using tickets.