# -*- 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.1
PortGroup           github 1.0

github.setup        KhronosGroup SPIRV-LLVM-Translator 7.0.0-1 v
name                [string tolower ${github.project}]
revision            0
categories          devel
license             NCSA
maintainers         nomaintainer

description         Bi-directional translation between SPIR-V and LLVM IR
long_description    {*}${description}

checksums           rmd160  bef6ed9ae391d6a2eb9c6dedcd3b5ec54cbd388e \
                    sha256  8af31f97b609168840024731508fcf647486ae4881e8285d3da3c29588de3e4a \
                    size    300813
github.tarball_from archive

set llvm_branch     7
set llvm_version    ${llvm_branch}.0
set llvm_port       ${llvm_version}

platform darwin powerpc {
    set llvm_version    ${llvm_branch}.1.1
    set llvm_port       powerpc
}

post-patch {
    reinplace "s|LLVM 7.0.0|LLVM 7.1.0|" ${worksrcpath}/CMakeLists.txt
}

depends_lib-append  path:/opt/local/libexec/llvm-${llvm_version}/lib/libLLVM.dylib:llvm-${llvm_port}

compiler.cxx_standard   2011

configure.args-append   -DBUILD_SHARED_LIBS=ON \
                        -DLLVM_DIR=${prefix}/libexec/llvm-${llvm_version}/lib/cmake/llvm \
                        -DLLVM_INCLUDE_TESTS=OFF
