Subject: CVS commit: pkgsrc/math/capc-calc
From: Chuck Cranor
Date: 2018-12-31 17:35:26
Message id: 20181231163526.1B984FB16@cvs.NetBSD.org

Log Message:
capc-calc: update to 2.12.7.1 and fix darwin compile

2.12.7.1 is the latest stable version.  for darwin use
${COMPILER_INCLUDE_DIRS} to find include dirs since
/usr/include may not be there.  also, we want INCDIR
to point to the system includes, but we want CALC_INCDIR
to point at ${PREFIX}/include/calc.  minor updates to Makefile
patch to do this.

2.12.4.13 to 2.12.7.1 changes from the calc maintainer's CHANGES file:

The following are the changes from calc version 2.12.7.1 to date:

    Corrected CHANGES notes that were mixed up for TAB, VT, CR &
    NL.  The code in 2.12.7.0 is correct.  The CHANGE notes should
    have read:

    The following is a partial list of escape sequences recognized
    in strings and in printf formats:

	\a	audible bell	byte 0x07 in ASCII encoding
	\b	backspace	byte 0x08 in ASCII encoding
	\f	form feed	byte 0x0c in ASCII encoding
	\n	newline		byte 0x0a in ASCII encoding
	\r	return		byte 0x0d in ASCII encoding
	\t	tab		byte 0x09 in ASCII encoding
	\v	vertical tab	byte 0x0b in ASCII encoding

    Sorry!

The following are the changes from calc version 2.12.6.10: to 2.12.7.0:

    Added a patch to replaces the manual search for include files
    in $(INCDIR) in the have_*.h targets with compiler invocations.
    Thanks goes to Helmut Grohne (helmut at subdivi dot de) who
    implemented the patch and posted it to the Debian bug tracker
    and Martin Buck (m at rtin-buck dor de) for forwarding it to us.

    The check_include make rule was fixed to not assume /usr/include.

    The qprintnum() function now takes outdigits as a 3rd argument.
    Most of the time, this 3rd argument is just conf->outdigits.
    But when it comes to the experimental '%g', this value can
    change.  This avoids having to modify conf->outdigits.

    Fixed a problem where gcc complains about E_FUNC not being defined
    for Linux systems as reported by Martin Buck (m at rtin-buck dor de).

    Updated the help files help/config, help/display, help/epsilon,
    help/fprint, help/printf, and help/strprintf to give more
    examples of how display digits and epsilon precision interact
    with displaying values.

    Added more information about %g in the help file help/printf.

    The '\a' is now recognized in a printf format string as the
    single byte audible bell character (byte 0x07 in ASCII encoding).

    The following is a partial list of escape sequences recognized
    in strings and in printf formats:

	\a	audible bell	byte 0x07 in ASCII encoding
	\b	backspace	byte 0x08 in ASCII encoding
	\f	form feed	byte 0x0c in ASCII encoding
	\n	newline		byte 0x0a in ASCII encoding
	\r	return		byte 0x0d in ASCII encoding
	\t	tab		byte 0x09 in ASCII encoding
	\v	vertical tab	byte 0x0b in ASCII encoding

The following are the changes from calc version 2.12.6.9 to 2.12.6.9:

    Fixed a number of core dump bugs related to the calculation of
    tan(), cot(), sec(), csc(), tanh(), coth(), sech(), and csch(),
    asin(), acos(), asinh(), acosh(), where when a call to an
    underlying function produced an invalid value.  Thanks goes to
    github user wuxiuheng for reporting this problem.

    A number of trigonometric and hyperbolic functions that incorrectly
    returned E_LOGINF, now return a new error code that is more
    specific to the trigonometric or hyperbolic function.  The
    following is a list of these new error codes: E_TAN3 E_TAN4
    E_COT3 E_COT4 E_SEC3 E_CSC3 E_TANH3 E_TANH4 E_COTH3 E_COTH4
    E_SECH3 E_CSCH3 E_ASIN3 E_ACOS3 E_ASINH3 E_ACOSH3 E_ATAN3 E_ACOT3
    E_ASEC3 E_ACSC3 E_ATANH3 E_ACOTH3 E_ASECH3 E_ACSCH3.

    Added regression tests 3729 thru 3732 to test E_TAN3, E_COT3,
    E_SEC3 and E_CSC3 respectively.

    Added experimential %g printf (and strprintf) format implementation
    based on pull request from github user 10110111.

    Made exterimental changes to macOS builds to not require use of
    /usr/include.  The INCDIR for macOS uses:

	INCDIR= $(shell xcrun --show-sdk-path --sdk macosx)/usr/include

    to determine the upper path of the /usr/include directory for macOS.
    In some rare cases, the Darwin target seems to not automatically detected.
    If you are running under macOS, and that happens, you can force
    the target to be Darwin:

	# for macOS users only, force the target to be darwin
	#
	make target=Darwin clobber
	make target=Darwin all
	make target=Darwin chk
	make target=Darwin install

