aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Thomas <thierry@FreeBSD.org>2024-06-21 09:22:25 +0000
committerThierry Thomas <thierry@FreeBSD.org>2024-06-21 11:15:52 +0000
commit12594e1aee7b17507b85b8a0ee762a678b3ff79e (patch)
treed6b508ddf8845533e1be050df3bc62f3345f87f9
parent993bcea0efa7289c269dc188e0c52706b114eb55 (diff)
math/mathex: new port, C++ library to parse/evaluate mathematical expressions
Remark: upstream seems inactive, but MathEx is still used by Gmsh.
-rw-r--r--math/Makefile1
-rw-r--r--math/mathex/Makefile44
-rw-r--r--math/mathex/distinfo3
-rw-r--r--math/mathex/files/patch-makefile22
-rw-r--r--math/mathex/pkg-descr4
5 files changed, 74 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile
index 44e78e22da9a..de329683fee5 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -487,6 +487,7 @@
SUBDIR += m4rie
SUBDIR += mate-calc
SUBDIR += math77
+ SUBDIR += mathex
SUBDIR += mathgl
SUBDIR += mathicsscript
SUBDIR += mathmod
diff --git a/math/mathex/Makefile b/math/mathex/Makefile
new file mode 100644
index 000000000000..3de5bbbd8e5a
--- /dev/null
+++ b/math/mathex/Makefile
@@ -0,0 +1,44 @@
+PORTNAME= mathex
+DISTVERSION= 0.3-b
+CATEGORIES= math science devel
+MASTER_SITES= SF/sscilib/mathex
+
+MAINTAINER= thierry@FreeBSD.org
+COMMENT= C++ library fo parse/evaluate mathematical expression
+WWW= https://sscilib.sourceforge.net/
+
+LICENSE= LGPL21
+LICENSE_FILE= ${WRKSRC}/license.txt
+
+USES= dos2unix zip
+DOS2UNIX_FILES= makefile
+
+WRKSRC= ${WRKDIR}/${PORTNAME}
+MAKEFILE= makefile
+ALL_TARGET= ${PORTNAME}
+USE_LDCONFIG= yes
+
+PLIST_FILES= ${PREFIX}/include/mathex.h \
+ ${PREFIX}/lib/lib${PORTNAME}.so \
+ ${PREFIX}/lib/lib${PORTNAME}.so.0
+PLIST_FILES+= ${PROGS:C|^|${PREFIX}/bin/|}
+
+PROGS= curvetest inttest tabletest userfunctest
+
+OPTIONS_DEFINE= EXAMPLES
+
+post-build:
+ (cd ${WRKSRC} && \
+ ${CXX} ${LDFLAGS} -shared -o lib${PORTNAME}.so.0 -Wl,-soname,lib${PORTNAME}.so.0 ${PORTNAME}.o)
+
+do-install:
+ ${INSTALL_DATA} ${WRKSRC}/mathex.h ${STAGEDIR}${PREFIX}/include/
+ ${INSTALL_LIB} ${WRKSRC}/lib${PORTNAME}.so.0 ${STAGEDIR}${PREFIX}/lib/
+ ${LN} -s lib${PORTNAME}.so.0 ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so
+
+do-install-EXAMPLES-on:
+.for p in ${PROGS}
+ ${INSTALL_PROGRAM} ${WRKSRC}/${p} ${STAGEDIR}${PREFIX}/bin/
+.endfor
+
+.include <bsd.port.mk>
diff --git a/math/mathex/distinfo b/math/mathex/distinfo
new file mode 100644
index 000000000000..0d63b2aaf216
--- /dev/null
+++ b/math/mathex/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1718957652
+SHA256 (mathex-0.3-b.zip) = 8b3ac4e7620e7ffe04deaae9562a37e1e1a375cf589eec06ee3e7a04ea5c9fcc
+SIZE (mathex-0.3-b.zip) = 31441
diff --git a/math/mathex/files/patch-makefile b/math/mathex/files/patch-makefile
new file mode 100644
index 000000000000..714e89ccb09a
--- /dev/null
+++ b/math/mathex/files/patch-makefile
@@ -0,0 +1,22 @@
+--- makefile.orig 2024-06-21 08:45:06 UTC
++++ makefile
+@@ -78,9 +78,9 @@
+ ##############################
+ # current compiler settings #
+ ##############################
+-CC = g++
+-CFLAGS = -Wall -ggdb -c -o
+-LFLAGS = -ggdb -o
++CC = ${CXX}
++CFLAGS += -fPIC -c -o
++LFLAGS = ${LDFLAGS} -o
+ # for g++ link as C++. Thus, is not need to specify stdc++
+ # LIBS = -lm -lstdc++
+ LIBS = -lm
+@@ -162,4 +162,4 @@ clear:
+ clear:
+ rm $(OBJECTS)
+
+-# end of makefile
+\ No newline at end of file
++# end of makefile
diff --git a/math/mathex/pkg-descr b/math/mathex/pkg-descr
new file mode 100644
index 000000000000..5b11c45a3736
--- /dev/null
+++ b/math/mathex/pkg-descr
@@ -0,0 +1,4 @@
+MathEx is a C++ library to parse/evaluate mathematical expression.
+
+It is part of the SSCILIB (Small Scientific Library), a collection of small
+library package to help development of scientific applications.