On 12/4/18 4:29 PM, Stuart Henderson wrote:
On 2018/12/04 15:36, Brian Callahan wrote:On 12/2/18 2:34 PM, Charles A Daniels wrote:Thanks to the help of Klemens, Brian, and Stuart, I have ported pcalc (originally written by Peter Glen, now maintained by Mike Frysinger). Brief description: Programmer's calculator, command line utility. There was always a loophole when it came to a need to covert between hexadecimal / decimal / octal / binary. Especially if it involved an operation like 0x1234 + 0x20 It took a lot of hard work, and mostly a good pocket 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 ...) I believe the port is ready for consideration to be added to the ports tree. However, testing on other architectures is is needed - I only have amd64 and macppc machines personally, and part of the test suite fails on macppc (reported upstream: https://github.com/vapier/pcalc/issues/7). If you have a system with another arch, please let me know if `make test` is able to run successfully!This version is much nicer. ~BrianAgreed, nearly there. DESCR could do with a little polish though, I know it's copied from upstream but we can do better :-) loophole isn't quite the right word (something like "gap in the market" would fit better, but is a bit clumsy), "covert" should be "convert", and actually those two short paragraphs are repeating things from the features list. Maybe something like this? ------- pcal 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 ...) ------- Re: tests. I don't think it's necessary to patch out the failing tests (and that may cause problems for updates), I'd prefer to remove the patch and just add a comment about this. TEST_TARGET is not needed either, the default works fine, and we can set TESTSUITEFLAGS= to avoid the failure in "getconf _NPROCESSORS_ONLN". (Linux getconf requires that this is prefixed with an underscore, OpenBSD requires that it is not prefixed, and because it's an extension there's no defined behaviour). e.g. +# 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" -TEST_TARGET = check test +TEST_FLAGS = BINDIR="${TRUEPREFIX}/bin" TESTSUITEFLAGS=
Thank you Stuart. Tarball looks like the attached. I changed your typo pcal => pcalc in the new DESCR :) ~Brian
pcalc.tgz
Description: Binary data
