Update build_visit for building pyside on systems w/o OpenGL.
@@ -180,6 +180,50 @@ EOF
return 0
}
+function apply_pyside_5142_mesagl_patch
+{
+ info "Patching Pyside2 5.14.2 for mesagl"
+ patch -p0 << \EOF
+diff -c ./sources/pyside2/cmake/Macros/PySideModules.cmake.orig ./sources/pyside2/cmake/Macros/PySideModules.cmake
+*** ./sources/pyside2/cmake/Macros/PySideModules.cmake.orig 2021-03-22 18:05:51.200000000 +0000
+--- ./sources/pyside2/cmake/Macros/PySideModules.cmake 2021-03-22 18:05:02.630000000 +0000
+***************
+*** 91,97 ****
+ list(REMOVE_DUPLICATES total_type_system_files)
+
+ # Contains include directories to pass to shiboken's preprocessor.
+! set(shiboken_include_dirs ${pyside2_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR})
+ set(shiboken_framework_include_dirs_option "")
+ if(CMAKE_HOST_APPLE)
+ set(shiboken_framework_include_dirs "${QT_FRAMEWORK_INCLUDE_DIR}")
+--- 91,97 ----
+ list(REMOVE_DUPLICATES total_type_system_files)
+
+ # Contains include directories to pass to shiboken's preprocessor.
+! set(shiboken_include_dirs ${pyside2_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}${PATH_SEP}${VISITDIR}/mesagl/${MESAGL_VERSION}/${VISITARCH}/include)
+ set(shiboken_framework_include_dirs_option "")
+ if(CMAKE_HOST_APPLE)
+ set(shiboken_framework_include_dirs "${QT_FRAMEWORK_INCLUDE_DIR}")
+EOF
+ if [[ $? != 0 ]] ; then
+ warn "Pyside2 mesagl patch failed."
+ return 1
+ fi
+
+ ##
+ ## I couldn't get the bash variables to expand in the patch, so I
+ ## did it with sed after the fact. The first sed command contains
+ ## bash magic since VISITDIR contains imbedded slashes. The link
+ ## that explains the magic is at:
+ ## https://stackoverflow.com/questions/27787536/how-to-pass-a-variable-containing-slashes-to-sed/27787551
+ ##
+ sed -i -e "s/\${VISITDIR}/${VISITDIR//\//\\/}/" ./sources/pyside2/cmake/Macros/PySideModules.cmake
+ sed -i -e "s/\${MESAGL_VERSION}/${MESAGL_VERSION}/" ./sources/pyside2/cmake/Macros/PySideModules.cmake
+ sed -i -e "s/\${VISITARCH}/${VISITARCH}/" ./sources/pyside2/cmake/Macros/PySideModules.cmake
+
+ return 0
+}
+
function apply_pyside_patch
{
if [[ ${PYSIDE_VERSION} == 5.14.2 ]] ; then
@@ -187,6 +231,15 @@ function apply_pyside_patch
if [[ $? != 0 ]] ; then
return 1
fi
+
+ if [[ "$DO_MESAGL" == "yes" ]] ; then
+ if [[ "$OPSYS" == "Linux" ]]; then
+ apply_pyside_5142_mesagl_patch
+ if [[ $? != 0 ]] ; then
+ return 1
+ fi
+ fi
+ fi
fi
return 0
