# -*- 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 103590 2013-03-02 07:24:22Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           qt4 1.0

name                tiled
version             0.9.0
categories          devel games aqua
platforms           darwin
maintainers         nomaintainer
# I'm not going to risk indicating the wrong license and making the port
# distributable when it shouldn't be. Someone else please figure it out.
#license             {BSD GPL-2 LGPL-2}

description         general purpose tile map editor

long_description    ${name} is a ${description}, built to be flexible and \
                    easy to use. In addition to its own map format, Tiled \
                    supports read/write plugins for using it with \
                    proprietary map formats or formats used by other editors.

homepage            http://www.mapeditor.org/
master_sites        sourceforge:project/tiled/tiled-qt/${version}
distname            ${name}-qt-${version}

checksums           md5     e2e21a54ff17e34b49b8a330cc8b657e \
                    sha1    389c846bf81adf411cb004329028924432b4b2cd \
                    rmd160  3faf36f22187b82943640bfb833d14c617487c01 \
                    sha256  ffc8831be72eede7a2fca64909560124452370457214d811d6c7030e057a1a33

depends_lib-append  port:zlib

# Doesn't use the right compiler
# Doesn't use -arch flags
# To be resolved by qt4-mac portgroup or a new portgroup (#38250)
universal_variant   no

patchfiles          patch-src-automappingconverter-automappingconverter.pro.diff \
                    patch-src-libtiled-libtiled.pro.diff \
                    patch-src-plugins-plugin.pri.diff \
                    patch-src-tiled-tiled.pro.diff \
                    patch-src-tmxrasterizer-tmxrasterizer.pro.diff \
                    patch-src-tmxviewer-tmxviewer.pro.diff

configure.cmd       ${qt_qmake_cmd}
configure.pre_args  PREFIX=${prefix}
configure.universal_args-delete --disable-dependency-tracking

test.run            yes
test.target         check

post-destroot {
    eval move [glob ${destroot}${prefix}/bin/*.app] ${destroot}${applications_dir}
}

livecheck.regex     /${name}-qt-(\[0-9.\]+)${extract.suffix}
