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

github.setup        premake premake-core 5.0.0-beta3 v
name                premake5
revision            0

categories          devel
maintainers         {amake @amake} openmaintainer
description         Premake is a build script generator.
long_description    Premake is a build script generator. Describe your \
                    project using the full-featured Lua scripting language \
                    and use premake to create input files for various IDEs \
                    and GnuMake

platforms           darwin
license             BSD
installs_libs       no

homepage            https://premake.github.io/

github.tarball_from releases
use_zip             yes
distname            premake-${version}-src
checksums           sha256  4b2b1fe9772ca1caf689c07e8c32f108b8393922956f602ddaf404f73467bd83 \
                    rmd160  dfac30b5ded0c938108105cbb652b736da63523f \
                    size    9317028
use_configure       no

patchfiles-append   0001-Include-required-header.patch

patch.pre_args-replace  -p0 -p1

# Premake statically links a handful of vendored libraries; don't let MacPorts
# installed libraries conflict with these
compiler.library_path
compiler.cpath
configure.cppflags-delete -I${prefix}/include
configure.ldflags-delete  -L${prefix}/lib

build.dir           ${worksrcpath}/build/gmake2.macosx
build.args-append   config=release verbose=true

destroot	{
    xinstall -m 0755 ${worksrcpath}/bin/release/premake5 ${destroot}${prefix}/bin/
}
