# -*- 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
PortGroup           legacysupport 1.1

# LegacySupport only used for providing wrappers here.
legacysupport.newest_darwin_requires_legacy 0

github.setup        qalculate qalculate-gtk 5.4.0 v
github.tarball_from releases
revision            0

categories          math
license             GPL-2+
maintainers         {gmail.com:jjstickel @jjstickel} \
                    {judaew @judaew} \
                    openmaintainer

description         Qalculate! is a multi-purpose desktop calculator
long_description    Qalculate! is a multi-purpose desktop calculator. \
                    It is small and simple to use but with much \
                    power and versatility underneath. Features include \
                    customizable functions, units, arbitrary precision, \
                    plotting, and a user-friendly interface.

checksums           rmd160  7a5125776126769a78edb45624f74651eb9c14ea \
                    sha256  9a112b3bcb348834dff631fa5d8a55f36b0e4caf5d992c21e4b1a72879611331 \
                    size    3003465

# autoreconf to reconfigure for intltool
use_autoreconf      yes
autoreconf.args     -fvi

# callbacks.cc: error: invalid suffix "b0001" on integer constant
# /usr/include/c++/4.2.1/ext/hashtable.h: error: no match for call to ‘(const __gnu_cxx::hash<Unit*>) (Unit* const&)’
# error: no match for call to ‘(const __gnu_cxx::hash<long long unsigned int>) (const long long unsigned int&)’
compiler.cxx_standard   2011

# qalculate-gtk(58160,0x2180408) malloc: *** error for object 0x1e85700: Non-aligned pointer being freed (2)
legacysupport.redirect_bins qalculate-gtk

depends_build-append \
                    port:gettext \
                    port:intltool \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:gettext-runtime \
                    port:libqalculate \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3

notes-append "Graphical plotting is enabled by installing gnuplot.\n"