git: 711f7ab1ab59 - 2023Q4 - math/dsdp: adding a SONAME to the shared library

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Thu, 02 Nov 2023 16:25:41 UTC
The branch 2023Q4 has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=711f7ab1ab59b258d91c60213267c34668b3922e

commit 711f7ab1ab59b258d91c60213267c34668b3922e
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2023-11-01 16:06:15 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2023-11-02 16:25:06 +0000

    math/dsdp: adding a SONAME to the shared library
    
    When building math/py-cvxopt the following error is displayed:
    Error: /usr/local/lib/python3.9/site-packages/cvxopt/dsdp.cpython-39.so is
    linked to /usr/local/lib/libdsdp.so which does not have a SONAME.
    math/dsdp needs to be fixed.
    
    Since I’m there, also install the static library.
    
    PR:             274851
    Approved by:    yuri 'maintainer)
    
    (cherry picked from commit 2a236ba2fb1292066821487f6ad5cf49949705cd)
---
 math/dsdp/Makefile             | 6 ++++--
 math/dsdp/files/patch-Makefile | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/math/dsdp/Makefile b/math/dsdp/Makefile
index 06588fcb81bf..b8cd5abb1d0e 100644
--- a/math/dsdp/Makefile
+++ b/math/dsdp/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	dsdp
 DISTVERSION=	5.8
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	math
 MASTER_SITES=	https://www.mcs.anl.gov/hs/software/${PORTNAME:tu}/
 DISTNAME=	${PORTNAME:tu}${DISTVERSION}
@@ -23,7 +23,7 @@ USE_LDCONFIG=	yes
 ALL_TARGET=	all oshared all oshared
 
 BINARY_ALIAS=	make=${GMAKE} gcc=${CC}
-MAKE_ENV=	DSDPROOT=${WRKSRC} SH_LD="${CC} -shared"
+MAKE_ENV=	DSDPROOT=${WRKSRC} SH_LD="${CC} -shared -Wl,-soname,libdsdp.so.0"
 CFLAGS+=	-fPIC
 
 PLIST_FILES=	bin/dsdp5 \
@@ -32,6 +32,7 @@ PLIST_FILES=	bin/dsdp5 \
 		include/dsdp/dsdplapack.h \
 		include/dsdp/dsdpmem.h \
 		include/dsdp/dsdpsys.h \
+		lib/libdsdp.a \
 		lib/libdsdp.so.0 \
 		lib/libdsdp.so
 
@@ -42,6 +43,7 @@ do-build: # the build fails to build all binaries without being called twice due
 do-install:
 	@${MKDIR} ${STAGEDIR}${PREFIX}/include/dsdp
 	${INSTALL_PROGRAM} ${WRKSRC}/bin/dsdp5 ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_DATA} ${WRKSRC}/lib/libdsdp.a ${STAGEDIR}${PREFIX}/lib
 	${INSTALL_LIB} ${WRKSRC}/lib/libdsdp.so ${STAGEDIR}${PREFIX}/lib/libdsdp.so.0
 	(cd ${STAGEDIR}${PREFIX}/lib && ${LN} -s libdsdp.so.0 libdsdp.so)
 	${INSTALL_DATA} ${WRKSRC}/include/*.h ${STAGEDIR}${PREFIX}/include/dsdp
diff --git a/math/dsdp/files/patch-Makefile b/math/dsdp/files/patch-Makefile
index 9d1d131f58f7..9e9bd9781648 100644
--- a/math/dsdp/files/patch-Makefile
+++ b/math/dsdp/files/patch-Makefile
@@ -9,6 +9,6 @@
 -	${SH_LD} ${DSDPLIBSO} *.o -o ${DSDPLIBSO}; \
 +	echo "building ${DSDPLIBSO}"
 +	${AR} x ${DSDPLIB}
-+	$(CC) -shared $(LDFLAGS) -llapack -lblas -lm *.o -o ${DSDPLIBSO}; \
++	$(SH_LD) $(LDFLAGS) -llapack -lblas -lm *.o -o ${DSDPLIBSO}; \
  	cd ../ ; \
  	${RM} tmp