aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2021-09-24 09:35:21 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2021-09-24 09:44:16 +0000
commit96b3a0cfc1683f0e657f625c77e7ba31ee8ac974 (patch)
treea91508152f726807e6d91d6e2d4bcb35e5aedd82
parent5b628e036a9de55cd05bc4b184374431a7e2aabb (diff)
downloadports-96b3a0cfc1683f0e657f625c77e7ba31ee8ac974.tar.gz
ports-96b3a0cfc1683f0e657f625c77e7ba31ee8ac974.zip
-rw-r--r--math/Makefile1
-rw-r--r--math/tiny-bignum-c/Makefile40
-rw-r--r--math/tiny-bignum-c/distinfo3
-rw-r--r--math/tiny-bignum-c/files/patch-Makefile8
-rw-r--r--math/tiny-bignum-c/pkg-descr7
5 files changed, 59 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile
index fab655259b3c..5ffb5cae6a85 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1033,6 +1033,7 @@
SUBDIR += tetgen
SUBDIR += teyjus
SUBDIR += timbl
+ SUBDIR += tiny-bignum-c
SUBDIR += tmv
SUBDIR += tomsfastmath
SUBDIR += topaz
diff --git a/math/tiny-bignum-c/Makefile b/math/tiny-bignum-c/Makefile
new file mode 100644
index 000000000000..e664bcdf80fd
--- /dev/null
+++ b/math/tiny-bignum-c/Makefile
@@ -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>
diff --git a/math/tiny-bignum-c/distinfo b/math/tiny-bignum-c/distinfo
new file mode 100644
index 000000000000..1553cba184fc
--- /dev/null
+++ b/math/tiny-bignum-c/distinfo
@@ -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
diff --git a/math/tiny-bignum-c/files/patch-Makefile b/math/tiny-bignum-c/files/patch-Makefile
new file mode 100644
index 000000000000..db5359aa1a19
--- /dev/null
+++ b/math/tiny-bignum-c/files/patch-Makefile
@@ -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)
+
diff --git a/math/tiny-bignum-c/pkg-descr b/math/tiny-bignum-c/pkg-descr
new file mode 100644
index 000000000000..816f5726db29
--- /dev/null
+++ b/math/tiny-bignum-c/pkg-descr
@@ -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