academic/scidavis: Fix building on -current.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
fourtysixandtwo 2024-04-07 12:36:05 -06:00 committed by Willy Sudiarto Raharjo
parent 2fba54a8b9
commit aaf377fe17
No known key found for this signature in database
GPG key ID: 3F617144D7238786

View file

@ -90,13 +90,15 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
PYVER=$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])')
# Set the correct python paths - code based on scidavis.spec for Fedora by Alexander Ploumistos
sed -i "s:set(PYTHON_SCRIPTDIR etc:set(PYTHON_SCRIPTDIR lib$LIBDIRSUFFIX/python3.9/site-packages/scidavis:" scidavis/CMakeLists.txt
sed -i "s:set(PYTHON_SCRIPTDIR etc:set(PYTHON_SCRIPTDIR lib$LIBDIRSUFFIX/python$PYVER/site-packages/scidavis:" scidavis/CMakeLists.txt
sed -i "s:FILES scidavisrc.py \${CMAKE_CURRENT_BINARY_DIR}/\$<CONFIG>/scidavisrc.pyc DESTINATION:FILES scidavisrc.py DESTINATION:" scidavis/CMakeLists.txt
sed -i "s:FILES scidavisrc.py \${CMAKE_CURRENT_BINARY_DIR}/scidavisrc.pyc DESTINATION:FILES scidavisrc.py DESTINATION:" scidavis/CMakeLists.txt
sed -i "s:FILES scidavisUtil.py DESTINATION share/scidavis:FILES scidavisUtil.py DESTINATION \${PYTHON_SCRIPTDIR}:" scidavis/CMakeLists.txt
sed -i "s:PYTHON_CONFIG_PATH=\"\${CMAKE_INSTALL_PREFIX}/etc\":PYTHON_CONFIG_PATH=\"/usr/lib$LIBDIRSUFFIX/python3.9/site-packages/scidavis\":" libscidavis/CMakeLists.txt
sed -i "s:PYTHON_UTIL_PATH=\"\${CMAKE_INSTALL_PREFIX}/share/scidavis\":PYTHON_UTIL_PATH=\"/usr/lib$LIBDIRSUFFIX/python3.9/site-packages/scidavis\":" libscidavis/CMakeLists.txt
sed -i "s:PYTHON_CONFIG_PATH=\"\${CMAKE_INSTALL_PREFIX}/etc\":PYTHON_CONFIG_PATH=\"/usr/lib$LIBDIRSUFFIX/python$PYVER/site-packages/scidavis\":" libscidavis/CMakeLists.txt
sed -i "s:PYTHON_UTIL_PATH=\"\${CMAKE_INSTALL_PREFIX}/share/scidavis\":PYTHON_UTIL_PATH=\"/usr/lib$LIBDIRSUFFIX/python$PYVER/site-packages/scidavis\":" libscidavis/CMakeLists.txt
export PYTHON=python3