diff --git a/math/mathex/Makefile b/math/mathex/Makefile index 3de5bbbd8e5a..e28301a1ecea 100644 --- a/math/mathex/Makefile +++ b/math/mathex/Makefile @@ -1,44 +1,28 @@ PORTNAME= mathex DISTVERSION= 0.3-b +PORTREVISION= 1 CATEGORIES= math science devel MASTER_SITES= SF/sscilib/mathex MAINTAINER= thierry@FreeBSD.org -COMMENT= C++ library fo parse/evaluate mathematical expression +COMMENT= C++ library to parse/evaluate mathematical expressions 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} +USES= cmake zip 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/|} +WRKSRC= ${WRKDIR}/${PORTNAME} -PROGS= curvetest inttest tabletest userfunctest +CMAKE_ON= CMAKE_POSITION_INDEPENDENT_CODE \ + CMAKE_SKIP_RPATH 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 +OPTIONS_SUB= yes do-install-EXAMPLES-on: -.for p in ${PROGS} - ${INSTALL_PROGRAM} ${WRKSRC}/${p} ${STAGEDIR}${PREFIX}/bin/ -.endfor + ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PORTNAME}-*test ${STAGEDIR}${PREFIX}/bin .include diff --git a/math/mathex/files/patch-CMakeLists.txt b/math/mathex/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..d19932dae771 --- /dev/null +++ b/math/mathex/files/patch-CMakeLists.txt @@ -0,0 +1,22 @@ +--- CMakeLists.txt.orig 2024-06-21 13:05:59 UTC ++++ CMakeLists.txt +@@ -0,0 +1,19 @@ ++cmake_minimum_required(VERSION 3.5) ++project(MATHEX) ++ ++add_library(mathex SHARED mathex.cpp) ++set_target_properties(mathex PROPERTIES VERSION 0.3.0 SOVERSION 0) ++ ++add_executable(mathex-curvetest curvetest.cpp) ++add_executable(mathex-tabletest tabletest.cpp) ++add_executable(mathex-userfunctest userfunctest.cpp) ++add_executable(mathex-inttest inttest.cpp) ++ ++link_directories (${MATHEX_BINARY_DIR}) ++target_link_libraries(mathex-curvetest mathex) ++target_link_libraries(mathex-tabletest mathex) ++target_link_libraries(mathex-userfunctest mathex) ++target_link_libraries(mathex-inttest mathex) ++ ++install(TARGETS mathex LIBRARY DESTINATION lib${LIB_SUFFIX}) ++install(FILES mathex.h DESTINATION include) diff --git a/math/mathex/files/patch-makefile b/math/mathex/files/patch-makefile deleted file mode 100644 index 714e89ccb09a..000000000000 --- a/math/mathex/files/patch-makefile +++ /dev/null @@ -1,22 +0,0 @@ ---- 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 index 5b11c45a3736..a5ba19cc7967 100644 --- a/math/mathex/pkg-descr +++ b/math/mathex/pkg-descr @@ -1,4 +1,4 @@ -MathEx is a C++ library to parse/evaluate mathematical expression. +MathEx is a C++ library to parse/evaluate mathematical expressions. -It is part of the SSCILIB (Small Scientific Library), a collection of small -library package to help development of scientific applications. +Part of the SSCILIB (Small Scientific Library), a collection of small +library packages to help development of scientific applications. diff --git a/math/mathex/pkg-plist b/math/mathex/pkg-plist new file mode 100644 index 000000000000..4e46657399eb --- /dev/null +++ b/math/mathex/pkg-plist @@ -0,0 +1,8 @@ +%%EXAMPLES%%bin/mathex-curvetest +%%EXAMPLES%%bin/mathex-inttest +%%EXAMPLES%%bin/mathex-tabletest +%%EXAMPLES%%bin/mathex-userfunctest +include/mathex.h +lib/libmathex.so +lib/libmathex.so.0 +lib/libmathex.so.0.3.0