# -*- 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
github.setup        lcn2 calc 2.15.1.1 v
revision            0
categories          math
platforms           darwin
maintainers         {pmetzger @pmetzger} openmaintainer
license             LGPL-2.1

description         Arbitrary precision calculator

long_description    Calc is an interactive calculator which provides for easy \
                    large numeric calculations, but which also can be easily \
                    programmed for difficult or long calculations. It can \
                    accept a command line argument, in which case it executes \
                    that single command and exits. Otherwise, it enters \
                    interactive mode. There are a great number of pre-defined \
                    functions. The calculator can calculate transcendental \
                    functions, and accept and display numbers in real or \
                    exponential format. The calculator also knows about \
                    complex numbers.

homepage            http://www.isthe.com/chongo/tech/comp/calc/

github.tarball_from releases
use_bzip2           yes

checksums           rmd160  351af3f8decea0649d0956e67e25f9ec58faec75 \
                    sha256  a2d6cf86cd825cd1ecf7ca1ce3a37cf7c7807250ae28d54bc7668e27bde6209c \
                    size    1032739

depends_lib         port:ncurses port:readline

patchfiles          patch-Makefile.local.diff

post-patch {
    reinplace "s|___PREFIX___|${prefix}|" ${worksrcpath}/Makefile.local
}

use_configure       no
use_parallel_build  no

variant universal {}

build.args-append   CC=${configure.cc} \
                    DARWIN_ARCH="[get_canonical_archflags]"

test.run            yes
test.target         check

destroot.destdir    T=${destroot}
