# -*- 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 # Global Keywords PortSystem 1.0 PortGroup github 1.0 github.setup bazelbuild bazel 0.4.5 github.tarball_from releases categories devel maintainers tfmnet.com:mohamed.issa \ openmaintainer description A tool for automating builds and tests. long_description ${description} platforms darwin license Apache-2 # Pre-Fetch Phase pre-fetch { # Make sure the Java compiler exists set cmdnm "javac" set param [auto_execok $cmdnm] if {$param == ""} { error "The Java compiler was not detected on this machine. \ Please ensure JDK 8 or newer is properly installed." } # Get the Java compiler version and then extract the major + minor parts set ver [exec -ignorestderr -- $cmdnm -version 2>@1] set count [scan $ver "%s %d.%d." cmdnm mjver mnver] if {$count != 3} { error "The Java compiler version data could not be parsed." } # Check for major version incompatbility if {$mjver < 1} { error "The installed JDK is too old, please upgrade to JDK 8 or newer." } # Check for minor version incompatbility if {$mjver == 1} { if {$mnver < 8} { error "The installed JDK is too old, please upgrade to JDK 8 or newer." } } } # Fetch Phase distname ${distname}-dist dist_subdir ${name} # Checksum Phase checksums rmd160 1ab01266e8d1448936bf1f4e2fefcb847c1f44a2 \ sha256 2b737be42678900470ae9e48c975ac5b2296d9ae23c007bf118350dbe7c0552b # Extract Phase use_zip yes extract.mkdir yes # Patch Phase patch {} # Configure Phase use_configure no # Build Phase build { # The Bazel compilation script erroneously writes to the standard # error stream, so we'll just ignore it. If the build fails, then there # won't be a binary to copy and the destroot phase will fail. exec -ignorestderr -- bash ${worksrcpath}/compile.sh } # Test Phase test {} # Destroot Phase destroot { # Copy compiled binary set bindir ${prefix}/bin xinstall -d ${destroot}${bindir} xinstall -m 755 -W ${worksrcpath}/output ${name} ${destroot}${bindir} } # Post-Destroot Phase post-destroot { # Mark documentation, source, and example directories set docdir ${prefix}/share/doc/${name} set srcdir ${prefix}/src/${name} set expdir ${prefix}/share/examples/${name} # Copy documentation files xinstall -d ${destroot}${docdir} xinstall -m 644 -W ${worksrcpath} AUTHORS \ CHANGELOG.md \ CONTRIBUTING.md \ CONTRIBUTORS \ ISSUE_TEMPLATE.md \ LICENSE \ LICENSE.txt \ README.md \ ${destroot}${docdir} # Copy source files xinstall -d ${destroot}${srcdir} file copy -force {*}[glob ${worksrcpath}/src/*] ${destroot}${srcdir} # Copy example files xinstall -d ${destroot}${expdir} file copy -force {*}[glob ${worksrcpath}/examples/*] ${destroot}${expdir} }