# -*- 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.11.0 v
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    {*}${description}. 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  d6c1ce642d399be54d299ed2a0194f8f0833afb7 \
                    sha256  529854fc5a3bd62a1a0e814879c576668b238604c5b2cb2c422979aeac355927 \
                    size    3797916
github.tarball_from releases

# Unbreak the build:
# https://github.com/Qalculate/qalculate-gtk/issues/715
patchfiles-append   fix-gtk-x11.patch

# 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 \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    port:libqalculate

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