The following are the changes from calc version 2.12.6.6 to 2.12.6.8:

    For historical purposes, in lucas.cal, gen_v1(1, n) always returns 4.

    Fixed some compiler warnings, thanks to a report by Mike
    <michael dot d dot ince at gmail dot com>.

    Added work around for a gcc warning bug, thanks to a report by Mike
    <michael dot d dot ince at gmail dot com>.

    Fixed errors in various help files such as:

	mat randbit seed srandom types

    Removed the MAXSTRING symbol because it was no longer used by calc.

    Increased HIST_SIZE (depth of the history stack) from 10k to 32k.

    Increased TTYSIZE (reallocation size for terminal buffers) from 100 to 8191.

    Increased MAXDEPTH (maximum depth of input stack) from 10 to 255.

    Increased interactive input buffer size from 1024 to 256k.  This has the
    effect of increasing the maximum length of an input line from a tty.
    This helps with an interactive bug that was reported by Ruslan Kabatsayev
    (b7 dot 10110111 at gmail dot com).

    The calc man page indicates that -d also disables the printing of the
    leading tilde.

    Added information to "help command" about how to silence messages
    while reading calc resource files.

    Fixed an error message buffer overflow thanks to a report by
    Frank Peters <nlp at northernlightsphoto dot biz>.

    Replaced all use of the C funcion sprintf() with snprintf().
    Replaced all use of the C funcion vsprintf() with vsnprintf().
    Replaced all DONT_HAVE_VSPRINTF with DONT_HAVE_VSNPRINTF.
    Replaced all Makefile var ${HAVE_VSPRINTF} with ${HAVE_VSNPRINTF}.

The following are the changes from calc version 2.12.6.4 to 2.12.6.5:

    Fixed warning about undefined operations involving the qlink(q)
    macro by replacing that macro with an inline-function.  Thanks goes
    to David Haller <dnh at opensuse dot org> for this fix.

    NOTE for Windows 10 users: Pavel Nemec <pane at seznam dot cz>
    reported that calc version 2.12.6.4 has been successfully
    compiled, installed and running on Windows 10.  See README.WINDOWS
    for more details.

The following are the changes from calc version 2.12.6.1 to 2.12.6.3:

    Improved gen_v1(h,n) in lucas.cal to use an even faster search method.

    Improved are checking in lucas.cal.  In particular both h and n must be
    integers >= 1.  In the case of both rodseth_xhn(x, h, n) and gen_v1(h, n)
    h must be odd.

    Fixed an C code indenting issue that was reported by Thomas Walter
    <th dot walter42 at gmx dot de> in zfunc.c.

    Fixed a man page warning about ./myfile where the leading dot
    was mistook for an nroff macro.  Thanks goes to David Haller
    <dnh at opensuse dot org> for providing the patch.

    Improved gen_v1(h,n) in lucas.cal for cases where h is not a
    multiple of 3. Optimized the search for v(1) when h is a
    multiple of 3.

    Fixed a Makefile problem, reported by Doug Hays <doughays6 at gmail
    dot com>, where if a macOS user set BINDIR, LIBDIR, CALC_SHAREDIR
    or INCDIR in the top section, their values will be overwritten by
    the Darwin specific section.

