Skip to content

Commit

Permalink
[tools] Add metis relocation in post install fixup (#4767)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpaul authored Jun 6, 2024
1 parent 954fcc4 commit 3301ccc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
26 changes: 25 additions & 1 deletion tools/postinstall-fixup/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,28 @@ function clean_default_plugins()
disabled_plugins=$disabled_plugins'\|'$plugin
done
grep -v $disabled_plugins "$1/plugin_list.conf.default" >> "$1/plugin_list.conf"
}
}

function move_metis()
{
INSTALL_DIR=$1

cd $INSTALL_DIR
echo "Starting metis relocation..."
if [[ "$(uname)" != "Darwin" && "$(uname)" != "Linux" ]]; then
echo " - moving $(find ~+ -type f -name "metis.dll" | head -n 1) into $INSTALL_DIR/bin/"
mv $(find ~+ -type f -name "metis.dll" | head -n 1) $INSTALL_DIR/bin/ || true
echo " - moving $(find ~+ -type f -name "metis.lib" | head -n 1) into $INSTALL_DIR/lib/"
mv $(find ~+ -type f -name "metis.lib" | head -n 1) $INSTALL_DIR/lib/ || true
elif [[ "$(uname)" == "Darwin" ]]; then
echo " - moving $( find ~+ -type d -name "metis.framework" | head -n 1) into $INSTALL_DIR/lib/"
mv $( find ~+ -type d -name "metis.framework" | head -n 1 ) $INSTALL_DIR/lib/
else
echo " - moving $( find ~+ -type f -name "libmetis*" | head -n 1) into $INSTALL_DIR/lib/"
mv $( find ~+ -type f -name "libmetis*" | head -n 1) $INSTALL_DIR/lib/
fi
echo " - moving $(find ~+ -type d -name "metis" | grep lib/cmake/metis | head -n 1) into $INSTALL_DIR/lib/cmake/"
mv $(find ~+ -type d -name "metis" | grep lib/cmake/metis | head -n 1) $INSTALL_DIR/lib/cmake/ || true
echo " - moving $(find ~+ -type f -name "metis.h" | head -n 1) into $INSTALL_DIR/include/"
mv $(find ~+ -type f -name "metis.h" | head -n 1) $INSTALL_DIR/include/ || true
}
1 change: 1 addition & 0 deletions tools/postinstall-fixup/linux-postinstall-fixup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ for deps_file in postinstall_deps_SOFA.tmp postinstall_deps_plugin_*.tmp; do
done
done

move_metis "$INSTALL_DIR"

# Add QtWebEngine dependencies
if [ -e "$INSTALL_DIR/lib/libQt5WebEngineCore.so.5" ] && [ -d "$QT_LIBEXEC_DIR" ] && [ -d "$QT_WEBENGINE_DATA_DIR" ]; then
Expand Down
2 changes: 2 additions & 0 deletions tools/postinstall-fixup/macos-postinstall-fixup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ elif [ -d "$QT_DATA_DIR" ]; then
cp -Rf $QT_DATA_DIR/plugins/styles $INSTALL_DIR/bin
fi

move_metis "$INSTALL_DIR"

echo "Fixing up libs manually ..."

check-all-deps() {
Expand Down
2 changes: 2 additions & 0 deletions tools/postinstall-fixup/windows-postinstall-fixup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ echo "INSTALL_DIR_BIN = $INSTALL_DIR_BIN"
source $SCRIPT_DIR/common.sh
clean_default_plugins "$INSTALL_DIR_BIN"

move_metis "$INSTALL_DIR"

# Copy all plugin libs in install/bin to make them easily findable
cd "$INSTALL_DIR" && find -name "*.dll" -path "*/plugins/*" | while read lib; do
cp "$lib" "$INSTALL_DIR_BIN"
Expand Down

0 comments on commit 3301ccc

Please sign in to comment.