From 049598efb6d9ddf8aff7ba87d9635b2e166d3fdc Mon Sep 17 00:00:00 2001 From: bcallah Date: Tue, 4 Dec 2018 22:02:27 +0000 Subject: [PATCH] Import math/pcalc, a command line utility for doing hex/dec/oct/bin math quickly. Original submission from Charles Daniels , who takes MAINTAINER -- thanks! Feedback from sthen@ and kn@ ok sthen@ pcalc is a programmer's calculator. It simplifies some operations (especially working with multiple bases) that are hard work without this or another programmer's calculator. Main features: o Full math parser, parentheses, add, sub, mult, div, exponential o Automatic conversion between HEX DEC OCT BIN numbers o Mixing different bases in one expression o Definable variables o Math constants (E PI ...) o Built in math functions (sin/cos/sqrt ...) --- math/pcalc/Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ math/pcalc/distinfo | 2 ++ math/pcalc/pkg/DESCR | 10 ++++++++++ math/pcalc/pkg/PLIST | 2 ++ 4 files changed, 57 insertions(+) create mode 100644 math/pcalc/Makefile create mode 100644 math/pcalc/distinfo create mode 100644 math/pcalc/pkg/DESCR create mode 100644 math/pcalc/pkg/PLIST diff --git a/math/pcalc/Makefile b/math/pcalc/Makefile new file mode 100644 index 00000000000..f86b7b3e4c1 --- /dev/null +++ b/math/pcalc/Makefile @@ -0,0 +1,43 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2018/12/04 22:02:27 bcallah Exp $ + +# XXX: 32-bit issues? +# See: https://github.com/vapier/pcalc/issues/7 +# Uncomment me if 32-bit platforms are not reliable +# ONLY_FOR_ARCHS = ${LP64_ARCHS} + +COMMENT = command line util for doing hex/dec/oct/bin math quickly +CATEGORIES = math sysutils + +GH_ACCOUNT = vapier +GH_PROJECT = pcalc +GH_TAGNAME = v4 + +MAINTAINER = Charles Daniels + +# GPLv2+ +PERMIT_PACKAGE_CDROM = Yes + +WANTLIB += c m + +COMPILER = base-clang ports-gcc +COMPILER_LANGS = c + +BUILD_DEPENDS = devel/bison + +TEST_DEPENDS = ${MODGNU_AUTOCONF_DEPENDS} + +USE_GMAKE = Yes +MAKE_FLAGS = BINDIR="${TRUEPREFIX}/bin" CC="${CC}" + +FAKE_FLAGS = BINDIR="${TRUEPREFIX}/bin" + +# Known failures: +# tests 001 and 002 fail depending on accuracy of host math lib +# test 006 fails on 32-bit platforms +# https://github.com/vapier/pcalc/issues/6 and .../issues/7 +TEST_ENV = AUTOCONF_VERSION=${AUTOCONF_VERSION} +TEST_FLAGS = BINDIR="${TRUEPREFIX}/bin" TESTSUITEFLAGS= + +AUTOCONF_VERSION = 2.69 + +.include diff --git a/math/pcalc/distinfo b/math/pcalc/distinfo new file mode 100644 index 00000000000..46098398e08 --- /dev/null +++ b/math/pcalc/distinfo @@ -0,0 +1,2 @@ +SHA256 (pcalc-4.tar.gz) = sWSQn30S3dLFCJGDvNvEFp4TxI2dOjBYHi0WI8msBDg= +SIZE (pcalc-4.tar.gz) = 24758 diff --git a/math/pcalc/pkg/DESCR b/math/pcalc/pkg/DESCR new file mode 100644 index 00000000000..6db0f60f5fe --- /dev/null +++ b/math/pcalc/pkg/DESCR @@ -0,0 +1,10 @@ +pcalc is a programmer's calculator. It simplifies some operations +(especially working with multiple bases) that are hard work without +this or another programmer's calculator. Main features: + + o Full math parser, parentheses, add, sub, mult, div, exponential + o Automatic conversion between HEX DEC OCT BIN numbers + o Mixing different bases in one expression + o Definable variables + o Math constants (E PI ...) + o Built in math functions (sin/cos/sqrt ...) diff --git a/math/pcalc/pkg/PLIST b/math/pcalc/pkg/PLIST new file mode 100644 index 00000000000..c1fe4a54e2d --- /dev/null +++ b/math/pcalc/pkg/PLIST @@ -0,0 +1,2 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2018/12/04 22:02:27 bcallah Exp $ +@bin bin/pcalc