math/tiny-bignum-c: New port: Small portable multiple-precision unsigned integer arithmetic in C

This commit is contained in:
Yuri Victorovich 2021-09-24 02:35:21 -07:00
parent 5b628e036a
commit 96b3a0cfc1
5 changed files with 59 additions and 0 deletions

View File

@ -1033,6 +1033,7 @@
SUBDIR += tetgen
SUBDIR += teyjus
SUBDIR += timbl
SUBDIR += tiny-bignum-c
SUBDIR += tmv
SUBDIR += tomsfastmath
SUBDIR += topaz

View File

@ -0,0 +1,40 @@
PORTNAME= tiny-bignum-c
DISTVERSION= g20210222
CATEGORIES= math
MAINTAINER= yuri@FreeBSD.org
COMMENT= Small portable multiple-precision unsigned integer arithmetic in C
LICENSE= UNLICENSE
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= python:build,test # build only for BINARY_ALIAS
USE_LDCONFIG= yes
USE_GITHUB= yes
GH_ACCOUNT= kokke
GH_TAGNAME= 201fb20
ENAME= bignum # libbn.so is used by another package, so install it as bignum
TEST_TARGET= all test # some tests fail, see https://github.com/kokke/tiny-bignum-c/issues/29
BINARY_ALIAS= python=${PYTHON_CMD}
PLIST_FILES= include/${ENAME}.h \
lib/lib${ENAME}.a \
lib/lib${ENAME}.so
do-build:
@cd ${WRKSRC} && \
${SETENV} ${MAKE_ENV} ${CC} -c ${CFLAGS} bn.c && \
${AR} -cq lib${ENAME}.a bn.o && \
${SETENV} ${MAKE_ENV} ${CC} -c ${CFLAGS} -fPIC bn.c && \
${CC} -shared -o lib${ENAME}.so -Wl,-soname,lib${ENAME}.so ${LDFLAGS} bn.o
do-install:
${INSTALL_DATA} ${WRKSRC}/bn.h ${STAGEDIR}${PREFIX}/include/${ENAME}.h
${INSTALL_DATA} ${WRKSRC}/lib${ENAME}.a ${STAGEDIR}${PREFIX}/lib
${INSTALL_LIB} ${WRKSRC}/lib${ENAME}.so ${STAGEDIR}${PREFIX}/lib
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1632474320
SHA256 (kokke-tiny-bignum-c-g20210222-201fb20_GH0.tar.gz) = 20838d8c239994de91394724c43c1e7f1207821c59974228976e10e39ee7002b
SIZE (kokke-tiny-bignum-c-g20210222-201fb20_GH0.tar.gz) = 34401

View File

@ -0,0 +1,8 @@
--- Makefile.orig 2021-02-22 22:03:20 UTC
+++ Makefile
@@ -1,4 +1,4 @@
-CC := gcc
+#CC := gcc
MACROS :=
CFLAGS := -I. -Wundef -Wall -Wextra -O3 $(MACROS)

View File

@ -0,0 +1,7 @@
tiny-bignum-c is a small portable arbitrary-precision unsigned integer
arithmetic in C, for calculating with large numbers.
Uses an array of uint8_t, uint16_t or uint32_t as underlying data-type utilizing
all bits in each word.
WWW: https://github.com/kokke/tiny-bignum-c