The following are the changes from calc version 2.12.6.0 to 2.12.6.0:

    Added the makefile variable ${COMMON_ADD} that will add flags
    to all compile and link commands. The ${COMMON_ADD} flags are
    appended to both ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}.  This
    facility is available to nearly all platforms except those with
    very old make commands that do not understand the += operator.

    Example on macOS (Darwin), one may invoke clang's -fsanitize
    facility by:

	make clobber all \
	  COMMON_ADD='-fsanitize=undefined -fsanitize=address'

    Another example.  To force C warnings to be treated as errors:

	make COMMON_ADD='-Werror'

    Created a GitHub repository for calc:

	https://github.com/lcn2/calc

    NOTE: The calc GitHub repository represents the an active
	  development stream.  While an effort will be made to keep
	  the master branch of the calc GitHub repository in working
	  order, that tree may be unstable.  Those wishing for more
	  reliable releases use releases found at calc mirror sites:

	    http://www.isthe.com/chongo/tech/comp/calc/calc-mirror.html

    IMPORTANT NOTE:

	On 2017 June 05, the calc GitHub history was re-written.
	Anyone who was tracking the calc "pre-release" on GitHub prior
	to version 2.12.6.0 should do a:

	    git reset --hard origin/master
	    git cleanup -f

	Or you may just want to start over:

	    rm -rf calc
	    git clone https://github.com/lcn2/calc.git

	Sorry about that.  The previous GitHub repository was an useful
	experiment.  Based on what we learned, we decided to rebuild it.

    Renamed README to README.FIRST.  Added README.md for the
    GitHub repository.

    Fixed reading from standard input (stdin) when -p is given on
    the command line.  This now prints hello:

	echo hello | calc -p 'stdin = files(0); print fgetline(stdin);'

    Added more debugging related to stdin when bit 4 of calc_debug
    is set (e.g., running calc with -D16).

    Updated the calc(1) man page and 'help file' to explain about
    reading from standard input (stdin).

    Added some clarifying remarks for 'help ptest' explaining that
    the ptest builtin can return 1 is some cases where the test
    value is a pseudoprime.

    Removed duplicate copyright comments from the help/builtin that
    is built.

    Fixed a number of typos in the CHANGES file.

The following are the changes from calc version 2.12.5.4 to 2.12.5.6:

    Recompile to match current RHEL7.2 libc and friends.

    Added fix by Alexandre Fedotov <fedotov at mail dot desy dot de>
    to prepend ${T} in front of the CALCPATH path components
    ${CALC_SHAREDIR} and ${CUSTOMDIR}.  Add ${T} in front of ${HELPDIR}
    and ${CUSTONHELPDIR} when making conf.h.

    Improved the jacobi help page.

    Rewrote gen_v1() in the lucas.cal resource file using the method
    based on a paper:

 	"A note on primality tests for N = h*2^n-1", by Oystein J. Rodseth,
	Department of Mathematics, University of Bergen, BIT Numerical
	Mathematics. 34 (3): pp 451-454.

	http://folk.uib.no/nmaoy/papers/luc.pdf

    The improved gen_v1() function is capable of returning a value
    for all valid values of h and n.  As a result, the trial tables
    used by gen_v1() have been changed to a short list of values
    to try, in order ot likelyhood of success, before doing an
    exhaustive search for a v1 value to return.

    Removed lucas_tbl.cal calc resource file.  This file was made
    obsolete by the above rewrite of the lucas.cal resource file.
    This file will be removed from the local cal directory and
    from CALC_SHAREDIR during a 'make install', 'make clobber',
    and 'make uninstall'.

    Renamed gen_u0() to gen_u2() in lucas.cal.  Provided a gen_u0()
    stub function that calls gen_u2() for backward compatibility.

    The old gen_v1() method used by the Amdahl 6 group has been
    renamed legacy_gen_v1() in lucas.cal.  This function is no
    longer used by the lucas(h, n) function to test the primality of
    h*2^n-1.  It is preserved in lucas.cal for historical purposes.

    The 'make clobber' rule will attempt to remove all files that
    start with libcalc and start with libcustcalc.

    The 'man' command is now an alias for the 'help' command.

    Fixed extra /'s that were put into CALCPATH because of ${T}.
    Fixed extra /'s that were compiled into HELPDIR and CUSTOMHELPDIR.

    The fix in 2.12.5.4 to to prepend ${T} in front of the CALCPATH
    path components ${CALC_SHAREDIR} and ${CUSTOMDIR} broke the
    calc rpm build process.  The check-buildroot tool discovered
    that the BUILDROOT directory had been improperly put into various
    paths and binaries.  This has been fixed in 2.12.5.5.

    Fixed a crash that showed up on macOS (Darwin) that was reported
    by Richard Outerbridge <outer at interlog dot com> and
    fixed by Stuart Henderson <stu at spacehopper dot org>.
    Thanks goes to both!

