Skip to content

Commit

Permalink
Synchronize patch for GROMACS CMakeLists with upstream version
Browse files Browse the repository at this point in the history
Also ignore errors when patchiing CMake recipes
  • Loading branch information
giacomofiorin committed Oct 1, 2024
1 parent a22853a commit a072165
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
6 changes: 3 additions & 3 deletions gromacs/CMakeLists.txt.diff
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70b0369bed..cccfe2aa1b 100644
index 3681e50c8c..108c35e8f5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -678,6 +678,8 @@ include(gmxManageLmfit)
@@ -684,6 +684,8 @@ include(gmxManageLmfit)

include(gmxManageMuparser)

+include(gmxManageLepton)
+
include(gmxManageColvars)

##################################################
include(gmxManagePlumed)
28 changes: 13 additions & 15 deletions update-colvars-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -619,14 +619,7 @@ then
target_folder=${target}/src/external/colvars
patch_opts="-p1 --forward -s"

echo ""
if [ -d ${target_folder} ]
then
echo "${target} source tree seems to have already been patched."
echo "Updating to the current Colvars sources."
else
mkdir ${target_folder}
fi
mkdir -p ${target_folder}

# Copy library files and proxy files to the "src/external/colvars" folder
for src in ${source}/src/*.h ${source}/src/*.cpp
Expand All @@ -638,14 +631,19 @@ then

# Patch CMake build recipe when applicable
if [ -s ${source}/gromacs/gromacs-mdmodules/gmxManageColvars.cmake.diff ] ; then
patch -p1 -N -d ${target} < ${source}/gromacs/gromacs-mdmodules/gmxManageColvars.cmake.diff
patch ${patch_opts} -d ${target} < ${source}/gromacs/gromacs-mdmodules/gmxManageColvars.cmake.diff || true
fi
if [ -s ${source}/gromacs/gromacs-mdmodules/CMakeLists1.txt.diff ] ; then
patch -p1 -N -d ${target} < ${source}/gromacs/gromacs-mdmodules/CMakeLists1.txt.diff
if [ -s ${source}/gromacs/gromacs-mdmodules/CMakeLists.txt.diff ] ; then
patch ${patch_opts} -d ${target} < ${source}/gromacs/gromacs-mdmodules/CMakeLists.txt.diff || true
fi
if [ -s ${source}/gromacs/gromacs-mdmodules/CMakeLists2.txt.diff ] ; then
patch -p1 -N -d ${target} < ${source}/gromacs/gromacs-mdmodules/CMakeLists2.txt.diff
if [ -s ${source}/gromacs/CMakeLists.txt.diff ] ; then
patch ${patch_opts} -d ${target} < ${source}/gromacs/CMakeLists.txt.diff || true
fi

if [ -s ${source}/gromacs/cmake/gmxManageColvars.cmake ] ; then
condcopy ${source}/gromacs/cmake/gmxManageColvars.cmake "${target}/cmake/gmxManageColvars.cmake"
fi

if [ -s ${source}/gromacs/cmake/gmxManageLepton.cmake ] ; then
condcopy ${source}/gromacs/cmake/gmxManageLepton.cmake "${target}/cmake/gmxManageLepton.cmake"
fi
Expand Down Expand Up @@ -678,8 +676,8 @@ then
echo ""

# Apply patch for Gromacs files
if [ -f ${source}/gromacs/gromacs-mdmodules.patch ] ; then
patch ${patch_opts} -d ${target} < ${source}/gromacs/gromacs-mdmodules.patch
if [ -s ${source}/gromacs/gromacs-mdmodules.patch ] ; then
patch ${patch_opts} -d ${target} < ${source}/gromacs/gromacs-mdmodules.patch || true
fi
ret_val=$?
if [ $ret_val -ne 0 ]
Expand Down

0 comments on commit a072165

Please sign in to comment.