# -*- 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

PortSystem      1.0
PortGroup       github 1.0
PortGroup       openssl 1.0

github.setup    ldmud ldmud 3.6.8
revision        0
categories      games
maintainers     {toby @tobypeterson}
description     Modern LPMud gamedriver
long_description \
    LDMud started as a project to clean up and modernize Amylaar's LPMud \
    gamedriver. Primary goals are full documentation, a commented source body \
    and out-of-the-box support for the major mudlibs, of which the commented \
    source body has been pretty much completed. During the course of work \
    a lot of bug fixes and improvements found their way into the driver – \
    much more than originally expected, and definitely enough to make LDMud \
    a driver in its own right.
homepage        http://www.ldmud.eu
checksums       rmd160  460df1a30fc1b09788d5557aed63bc2e0d2ca92f \
                sha256  daff6edea44165f4c203b6373c12e60fd1ff5c8d888d67b3b01776f45c65c654 \
                size    3433466
github.tarball_from archive

patchfiles      patch-src__Makefile.in

use_autoreconf  yes
autoreconf.dir  ${worksrcpath}/src
autoreconf.cmd  ./autogen.sh

depends_build-append \
                port:autoconf \
                port:automake \
                port:bison \
                port:libtool
depends_lib-append \
                port:libiconv \
                port:pcre

# iconv_opt.h:104: error: ‘for’ loop initial declaration used outside C99 mode
# applied_decl.c:109: error: field name not in record or union initializer
compiler.blacklist-append \
                *gcc-4.0 *gcc-4.2

configure.dir   ${worksrcpath}/src
configure.args-append \
                --enable-use-tls=ssl \
                --libdir=${prefix}/var/ldmud \
                --with-optimize=no

use_parallel_build  no
build.dir       ${worksrcpath}/src
build.env-append \
                CFLAGS=${configure.cflags}

pre-destroot {
    xinstall -d ${destroot}${prefix}/var/${name}
}

# FIXME: looks like something is still incorrect in a way it is installed.
# See: https://trac.macports.org/ticket/72686
destroot.target     install-driver
destroot.keepdirs   ${destroot}${prefix}/var/${name}
