# -*- 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                   cmake 1.0
PortGroup                   github 1.0
PortGroup                   openssl 1.0

github.setup                H-uru libhsplasma 7b8df5940eeecfcd91ab3922a65303a0cadf3e24
version                     0.0-20111023
revision                    5
checksums                   rmd160  84c6ada8f03a0fb30e161fcdbe544f1489f7be46 \
                            sha256  fe8fea3ec92c386e3b3da95a74a16d7f392070da0abcd51b9c432e55b627f1d1 \
                            size    1329982

categories                  devel
platforms                   darwin
maintainers                 {ryandesign @ryandesign}
license                     GPL-3+

description                 library for reading Plasma game engine files

long_description            libHSPlasma is a library for reading files used \
                            by the Plasma game engine (created by Headspin, \
                            acquired by Cyan Worlds), such as those in the \
                            games Myst V: End of Ages and Myst Online: URU Live

github.tarball_from         archive

depends_lib                 port:zlib \
                            path:include/turbojpeg.h:libjpeg-turbo \
                            port:python26

openssl.branch              1.0

patchfiles                  patch-endian.diff

configure.args-append       -DDISABLE_PYTHON:BOOL=OFF \
                            -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.6 \
                            -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.6.dylib

set pyhsplasma              ${frameworks_dir}/Python.framework/Versions/2.6/lib/python2.6/PyHSPlasma.so

post-destroot {
    system "install_name_tool -id ${pyhsplasma} ${destroot}${pyhsplasma}"
}

if {[variant_isset debug]} {
    configure.optflags -O1
    configure.cflags-append -ggdb
    configure.cxxflags-append -ggdb
}

variant commdebug description {Debug network communications (high-level)} {
    configure.cflags-append     -DCOMMDEBUG
    configure.cxxflags-append   -DCOMMDEBUG
}

variant commdebug2 description {Debug network communications (low-level)} {
    configure.cflags-append     -DCOMMDEBUG2
    configure.cxxflags-append   -DCOMMDEBUG2
}

livecheck.version           [regsub {(....)(..)(..)} [lindex [split ${version} -] 1] {\1-\2-\3}]
livecheck.regex             {<updated>([0-9-]+)T}