The following are the changes from calc version 2.12.5.3 to 2.12.5.3:

    Calc version 2.12.5.2 for macOS (Darwin) users, code to installed
    calc under /opt/calc.  Moreover the CHANGES file did not mention
    /opt/calc.  Sorry about that!.

    A much better tree for macOS (Darwin) users would have been
    to install cal under /opt/calc.  This release ONLY changes the
    macOS (Darwin) install tree to /usr/local.

    macOS (Darwin) users who installed calc version 2.12.5.2
    should, after installing version 2.12.5.3:

    	rm -rf /opt/calc

The following are the changes from calc version 2.12.5.1 to 2.12.5.2:

    NOTE: calc version 2.12.5.2, for macOS (Darwin) users,
    	  installed under /opt/calc.  We neglected to mention this
	  AND /usr/local would have been a better choice.  Sorry!
	  Fixed in calc version 2.12.5.3.

    Removed rules and makefile variables associated with shortened
    calc version numbers of less than 4 levels.

    Under OS X (Darwin), if /usr/include is missing, warnings
    are issued to help the user use xcode-select --install
    so that one may properly compile C code.

    Lowered REDC levels:

	#define MAXREDC 256	/* number of entries in REDC cache */

	#define SQ_ALG2 28	/* size for alternative squaring */
	    config("sq2") == 28		/* was 3388 */
	#define MUL_ALG2 28	/* size for alternative multiply */
	    config("mul2") == 28	/* was 1780 */
	#define POW_ALG2 20	/* size for using REDC for powers */
	    config("pow2") == 20	/* was 176 */
	#define REDC_ALG2 25	/* size for using alternative REDC */
	    config("redc2") == 25	/* was 220 */

    The alg_config.cal script appears to be not correctly finding the
    best REDC values.  While it has been improved, alg_config.cal still
    seems to be suspect on how it attempts to find the best values.

    Fixed an intro help file mistake found by Roger Hardiman
    <roger at rjh dot org dot uk>.

The following are the changes from calc version 2.12.5.0 to 2.12.5.1:

    Calc has a new calc-tester mailing list.  This list is for those
    who are using/testing calc.  We also use this list to announce
    new versions of calc.  To subscribe to the calc-tester mailing
    list, visit the following URL:

	    http://www.isthe.com/chongo/tech/comp/calc/calc-tester.html

	This is a low volume moderated mailing list.

	This mailing list replaces calc-tester at asthe dot com list.

	If you need a human to help you with your mailing list subscription,
	please send Email to our special:

	    calc-tester-maillist-help at asthe dot com

	address.  To be sure we see your Email asking for help with your
	mailing list subscription, please use the following phase in your
	Email Subject line:

	    calc tester mailing list help

	That phrase in your subject line will help ensure your
	request will get past our anti-spam filters.  You may have
	additional words in your subject line.

    There is a new calc bug report Email address:

	    calc-bug-report at asthe dot com

	This replaces the old calc-bugs at asthe dot com address.

	To be sure we see your Email reporting a calc bug, please use the
	following phase in your Email Subject line:

	    calc bug report

	That phrase in your subject line will help ensure your
	request will get past our anti-spam filters.  You may have
	additional words in your subject line.

	However, you may find it more helpful to simply subscribe
	to the calc-tester mailing list (see above) and then to
	send your report to that mailing list as a wider set calc
	testers may be able to help you.

    The following makefile rules that were related to printing the
    upper values of the calc version, rules that were made obsolete
    in calc version 2.12.4.14, have been removed:

	calc_vers calc_ver calc_ve
	vers ver ve

    Noted that the hash() builtin function, internally known as
    quickhash (used for internal objects such as the associative
    arrays as well as other internal processes) uses the deprecated
    32-bit FNV-0 hash.  The use of this deprecated hash is sufficient
    for calc internal purposes.  Use of FNV-1a is recommended for
    a general non-cryptographic quick hash.

