From 2022e1d26d736d858bc4f5378e4f1825e796cabe Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Wed, 12 Apr 2017 16:28:27 +0200
Subject: [PATCH] Updated portfile

The portfile shipped is identical to the one
submitted to MacPorts with the exception
of the fetching part. In particular,
useless variants have been removed
---
 macports/Portfile.in | 62 ++++++++++++--------------------------------
 1 file changed, 16 insertions(+), 46 deletions(-)

diff --git a/macports/Portfile.in b/macports/Portfile.in
index c810cde80..34c770ff5 100644
--- a/macports/Portfile.in
+++ b/macports/Portfile.in
@@ -10,8 +10,12 @@ PortGroup           debug 1.0
 version             @_VERSION_@
 revision            @_REVISION_@
 categories          science
-license             LGPL-3
-maintainers         gmail.com:giovanni.bussi
+
+# Most of the PLUMED code is L-GPL3. However, PLUMED containts
+# 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
 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. \
@@ -30,15 +34,17 @@ homepage            http://www.plumed.org/
 # - list their name here:
 
 # Disable additional features.
-# they are then re-enabled when selecting proper variants
+# 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.
 configure.args-append \
+               --disable-doc \
                --disable-libsearch \
-               --disable-molfile-plugins \
                --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
@@ -53,56 +59,20 @@ if {[mpi_variant_isset]} {
   configure.args-replace --disable-mpi --enable-mpi
 }
 
-variant matheval description {Enable libmatheval} {
-  configure.ldflags-append -lmatheval
-  depends_lib-append port:libmatheval
-}
-
-variant xdrfile description {Enable xdrfile} {
-  configure.ldflags-append -lxdrfile
-  depends_lib-append port:xdrfile
-}
-
-variant zlib description {Enable zlib} {
-  configure.ldflags-append -lz
-  depends_lib-append port:zlib
-}
+# libraries
+configure.ldflags-append -lmatheval -lxdrfile -lz -lgsl
+depends_lib-append port:libmatheval port:xdrfile port:zlib port:gsl
 
-variant gsl description {Enable gsl} {
-  configure.ldflags-append -lgsl
-  depends_lib-append port:gsl
+# This variant enables optional modules in PLUMED.
+variant allmodules description {Enable all optional modules} {
+  configure.args-append --enable-modules=all
 }
 
-variant molfile description {Enable molfile - includes some BSD code} {
-  license ${license} BSD
-  configure.args-replace --disable-molfile-plugins --enable-molfile-plugins
-}
-
-variant doc description {Also compile documentation} {
-  depends_build-append port:doxygen
-  depends_build-append port:graphviz
-  build.target all_plus_docs
-}
-
-# this is a tcl variable contains a concatenated list of modules
-# to be activated
-
-set plumed_modules reset
-
-# this will automatically create variants for each optional module
-@_MODULES_@ plumed_modules
-
 pre-configure {
   # commands should be included in a pre-configure block to access tcl variables
-  configure.args-append --enable-modules=${plumed_modules}
   configure.ldflags-append ${linalglib}
 }
 
-# Default variants include no optional modules.
-# Additionally, the link libraries that are very useful (e.g. matheval of xdrfile)
-# and quick to compile
-default_variants +matheval +xdrfile +zlib +molfile
-
 # This is required since PLUMED installation does not do it explicitly.
 # It might be removed when this will be incorporated upstream
 post-destroot {
-- 
GitLab