# $Id: Portfile 56063 2009-08-24 00:39:48Z ryandesign@macports.org $

PortSystem 1.0
name		emacs-app
version		23.1
categories	aqua editors
maintainers	css
description	The GNU Emacs text editor (Cocoa version)

long_description	GNU Emacs is a self-documenting, customizable,      \
	extensible real-time display editor. This is a port of the latest   \
	GNU Emacs source to the OpenStep (or NeXTstep) APIs, as implemented \
	by Cocoa on OS X. It differs from Carbon ports of GNU Emacs in that \
	it makes a more concerted attempt from the ground up to follow OS X \
	desktop and UI conventions.

# Note that this distribution can support GNUstep as well, but that
# configuration is untested at this time.

platforms	darwin
homepage	http://emacs-app.sourceforge.net/
master_sites	ftp://ftp.gnu.org/gnu/emacs/
distname	emacs-${version}
use_bzip2	yes
checksums	md5 17f7f0ba68a0432d58fa69d05a2225be \
		sha1 5f2d5dfcc17e7627ea752f675c605fe37c9c145c

depends_lib     port:ncurses
use_parallel_build      yes

configure.args	--with-ns --without-x

destroot {
        system "cd ${worksrcpath} && make install"
	xinstall -m 755 -d ${destroot}${applications_dir}
	file copy ${worksrcpath}/nextstep/Emacs.app \
		${destroot}${applications_dir}
	file copy ${filespath}/site-start.el \
		${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp
}

post-destroot {
	reinplace "s|__PREFIX__|${prefix}|g" \
		${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp/site-start.el
}