The following are the changes from calc version 2.12.4.14 to 2.12.5.0:

    For Apple OS X / Darwin target:

    	MACOSX_DEPLOYMENT_TARGET is no longer defined
	using clang compiler

	By default, -install-name is used when forming shared libs.
	To force -install-name to not be used, set SET_INSTALL_NAME=no.

    The have_stdvs.c test uses <stdlib.h> and fixed va_start() test call
    that didn't use last arg.

    Fixed math_fmt (printf) in value.c where a LEN (SB32) be printed as %d.

    Fixed a significant bug where that resulted in an incorrect
    complex number comparison.  Thanks goes to David Binderman
    <dcb314 at hotmail dot com> for identifying the subtle typo!

    Make minor fixes to the make depend rule.

    Fixed places were calc defined a reserved identifier that
    begin with either __ or _[A-Z].  For example, __FILE_H__ has
    been replaced with INCLUDE_FILE_H.

    Fixed the addall3 example in the script help file.  Thanks for this
    fix goes to Igor Furlan <igor dot furlan at gmail dot com>.

    We made important fixes to the calc command line history:

	Fixed a bug in the command line history where calc would sometimes
	crash.  There was code that used memcpy() instead of memmove()
	that could corrupt the command line history when entering a
	into into history that was similar to a previous entry.  Thanks
	goes to Einar Lielmanis <einars at spicausis dot lv> for first
	identifying this mistake.

	The calc command line history code, in general was not robust.
	We made use a patch from Mathias Buhr <napcode at users dot sf
	dot net>, that while it uses a bit more memory: is much more
	flexible, readable and robust.  This patch replaced the improper
	use of memcpy() (see above) with better code.  Thanks!

    The alg_config.cal calc resource file has been reworked to produce
    better diagnostics while attempting to determine the ideal values
    for mul2, sq2, and pow2.  However, it has been shown that this
    code is not correct.  Suggestions for a replacement are welcome!

   	calc -u 'read alg_config; config("user_debug", 2),; best_mul2();'
   	calc -u 'read alg_config; config("user_debug", 2),; best_sq2();'
   	calc -u 'read alg_config; config("user_debug", 2),; best_pow2();'

    Fixed a number of pedantic compiler warnings.

    Removed -W and -Wno-comment from the the CCWARN makefile variable.

    Removed no_implicit.arg makefile rule.  Removed HAVE_NO_IMPLICIT
    makefile variable.  Removed no_implicit.c source file.

    Added WNO_IMPLICT makefile variable to hold the compiler flag
    -Wno-implicit for use on selective compile lines.

    Added WNO_ERROR_LONG_LONG makefile variable to hold the compiler flag
    -Wno-error=long-long for use on selective compile lines.

    Added WNO_LONG_LONG makefile variable to hold the compiler flag
    -Wno-long-long for use on selective compile lines.

    The makefile variable ${MKDIR_ARG} has been replaced with just -p.

    Minor fixes were made to the calc.spec.in file.

    The target rpm architecture changed from i686 to x86_64.  For those
    who do not run machine with x86_64, we continue to release a src
    rpm. For those without the ability to process an rpm, we will always
    to release src tarball.

    When building the libcalc and libcustcalc shared  libraries,
    ONLY the .so and .so.${VERSION} files are created.  The .so is
    a symlink to the .so.${VERSION} file.  Here ${VERSION} is the
    full "w.x.y.z" calc version.

Files:
RevisionActionfile
1.48modifypkgsrc/math/capc-calc/Makefile
1.15modifypkgsrc/math/capc-calc/PLIST
1.28modifypkgsrc/math/capc-calc/distinfo
1.1addpkgsrc/math/capc-calc/patches/patch-Makefile
1.10removepkgsrc/math/capc-calc/patches/patch-aa