Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Nov 2018 10:30:49 +0000 (UTC)
From:      Thierry Thomas <thierry@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r483884 - in head/math/parmetis: . files
Message-ID:  <201811031030.wA3AUnmG073296@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thierry
Date: Sat Nov  3 10:30:49 2018
New Revision: 483884
URL: https://svnweb.freebsd.org/changeset/ports/483884

Log:
  - build the shared libraries by defaulti (used by Code_Saturne);
  
  - add an option to keep the static ones;
  
  - add an external pkg-plist.

Added:
  head/math/parmetis/files/
  head/math/parmetis/files/patch-CMakeLists.txt   (contents, props changed)
  head/math/parmetis/pkg-plist   (contents, props changed)
Modified:
  head/math/parmetis/Makefile

Modified: head/math/parmetis/Makefile
==============================================================================
--- head/math/parmetis/Makefile	Sat Nov  3 09:38:18 2018	(r483883)
+++ head/math/parmetis/Makefile	Sat Nov  3 10:30:49 2018	(r483884)
@@ -3,7 +3,7 @@
 
 PORTNAME=	ParMetis
 PORTVERSION=	4.0.3
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	math parallel
 MASTER_SITES=	http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/
 DISTNAME=	${PORTNAME:tl}-${PORTVERSION}
@@ -16,8 +16,12 @@ LICENSE_NAME=	University of Minnesota METIS License
 LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 LICENSE_PERMS=	auto-accept
 
-OPTIONS_DEFINE=	OPENMPI DOCS
+USES=		cmake:noninja gmake
+USE_LDCONFIG=	${PREFIX}/lib/parmetis
+
+OPTIONS_DEFINE=	OPENMPI DOCS STATIC
 OPENMPI_DESC=	Use openmpi instead of mpich
+OPTIONS_SUB=	yes
 
 OPENMPI_BUILD_DEPENDS=		${LOCALBASE}/mpi/openmpi/bin/mpicc:net/openmpi
 OPENMPI_RUN_DEPENDS=		${LOCALBASE}/mpi/openmpi/bin/mpirun:net/openmpi
@@ -28,17 +32,14 @@ OPENMPI_RUN_DEPENDS_OFF=	${LOCALBASE}/bin/mpirun:net/m
 OPENMPI_VARS_OFF=		MPICC=${LOCALBASE}/bin/mpicc \
 				MPICXX=${LOCALBASE}/bin/mpicxx
 
-USES=		cmake:noninja gmake
+STATIC_DESC=			Do not build and install shared library
+STATIC_VARS_OFF=		SH_FLAG="shared=1"
 
-PLIST_FILES=	include/parmetis/metis.h \
-		include/parmetis/parmetis.h \
-		lib/parmetis/libmetis.a \
-		lib/parmetis/libparmetis.a \
-		${DOCSDIR}/manual.pdf
+CFLAGS+=	-fPIC
 
 .include <bsd.port.options.mk>
 
-post-patch:
+pre-configure:
 	@${REINPLACE_CMD} -e \
 		's|BUILDDIR =.*|BUILDDIR = build| ; \
 		 s|make -C|$$(MAKE) -C| ; \
@@ -56,7 +57,7 @@ post-patch:
 
 do-configure:
 	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \
-		${MAKEFILE} config prefix="${PREFIX}" cc="${MPICC}" cxx="${MPICXX}"
+		${MAKEFILE} config prefix="${PREFIX}" cc="${MPICC}" cxx="${MPICXX}" ${SH_FLAG}
 
 do-install:
 	@${MKDIR} ${STAGEDIR}${PREFIX}/include/parmetis \
@@ -65,10 +66,20 @@ do-install:
 	${INSTALL_DATA} ${WRKSRC}/include/parmetis.h \
 		${WRKSRC}/metis/include/metis.h \
 		${STAGEDIR}${PREFIX}/include/parmetis
+.if ${PORT_OPTIONS:MSTATIC}
 	${INSTALL_DATA} ${WRKSRC}/build/libmetis/libmetis.a \
 		${STAGEDIR}${PREFIX}/lib/parmetis
 	${INSTALL_DATA} ${WRKSRC}/build/libparmetis/libparmetis.a \
 		${STAGEDIR}${PREFIX}/lib/parmetis
+.else
+	${INSTALL_DATA} ${WRKSRC}/build/libmetis/libmetis.so \
+		${STAGEDIR}${PREFIX}/lib/parmetis/libmetis.so.2
+	${INSTALL_LIB} ${WRKSRC}/build/libparmetis/libparmetis.so \
+		${STAGEDIR}${PREFIX}/lib/parmetis/libparmetis.so.2
+	cd ${STAGEDIR}${PREFIX}/lib/parmetis &&	\
+		${LN} -sf libmetis.so.2 ${STAGEDIR}${PREFIX}/lib/parmetis/libmetis.so && \
+		${LN} -sf libparmetis.so.2 ${STAGEDIR}${PREFIX}/lib/parmetis/libparmetis.so
+.endif
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/manual/manual.pdf ${STAGEDIR}${DOCSDIR}
 

Added: head/math/parmetis/files/patch-CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/parmetis/files/patch-CMakeLists.txt	Sat Nov  3 10:30:49 2018	(r483884)
@@ -0,0 +1,13 @@
+--- CMakeLists.txt.orig	2013-03-30 16:24:50 UTC
++++ CMakeLists.txt
+@@ -19,8 +19,10 @@ execute_process(COMMAND ${CMAKE_COMMAND}
+ # Prepare libraries.
+ if(SHARED)
+   set(ParMETIS_LIBRARY_TYPE SHARED)
++  set(METIS_LIBRARY_TYPE SHARED)
+ else()
+   set(ParMETIS_LIBRARY_TYPE STATIC)
++  set(METIS_LIBRARY_TYPE STATIC)
+ endif()
+ 
+ include(${GKLIB_PATH}/GKlibSystem.cmake)

Added: head/math/parmetis/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/parmetis/pkg-plist	Sat Nov  3 10:30:49 2018	(r483884)
@@ -0,0 +1,9 @@
+include/parmetis/metis.h
+include/parmetis/parmetis.h
+%%STATIC%%lib/parmetis/libmetis.a
+%%NO_STATIC%%lib/parmetis/libmetis.so
+%%NO_STATIC%%lib/parmetis/libmetis.so.2
+%%STATIC%%lib/parmetis/libparmetis.a
+%%NO_STATIC%%lib/parmetis/libparmetis.so
+%%NO_STATIC%%lib/parmetis/libparmetis.so.2
+%%DOCSDIR%%/manual.pdf



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811031030.wA3AUnmG073296>