# -*- 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.16.1.0 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  91bd8145416a9a0f4b86576672c0265d04b33369 \
                    sha256  21d3bbdddbd90a100976ca8f5f2082a3a92ed60b45abf90710916c48045754a6 \
                    size    1044897

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}
