SUMMARY="XEmacs editor"
DESCRIPTION="
highly customizable open source text editor and application development system
"
HOMEPAGE="http://xemacs.org/"
SRC_URI="hg+https://bitbucket.org/mmu_man/xemacs#24b993054953"
REVISION="1"
LICENSE="GNU GPL v3"
COPYRIGHT="1998-2000 Hrvoje Niksic
	2000-2001 Michael Sperber
	2001 Ben Wing
	2001 Didier Verna
	2004 Stephen Turnbull
	2005-2006 Aidan Kehoe"
# TODO: FIXME:
#Bootstrapping from temacs...
#Warning: 
#        XEmacs was unable to determine a good value for the user's $HOME
#        directory, and will be using the value:
#                /
#        This is probably incorrect.


ARCHITECTURES="x86_gcc2 x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

#POLICY WARNING: no matching provides "cmd:b2m" for "bin/b2m"
#POLICY WARNING: no matching provides "cmd:ctags" for "bin/ctags"
#POLICY WARNING: no matching provides "cmd:ellcc" for "bin/ellcc"
#POLICY WARNING: no matching provides "cmd:etags" for "bin/etags"
#POLICY WARNING: no matching provides "cmd:gnuattach" for "bin/gnuattach"
#POLICY WARNING: no matching provides "cmd:gnuclient" for "bin/gnuclient"
#POLICY WARNING: no matching provides "cmd:gnudoit" for "bin/gnudoit"
#POLICY WARNING: no matching provides "cmd:ootags" for "bin/ootags"
#POLICY WARNING: no matching provides "cmd:xemacs_21.5_b34" for "bin/xemacs-21.5-b34"
#POLICY WARNING: no matching provides "cmd:xemacs_script" for "bin/xemacs-script
PROVIDES="
	xemacs$secondaryArchSuffix = $portVersion
	app:xemacs = $portVersion
	cmd:xemacs = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	lib:libncurses$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	lib:libpng$secondaryArchSuffix
	lib:libjpeg$secondaryArchSuffix
#	lib:libtiff$secondaryArchSuffix
#	lib:libxpm$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	devel:libiconv$secondaryArchSuffix
	devel:libncurses$secondaryArchSuffix
	devel:libz$secondaryArchSuffix >= 1.2.8
	devel:libpng$secondaryArchSuffix
	devel:libjpeg$secondaryArchSuffix
#	devel:libtiff$secondaryArchSuffix
#	devel:libxpm$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:autoconf
	cmd:make
	cmd:gcc$secondaryArchSuffix
	cmd:tar
	cmd:which
	cmd:makeinfo
	"

# TODO: fix lispdir to not use $HOME
BUILD()
{
	autoconf
	export HOME=/boot/home
	runConfigure ./configure \
		--with-tty=yes --with-pop --with-x11=no --with-ipv6-cname=no \
		--with-mule --with-wnn=no \
		-with-beos=yes \
		--with-toolbars=yes \
		--with-scrollbars=no \
		--with-menubars=no \
		--with-dialogs=no \
		--with-widgets=no \
		--with-dragndrop=yes \
		--with-system-malloc --disable-mc-alloc --with-mc-alloc=no \
		--with-postgresql=no \
		--disable-kkcc \
		--with-png
	make clean
	make
}

INSTALL()
{
	make install
	addattr SYS:ENV DISABLE_ASLR=1 $binDir/xemacs-21*
	addAppDeskbarSymlink $binDir/xemacs XEmacs
}
