Skip to content
Snippets Groups Projects
Commit 93d4d629 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Improved macports file

List of modules used in the Portfile is now generated automatically
to better deal with user contributed modules. Variants are called
mod_xxx
where xxx is the module name.

In addition, a variant +allmodules has been added to enable all modules.
This variant is used in the travis file to make sure all modules are tested.

I am not sure it is worthwhile to also automatize other variants, so I think
this closes #193
parent ae8653ce
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ matrix:
# osx serial macports debug variant
- os: osx
osx_image: xcode7.3
env: PLUMED_MACPORTS="plumed +crystallization +manyrestraints +adjmat"
env: PLUMED_MACPORTS="plumed +allmodules"
# I don't put any mpi variant with macports since it takes too long to compile
## This command can be used to allow failures:
## allow_failures:
......
......@@ -93,24 +93,9 @@ variant doc description {Also compile documentation} {
set plumed_modules reset
variant crystallization description {Enable crystallization module} {
set plumed_modules ${plumed_modules}+crystallization
}
variant manyrestraints description {Enable manyrestraints module} {
set plumed_modules ${plumed_modules}+manyrestraints
}
variant adjmat description {Enable adjmat module} {
set plumed_modules ${plumed_modules}+adjmat
}
# this will automatically create variants for each optional module
@_MODULES_@ plumed_modules
#### I leave this out momentarily since it has problems
# variant imd description {Enable imd module - includes some proprietary code} {
# license ${license} Restrictive
# set plumed_modules ${plumed_modules}+imd
# }
pre-configure {
# commands should be included in a pre-configure block to access tcl variables
configure.args-append --enable-modules=${plumed_modules}
......
......@@ -2,11 +2,6 @@
# This script generates a Portfile in science/plumed
# Currently the portfile is aimed at testing the currect git hash
# TODO:
# - Analyze configure.ac to generate the list of variants
# - Allow for a proper release port.
# This would require a portfile that is based on a tag (e.g. v2.3.0),
# optionally including patches, that can be then uploaded to macports
prefix=
if git describe --exact-match --tags HEAD 2>/dev/null 1>/dev/null
......@@ -31,6 +26,11 @@ fi
mkdir -p science/plumed
modules=$(
grep default-off ../src/*/module.type | sed "s|.*/src/||" | sed "s|/.*||" | awk '{printf("%s ",$1)}'
)
cat Portfile.in |
sed "
s/@_VERSION_@/$version/
......@@ -43,6 +43,23 @@ sed "
# git.branch v${version}
print "git.branch '$prefix'${version}"
} else print
}' | awk -v modules="$modules" '{
if($1=="@_MODULES_@"){
var=$2
split(modules,list);
for(mod in list){
print "variant mod_"list[mod]" description {Enable "list[mod]" module} {"
print " set "var" ${"var"}+"list[mod]
print "}"
print ""
}
print "variant allmodules description {Enable all optional modules} {"
for(mod in list){
print " set "var" ${"var"}+"list[mod]
}
print "}"
print ""
} else print
}' > science/plumed/Portfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment