# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 68302 2010-05-31 15:32:35Z snc@macports.org $

PortSystem	        1.0

name			    LyX
version			    1.6.6.1
set branch          [join [lrange [split ${version} .] 0 1] .]
categories	        aqua
license             GPL
maintainers	        snc openmaintainer
description	        WYSIWYM document processor
homepage		    http://www.lyx.org/
long_description	LyX is an advanced open source document processor \
				    that encourages an approach to writing based on \
				    the structure of your documents, not their \
				    appearance. LyX lets you concentrate on writing, \
				    leaving details of visual layout to the software.


platforms		    darwin
depends_build	    port:pkgconfig
depends_lib		    path:bin/qmake-mac:qt4-mac \
				    bin:tex:texlive \
				    port:ImageMagick \
				    port:python25

use_bzip2		    yes
distname		    lyx-${version}
master_sites	    http://lyx.cybermirror.org/stable/${branch}.x/ \
				    http://sunsite.icm.edu.pl/pub/unix/editors/lyx/stable/${branch}.x/ \
				    ftp://ftp.ntua.gr/pub/X11/LyX/stable/${branch}.x/ \
				    ftp://ftp.lyx.org/pub/lyx/stable/${branch}.x/ \
				    http://gd.tuwien.ac.at/publishing/tex/lyx/stable/${branch}.x/

checksums           md5     a17e4c37f7def9f18052e03634d42ca5 \
                    sha1    4f0d20a890b6c78da7d863377632c5bb2b02fb4c \
                    rmd160  b6ab705815ae6d7950cee32a947bf636d102d91b

configure.python    ${prefix}/bin/python2.5
configure.pre_args  --prefix=${applications_dir}/LyX.app
configure.args      --with-frontend=qt4 --without-x --with-included-gettext \
                    --enable-optimization=-Os --disable-concept-checks \
                    --with-qt4-dir=${prefix}/libexec/qt4-mac \
                    --with-version-suffix=-1.6

build.env           LD_FLAGS="-framework Carbon -framework OpenGL -framework AGL -framework QuickTime -framework Cocoa" \
                    LD_LIBRARY_PATH=${prefix}/libexec/qt4-mac/lib \
                    CPLUS_INCLUDE_PATH=${prefix}/libexec/qt4-mac/include

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     "${name} (\\d+\\.\\d+\\.\\d+(\\.\\d+)?) released"
