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

name                  antlr
version               2.7.7
revision              4
categories            lang java
license               public-domain
platforms             darwin
maintainers           {@Dave-Allured noaa.gov:dave.allured} \
                      openmaintainer

description           antlr is ANother Tool for Language Recognition
long_description      ANTLR, ANother Tool for Language Recognition, is a \
                      language tool that provides a framework for \
                      constructing recognizers, compilers, and translators \
                      from grammatical descriptions containing Java, C#, or \
                      C++ actions.

homepage              http://www.antlr2.org/
master_sites          ${homepage}download/ \
                      https://www.mirrorservice.org/sites/distfiles.finkmirrors.net/

checksums             rmd160  0b7951a28b748e912721fe0f6de4095d9f8da57d \
                      sha256  853aeb021aef7586bda29e74a6b03006bcb565a755c86b66032d8ec31b67dbb9 \
                      size    1816180

patchfiles            patch-configure.diff antlr-DESTDIR.patch \
                      patch-lib-cpp-antlr-CharScanner.hpp.diff

variant               universal {}

# Required java version.
java.version          1.4+

# LTS JDK port to install if required java not found
java.fallback         openjdk8

# JDK only needed at build time, but java PG sets lib dependency.
# So declare no conflict to allow redistribution of binaries.
license_noconflict    ${java.fallback}

configure.env         CLASSPATH=.
configure.args        --disable-csharp

build.args            CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]" \
                      LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]"

livecheck.type        regex
livecheck.url         ${homepage}download.html
livecheck.regex       ${name}-(\\d+(?:\\.\\d+)*)
