freebsd-ports/math/libmesh/Makefile
Stefan Eßer b7f05445c0 Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.

Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.

There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.

This commit implements such a proposal and moves one of the WWW: entries
of each pkg-descr file into the respective port's Makefile. A heuristic
attempts to identify the most relevant URL in case there is more than
one WWW: entry in some pkg-descr file. URLs that are not moved into the
Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr
files in order to preserve them.

There are 1256 ports that had no WWW: entries in pkg-descr files. These
ports will not be touched in this commit.

The portlint port has been adjusted to expect a WWW entry in each port
Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as
deprecated.

Approved by:		portmgr (tcberner)
2022-09-07 23:10:59 +02:00

94 lines
3.4 KiB
Makefile

PORTNAME= libmesh
DISTVERSION= 1.7.0
PORTREVISION= 3
CATEGORIES= math
MASTER_SITES= https://github.com/libMesh/${PORTNAME}/releases/download/v${DISTVERSION}/
MAINTAINER= yuri@FreeBSD.org
COMMENT= Numerical simulation of partial differential equations
WWW= https://libmesh.github.io
LICENSE= LGPL21
LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libboost_system.so:devel/boost-libs \
libnlopt.so:math/nlopt
USES= compiler:c++17-lang eigen:3 gmake libtool localbase perl5 pkgconfig tar:xz
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-static \
--with-methods=opt \
--with-thread-model=pthread \
--datarootdir=${DATADIR} \
--enable-amr \
--enable-nlopt \
--disable-strict-lgpl \
--enable-tetgen \
--enable-triagle \
--with-boost=${LOCALBASE} \
--with-eigen-include=${LOCALBASE}/include/eigen3 \
--disable-netcdf --disable-netcdf-4 # https://github.com/libMesh/libmesh/issues/1542
CONFIGURE_ARGS+= --disable-metaphysicl # enabling this causes libmesh to install a bundled metaphysicl that would conflict with the metaphysicl package
CONFIGURE_ARGS+= --with-nlopt-include=${LOCALBASE}/include --with-nlopt-lib=${LOCALBASE}/lib # workaround for https://github.com/libMesh/libmesh/issues/3314
MAKE_ARGS= LDFLAGS="-pthread -lexecinfo -L${LOCALBASE}/lib"
USE_LDCONFIG= yes
CXXFLAGS+= -I${WRKSRC}/contrib/parmetis/include # because parmetis.h isn't found for ./include/libmesh/parmetis_helper.h
INSTALL_TARGET= install-strip
TEST_TARGET= check
OPTIONS_DEFINE= GLPK HDF5 MPI EXAMPLES
OPTIONS_DEFAULT= MPI
GLPK_DESC= Glpk linear programming solver library
GLPK_CONFIGURE_ENABLE= glpk
GLPK_LIB_DEPENDS= libglpk.so:math/glpk
HDF5_CONFIGURE_ENABLE= hdf5
HDF5_LIB_DEPENDS= libhdf5.so:science/hdf5
MPI_CONFIGURE_ENABLE= mpi
MPI_CONFIGURE_ON= --with-mpi=${LOCALBASE} --with-mpi-include=${LOCALBASE}/include --with-mpi-lib=${LOCALBASE}/lib
MPI_LIB_DEPENDS= libmpi.so:net/mpich
EXAMPLES_CONFIGURE_ENABLE= examples
EXAMPLES_VARS= PKGMESSAGE=pkg-message-examples
SUB_FILES= pkg-message-examples
PORTEXAMPLES= *
post-extract:
@${FIND} ${WRKSRC} -name "*.orig" -delete
post-install:
@${MKDIR} ${STAGEDIR}${DATADIR}
@${MV} ${STAGEDIR}${PREFIX}/etc/libmesh/Make.common ${STAGEDIR}${DATADIR}
@cd ${STAGEDIR}${PREFIX} && ${RM} -r \
etc/libmesh \
Make.common \
contrib \
libdata/pkgconfig/Make.common # https://github.com/libMesh/libmesh/issues/1539
# delete metis.h, see https://github.com/libMesh/libmesh/issues/3317
${RM} ${STAGEDIR}${PREFIX}/include/metis.h
post-install-EXAMPLES-on:
# https://github.com/libMesh/libmesh/issues/1541
@${MV} ${STAGEDIR}${PREFIX}/examples ${STAGEDIR}${EXAMPLESDIR}
@${FIND} ${STAGEDIR}${EXAMPLESDIR} -name Makefile | ${XARGS} ${REINPLACE_CMD} -i '' -e ' \
s|LIBMESH_DIR ?= .*|LIBMESH_DIR ?= ${PREFIX}| ; \
s|$$(LIBMESH_DIR)/Make.common|${DATADIR}/Make.common| ; \
s|LIBMESH_DIR/examples|LIBMESH_DIR/share/examples/${PORTNAME}| ; \
s|$$(libmesh_LDFLAGS)|$$(libmesh_LDFLAGS) -pthread|'
@${FIND} ${STAGEDIR}${EXAMPLESDIR} -name run.sh | ${XARGS} ${CHMOD} +x
@${FIND} ${STAGEDIR}${EXAMPLESDIR} -name run.sh | ${XARGS} ${REINPLACE_CMD} -i '' -e ' \
s|#set -x|export LIBMESH_DIR=${PREFIX}| ; \
s|#!/bin/bash|#!${LOCALBASE}/bin/bash| ; \
s|LIBMESH_DIR/examples|LIBMESH_DIR/share/examples/${PORTNAME}| ; \
s|reference_elements|share/${PORTNAME}/reference_elements|'
@${REINPLACE_CMD} -i '' -e 's|libmesh_LIBTOOL ?= /usr/local/contrib/bin/libtool|libmesh_LIBTOOL ?= libtool|' \
${STAGEDIR}${DATADIR}/Make.common
.include <bsd.port.mk>