From d52cb4731cca695df3d887108413796aa9803eff Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Mon, 29 May 2017 09:04:31 +0200
Subject: [PATCH] Comments on macports file

---
 macports/Portfile.in | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/macports/Portfile.in b/macports/Portfile.in
index db479377d..baab14475 100644
--- a/macports/Portfile.in
+++ b/macports/Portfile.in
@@ -15,7 +15,7 @@ categories          science
 # molfile plugins from VMD that are released with a BSD-like license
 # http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/
 license             LGPL-3 BSD
-maintainers         gmail.com:giovanni.bussi openmaintainer
+maintainers         {gmail.com:giovanni.bussi @GiovanniBussi} openmaintainer
 description         PLUMED is a plugin for molecular dynamics
 long_description    PLUMED is a plugin for molecular dynamics that can be used \
                     in combination with popular molecular dynamics codes to perform biased simulations. \
@@ -27,25 +27,30 @@ homepage            http://www.plumed.org/
 
 @_FETCH_@
 
-# This is required so that patch made with "git format-patch" work correctly
+### This is required so that patch made with "git format-patch" work correctly
 # patch.pre_args -p1
-# In case patches from github should be included to fix behavior on macports one should
-# - put patch files (as obtained with git format-patch) in files/ directory
-# - list their name here:
+### In case patches from github should be included to fix behavior on macports one should
+### - put patch files (as obtained with git format-patch) in files/ directory
+### - list their name here:
+# patchfiles file1 \
+#            file2
+### etc
 
 # Disable additional features.
-# They are then re-enabled when selecting proper variants
-# this is important for features that require an additional package to be
-# sure that even if the user has that package already installed plumed is
-# not going to use it.
-# Also avoid searching for doxygen.
+# --disable-doc:          Do not create documentation, and avoid searching for Doxygen.
+# --disable-libsearch:    Avoid searching libraries using their default names.
+#                         This forces the libraries names to be explicitly passed (e.g. "-lz").
+#                         It has the advantage that during compilation from source it does not
+#                         link packages that are not explicitely required.
+# --disable-static-patch: Avoid a number of tests that are only required when linking plumed
+#                         statically to an MD code.
+# --disable-mpi:          Do not search for MPI compiler (replaced when enabling mpi, see below)
 configure.args-append \
                --disable-doc \
                --disable-libsearch \
                --disable-static-patch \
                --disable-mpi 
 
-
 # Hardcode path for libplumedKernel.dylib.
 # This allows to patch MD codes using the --runtime option but using as
 # default kernel the installed one. In this way, MacPorts users
@@ -56,11 +61,14 @@ configure.cppflags-append "-D__PLUMED_DEFAULT_KERNEL=${prefix}/lib/libplumedKern
 compilers.choose    cc cxx
 mpi.setup
 
+# To enable mpi, replace a configure flag
 if {[mpi_variant_isset]} {
   configure.args-replace --disable-mpi --enable-mpi
 }
 
-# libraries
+# Libraries.
+# Library names are specified here to make sure that
+# only requested packages are linked.
 configure.ldflags-append -lmatheval -lxdrfile -lz -lgsl
 depends_lib-append port:libmatheval port:xdrfile port:zlib port:gsl
 
@@ -69,6 +77,7 @@ variant allmodules description {Enable all optional modules} {
   configure.args-append --enable-modules=all
 }
 
+# Link lapack/blas libraries
 pre-configure {
   # commands should be included in a pre-configure block to access tcl variables
   configure.ldflags-append ${linalglib}
-- 
GitLab