# $Id: Portfile,v 1.22 2006/06/03 14:29:04 gwright Exp $

PortSystem 1.0
name		TeXmacs
version		1.0.6.2
distname	${distname}-src
categories	editors
maintainers	gwright@opendarwin.org
platforms	darwin

description	GNU TeXmacs: A Scientific Text Editor
long_description	\
		GNU TeXmacs is a free scientific text editor,		\
		which was both inspired by TeX and GNU Emacs.		\
		The editor allows you to write structured documents	\
		via a wysiwyg (what-you-see-is-what-you-get) and	\
		user friendly interface. New styles may be created by	\
		the user. The program implements high-quality		\
		typesetting algorithms and TeX fonts, which help you	\
		to produce professionally looking documents.		\
									\
		The high typesetting quality still goes through for	\
		automatically generated formulas, which makes TeXmacs	\
		suitable as an interface for computer algebra systems.	\
		TeXmacs also supports the Guile/Scheme extension	\
		language, so that you may customize the interface and	\
		write your own extensions to the editor. 

#user_notes	If texmacs can't find guile's modules, you will have to \
#		set GUILE_LOAD_PATH explicitly (usually			\
#		/opt/local/share/guile/1.6).				\
#									\
#		Also, don't forget to set DISPLAY to localhost:0.0 if	\
#		launching TeXmacs from a non-X11 terminal.

#bugs		Some of the computer algebra system sessions (e.g.,	\
#		maxima) will hang if you try to use the online help	\
#		function. A known issue that is being worked on.

homepage	http://www.texmacs.org/
master_sites	ftp://ftp.texmacs.org/pub/TeXmacs/targz/

distfiles	${name}-${version}-src${extract.suffix} \
		${name}-600dpi-fonts${extract.suffix}

checksums	${name}-${version}-src.tar.gz md5 9f38c2a547b9508b7b263eaf12b2ed97 \
		${name}-600dpi-fonts.tar.gz   md5 945dfd3f76b20082aeea8131d87a260f

depends_build	port:guile		\
		port:teTeX
depends_lib	lib:libX11.6:XFree86	\
		port:libiconv
depends_run	bin:gs:gplghostscript

extract.only	${name}-${version}-src${extract.suffix}

platform darwin 6 {
		    depends_lib-append	lib:libdl:dlcompat
		}

configure.env	LDFLAGS="-L${prefix}/lib"	\
		CFLAGS="-no-cpp-precomp"

# TeXmacs is ignorant of "make all", so we just "make" with no target:
build.target	{ }

post-destroot	{ file mkdir ${destroot}/${prefix}/share/${name}
                  cd         ${destroot}/${prefix}/share/${name}

                  system "${extract.cmd} ${extract.pre_args} ${distpath}/${name}-600dpi-fonts${extract.suffix} ${extract.post_args}"

                  cd         ${destroot}/${prefix}/share/
                  system "chown -R root:admin ${name}"
                }

