# -*- 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-beta8 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
supported_archs     x86_64 arm64
license             BSD
installs_libs       no

homepage            https://premake.github.io/

github.tarball_from archive

checksums           sha256  2a55195fd2b27e5aa3de8ff6d22cdb127232a86f801d06e7f673d30a0eba09ac \
                    rmd160  6ef5d6cf8dea46744770b38931e1409d6b2d3853 \
                    size    8546295

use_configure       no

# 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


if {${configure.build_arch} eq "x86_64"} {
    set shortarch x64
} elseif {${configure.build_arch} eq "arm64"} {
    set shortarch ARM64
} else {
    set shortarch unsupported
}

build.target       osx
build.pre_args-prepend  -f Bootstrap.mak
build.post_args    PLATFORM=${shortarch} config=release verbose=true

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