git: 2b3088f0977f - main - math/suitesparse-Example: adding the Example package of SuiteSparse

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Fri, 01 Aug 2025 20:57:19 UTC
The branch main has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2b3088f0977f933538ebd3551a632a1003ba2231

commit 2b3088f0977f933538ebd3551a632a1003ba2231
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2025-08-01 20:49:33 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2025-08-01 20:57:16 +0000

    math/suitesparse-Example: adding the Example package of SuiteSparse
    
    Like CSparse, do not install it by default.
---
 math/Makefile                       |  1 +
 math/suitesparse-Example/Makefile   | 40 +++++++++++++++++++++++++++++++++++++
 math/suitesparse-Example/pkg-descr  |  3 +++
 math/suitesparse-Example/pkg-plist  | 11 ++++++++++
 math/suitesparse/Makefile           |  3 ++-
 math/suitesparse/bsd.suitesparse.mk |  1 +
 6 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/math/Makefile b/math/Makefile
index 7dcdaa9510e1..518d98e22cab 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1222,6 +1222,7 @@
     SUBDIR += stanmath
     SUBDIR += stp
     SUBDIR += suitesparse
+    SUBDIR += suitesparse-Example
     SUBDIR += suitesparse-amd
     SUBDIR += suitesparse-btf
     SUBDIR += suitesparse-camd
diff --git a/math/suitesparse-Example/Makefile b/math/suitesparse-Example/Makefile
new file mode 100644
index 000000000000..24b7070a1f30
--- /dev/null
+++ b/math/suitesparse-Example/Makefile
@@ -0,0 +1,40 @@
+PORTNAME=	${MPORTNAME:tl}
+PORTVERSION=	1.8.9
+CATEGORIES=	math
+
+COMMENT=	Examples for SuiteSparse
+WWW=		https://faculty.cse.tamu.edu/davis/suitesparse.html
+
+LICENSE=	BSD3CLAUSE
+
+LIB_DEPENDS=	libamd.so:math/suitesparse-amd				\
+		libbtf.so:math/suitesparse-btf				\
+		libcamd.so:math/suitesparse-camd			\
+		libccolamd.so:math/suitesparse-ccolamd			\
+		libcholmod.so:math/suitesparse-cholmod			\
+		libcolamd.so:math/suitesparse-colamd			\
+		libcxsparse.so:math/suitesparse-cxsparse		\
+		libgraphblas.so:math/suitesparse-graphblas		\
+		libklu_cholmod.so:math/suitesparse-klu			\
+		liblagraph.so:math/suitesparse-lagraph			\
+		libldl.so:math/suitesparse-ldl				\
+		libsuitesparse_mongoose.so:math/suitesparse-mongoose	\
+		libparu.so:math/suitesparse-paru			\
+		librbio.so:math/suitesparse-rbio			\
+		libspex.so:math/suitesparse-spex			\
+		libspqr.so:math/suitesparse-spqr			\
+		libumfpack.so:math/suitesparse-umfpack
+
+USES=		localbase:ldflags fortran
+
+MPORTNAME=	Example
+USE_LDCONFIG=	yes
+
+.include "${.CURDIR}/../../math/suitesparse/bsd.suitesparse.mk"
+
+post-stage-DOCS-on:
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${BUILD_WRKSRC}/README.md	\
+		${STAGEDIR}${DOCSDIR}/${MPORTNAME}_README.md
+
+.include <bsd.port.post.mk>
diff --git a/math/suitesparse-Example/pkg-descr b/math/suitesparse-Example/pkg-descr
new file mode 100644
index 000000000000..522fc4848f98
--- /dev/null
+++ b/math/suitesparse-Example/pkg-descr
@@ -0,0 +1,3 @@
+This port installs the 'my' library of SuiteSparse.
+
+This is only a demonstration package.
diff --git a/math/suitesparse-Example/pkg-plist b/math/suitesparse-Example/pkg-plist
new file mode 100644
index 000000000000..c7acb7853af9
--- /dev/null
+++ b/math/suitesparse-Example/pkg-plist
@@ -0,0 +1,11 @@
+/you/have/to/check/what/makeplist/gives/you
+include/my.h
+lib/libmy.a
+lib/libmy.so
+lib/libmy.so.1
+lib/libmy.so.%%VER%%
+lib/libmy_cxx.a
+lib/libmy_cxx.so
+lib/libmy_cxx.so.1
+lib/libmy_cxx.so.%%VER%%
+%%PORTDOCS%%%%DOCSDIR%%/Example_README.md
diff --git a/math/suitesparse/Makefile b/math/suitesparse/Makefile
index eeb797e4db65..d0445acf39ac 100644
--- a/math/suitesparse/Makefile
+++ b/math/suitesparse/Makefile
@@ -25,7 +25,8 @@ RUN_DEPENDS=	suitesparse-config>0:math/suitesparse-config		\
 		suitesparse-umfpack>0:math/suitesparse-umfpack		\
 		suitesparse-paru>0:math/suitesparse-paru
 .if !defined(PACKAGE_BUILDING)
-RUN_DEPENDS+=	suitesparse-csparse>0:math/suitesparse-csparse
+RUN_DEPENDS+=	suitesparse-csparse>0:math/suitesparse-csparse		\
+		suitesparse-Example>0:math/suitesparse-Example
 .endif
 
 USES=		metaport
diff --git a/math/suitesparse/bsd.suitesparse.mk b/math/suitesparse/bsd.suitesparse.mk
index 2d93f637b5d4..6d8bb1c68203 100644
--- a/math/suitesparse/bsd.suitesparse.mk
+++ b/math/suitesparse/bsd.suitesparse.mk
@@ -35,6 +35,7 @@ LIB_DEPENDS+=	libsuitesparseconfig.so:math/suitesparse-config
 .endif
 .if ${MPORTNAME} != config &&	\
 	${MPORTNAME} != BTF &&	\
+	${MPORTNAME} != Example &&	\
 	${MPORTNAME} != ssget
 OPTIONS_DEFINE+=DEMOS
 .endif