# -*- 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 91831 2012-04-11 15:24:56Z snc@macports.org $

PortSystem          1.0
PortGroup           qt4 1.0

name                LyX
conflicts           LyX1
version             2.0.3
revision            2
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          aqua
license             GPL-2+
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_lib-append  bin:tex:texlive \
                    port:ImageMagick \
                    port:boost

use_xz              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           rmd160  fcb3a09626fb5dc49ae25654b5f98e9989d5ff00 \
                    sha256  4e1c993754acfb14d5e0f2bd2521fb6686d08e0656ec6e5fde0406c285a05ac8

patchfiles          patch-configure.diff \
                    patch-clang.diff

configure.pre_args  --prefix=${applications_dir}/LyX.app
configure.args      --with-frontend=qt4 --without-x --with-included-gettext --without-included-boost \
                    --enable-optimization=-Os --disable-concept-checks \
                    --with-version-suffix=-${branch}

variant python25 conflicts python26 python27 description {Use python25} {
    depends_build-append    port:python25
    configure.python        ${prefix}/bin/python2.5
}

variant python26 conflicts python25 python27 description {Use python26} {
    depends_build-append    port:python26
    configure.python        ${prefix}/bin/python2.6
}

variant python27 conflicts python25 python26 description {Use python27} {
    depends_build-append    port:python27
    configure.python        ${prefix}/bin/python2.7
}

if {![variant_isset python25] && ![variant_isset python26] && ![variant_isset python27]} {
    default_variants +python27
}

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