Repository URL to install this package:
Version:
2.2.7 ▾
|
#!/bin/bash
echo "Checking GCC compatibility for Natron ..."
DIR=/opt/Natron2
export LD_LIBRARY_PATH="$BUNDLE_LIBRARY_PATH:$LD_LIBRARY_PATH"
# Check gcc compat
COMPAT_ARCH=`uname -m`
COMPAT_VERSION=3.4.19
if [ "$COMPAT_ARCH" = "x86_64" ]; then
COMPAT_SUFFIX=64
fi
if [ -f /usr/lib$COMPAT_SUFFIX/libstdc++.so.6 ]; then
STDC_LIB=/usr/lib$COMPAT_SUFFIX/libstdc++.so.6
elif [ -f /usr/lib/libstdc++.so.6 ]; then
STDC_LIB=/usr/lib/libstdc++.so.6
elif [ -f /usr/lib/$COMPAT_ARCH-linux-gnu/libstdc++.so.6 ]; then
STDC_LIB=/usr/lib/$COMPAT_ARCH-linux-gnu/libstdc++.so.6
elif [ -f /usr/lib/i386-linux-gnu/libstdc++.so.6 ]; then
STDC_LIB=/usr/lib/i386-linux-gnu/libstdc++.so.6
fi
if [ "$STDC_LIB" != "" ]; then
COMPAT_GCC=`$DIR/bin/strings $STDC_LIB | grep GLIBCXX_${COMPAT_VERSION}`
fi
if [ "$COMPAT_GCC" != "" ]; then
if [ -f "$DIR/lib/libstdc++.so.6" ]; then
rm -f $DIR/lib/libstdc++.so.6 || echo "Failed to remove symlink, please run as root to fix."
fi
if [ -f "$DIR/lib/libgcc_s.so.1" ]; then
rm -f $DIR/lib/libgcc_s.so.1 || echo "Failed to remove symlink, please run as root to fix."
fi
if [ -f "$DIR/lib/libgomp.so.1" ]; then
rm -f $DIR/lib/libgomp.so.1 || echo "Failed to remove symlink, please run as root to fix."
fi
else
if [ ! -f "$DIR/lib/libstdc++.so.6" ]; then
cd $DIR/lib ; ln -sf compat/libstdc++.so.6 . || echo "Failed to create symlink, please run as root to fix."
fi
if [ ! -f "$DIR/lib/libgcc_s.so.1" ]; then
cd $DIR/lib ; ln -sf compat/libgcc_s.so.1 . || echo "Failed to create symlink, please run as root to fix."
fi
if [ ! -f "$DIR/lib/libgomp.so.1" ]; then
cd $DIR/lib ; ln -sf compat/libgomp.so.1 . || echo "Failed to create symlink, please run as root to fix."
fi
fi
if [ -f /usr/bin/update-mime-database ]; then
update-mime-database /usr/share/mime
fi
if [ -f /usr/bin/update-desktop-database ]; then
update-desktop-database /usr/share/applications
elif [ -f /usr/bin/xdg-desktop-menu ]; then
xdg-desktop-menu forceupdate
fi