Projects
Extra
vivaldi
vivaldi-stable-1.2.490.43_run.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File vivaldi-stable-1.2.490.43_run.patch of Package vivaldi (Revision 6)
Currently displaying revision
6
,
Show latest
diff -U 3 -dHrN vivaldi-stable-1.2.490.43.orig/opt/vivaldi/vivaldi vivaldi-stable-1.2.490.43/opt/vivaldi/vivaldi --- vivaldi-stable-1.2.490.43.orig/opt/vivaldi/vivaldi 2016-07-11 11:02:13.391676192 +0300 +++ vivaldi-stable-1.2.490.43/opt/vivaldi/vivaldi 2016-07-11 12:42:32.884752531 +0300 @@ -9,25 +9,25 @@ HERE="`dirname "$CHROME_WRAPPER"`" -# Check if the CPU supports SSE2. If not, try to pop up a dialog to explain the -# problem and exit. Otherwise the browser will just crash with a SIGILL. -# http://crbug.com/348761 -grep ^flags /proc/cpuinfo|grep -qs sse2 +# Check for existence of needed config file +VIVALDI_CONF_FILE="@VIVALDI_CONFIG@" +if which zenity &> /dev/null; then + MESSAGE="$(which zenity)" +elif which gmessage &> /dev/null; then + MESSAGE="$(which gmessage)" +elif which xmessage &> /dev/null; then + MESSAGE="$(which xmessage)" +else + MESSAGE="echo" +fi +test -r $VIVALDI_CONF_FILE if [ $? != 0 ]; then - SSE2_DEPRECATION_MSG="This computer cannot run Vivaldi because \ -its hardware is no longer supported." - if which zenity &> /dev/null; then - zenity --warning --text="$SSE2_DEPRECATION_MSG" - elif which gmessage &> /dev/null; then - gmessage "$SSE2_DEPRECATION_MSG" - elif which xmessage &> /dev/null; then - xmessage "$SSE2_DEPRECATION_MSG" - else - echo "$SSE2_DEPRECATION_MSG" 1>&2 - fi - exit 1 + $MESSAGE "$VIVALDI_CONF_FILE not existing." + exit 1 fi +. $VIVALDI_CONF_FILE + # We include some xdg utilities next to the binary, and we want to prefer them # over the system versions when we know the system versions are very old. We # detect whether the system xdg utilities are sufficiently new to be likely to @@ -45,20 +45,24 @@ fi # Find libffmpeg.so with additional codecs. -CHR_CODECS_CH="/usr/share/doc/chromium-codecs-ffmpeg-extra/changelog.Debian.gz" -if [ -r $CHR_CODECS_CH ]; then - CHR_CODECS_VER=$(gzip -cd $CHR_CODECS_CH | - sed -n '1s/chromium-browser (\(\([0-9]\+\.\)\{3\}\).*/\1/p') - if [ "$CHR_CODECS_VER" = "51.0.2704." ] || [ "$CHR_CODECS_VER" = "50.0.2661." ] || [ "$CHR_CODECS_VER" = "49.0.2623." ]; then - FFMPEG_LD_LIBRARY_PATH=":/usr/lib/chromium-browser/libs" +CHR_CODECS_DIR="@CODECS_DIR@" +if [ -n "$CHR_CODECS_DIR" ] && [ -d "$CHR_CODECS_DIR" ]; then + CHR_CODECS_VER="@CODECS_VER@" + if [ -n "$CHR_CODECS_VER" ]; then + if [[ "$CHR_CODECS_VER" =~ "51.0.2704" ]] || [[ "$CHR_CODECS_VER" =~ "50.0.2661" ]] || [[ "$CHR_CODECS_VER" =~ "49.0.2623" ]]; then + FFMPEG_LD_LIBRARY_PATH=":$CHR_CODECS_DIR" + fi fi +else + FFMPEG_LD_LIBRARY_PATH=":$HERE/lib" fi + # Set LD_LIBRARY_PATH to prefer our libs, excluding $HERE/lib/libffmpeg.so if # an alternative ffmpeg was found. if [[ -n "$LD_LIBRARY_PATH" ]]; then - LD_LIBRARY_PATH="$HERE$FFMPEG_LD_LIBRARY_PATH:$HERE/lib:$LD_LIBRARY_PATH" + LD_LIBRARY_PATH="$HERE$FFMPEG_LD_LIBRARY_PATH$:$LD_LIBRARY_PATH" else - LD_LIBRARY_PATH="$HERE$FFMPEG_LD_LIBRARY_PATH:$HERE/lib" + LD_LIBRARY_PATH="$HERE$FFMPEG_LD_LIBRARY_PATH" fi export LD_LIBRARY_PATH @@ -73,37 +77,41 @@ exec > >(exec cat) exec 2> >(exec cat >&2) -if [ -f "/opt/google/chrome/PepperFlash/libpepflashplayer.so" ]; then - FLASH_PATH="/opt/google/chrome/PepperFlash/libpepflashplayer.so" # google -elif [ -f "/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so" ]; then - FLASH_PATH="/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so" # debian/ubuntu -elif [ -f "/usr/lib/PepperFlash/libpepflashplayer.so" ]; then - FLASH_PATH="/usr/lib/PepperFlash/libpepflashplayer.so" # arch/slack -elif [ -f "/usr/lib/chromium/PepperFlash/libpepflashplayer.so" ]; then - FLASH_PATH="/usr/lib/chromium/PepperFlash/libpepflashplayer.so" # openSuse 32-bit -elif [ -f "/usr/lib64/chromium/PepperFlash/libpepflashplayer.so" ]; then - FLASH_PATH="/usr/lib64/chromium/PepperFlash/libpepflashplayer.so" # openSuse 64-bit -elif [ -f "/usr/lib/pepflashplugin-installer/libpepflashplayer.so" ]; then - FLASH_PATH="/usr/lib/pepflashplugin-installer/libpepflashplayer.so" # ppa:skunk/pepper-flash -elif [ -f "/usr/lib/chromium-browser/PepperFlash/libpepflashplayer.so" ]; then - FLASH_PATH="/usr/lib/chromium-browser/PepperFlash/libpepflashplayer.so" # rosa/mandriva 32-bit -elif [ -f "/usr/lib64/chromium-browser/PepperFlash/libpepflashplayer.so" ]; then - FLASH_PATH="/usr/lib64/chromium-browser/PepperFlash/libpepflashplayer.so" # rosa/mandriva 64-bit +FLASH_PATH="@PEPPER_FLASH_LIB@" +if [ -n "$FLASH_PATH" ] && [-f "$FLASH_PATH" ]; then + FLASH_PATH="$FLASH_PATH" +elif [ -f "@LIBDIR@/chromium/PepperFlash/libpepflashplayer.so" ]; then + FLASH_PATH="@LIBDIR@/chromium/PepperFlash/libpepflashplayer.so" fi if [ -f $FLASH_PATH ]; then FLASH_VERSION=`grep -m 1 -a -o "LNX [[:digit:]]\+,[[:digit:]]\+,[[:digit:]]\+,[[:digit:]]\+" $FLASH_PATH | cut -c 5- | sed -e "s/,/./g"` fi +# The setuid permission set on sandbox +if [[ "$VIVALDI_USER_FLAGS" =~ 'enable-setuid-sandbox' ]] && [[ ! "$VIVALDI_USER_FLAGS" =~ 'disable-setuid-sandbox' ]]; then + VIVALDI_USER_FLAGS=$(echo $VIVALDI_USER_FLAGS | sed 's/--enable-setuid-sandbox//') + if [[ ! -u @VIVALDI_SANDBOX_FILE@ ]]; then + if which xdg-su &> /dev/null; then + $MESSAGE "Setting the setgid permission on sandbox" + xdg-su -c "chmod u+s @VIVALDI_SANDBOX_FILE@" &> /dev/null + fi + fi +elif [[ -u @VIVALDI_SANDBOX_FILE@ ]]; then + if which xdg-su &> /dev/null; then + $MESSAGE "Removing the setgid permission on sandbox" + xdg-su -c "chmod u-s @VIVALDI_SANDBOX_FILE@" &> /dev/null + fi +fi + # Make sure that the profile directory specified in the environment, if any, # overrides the default. -if [[ -n "$CHROME_USER_DATA_DIR" ]]; then - # Note: exec -a below is a bashism. +if [[ -n "$VIVALDI_USER_DATA_DIR" ]]; then exec -a "$0" "$HERE/vivaldi-bin" \ - --user-data-dir="$CHROME_USER_DATA_DIR" \ - --ppapi-flash-path=$FLASH_PATH --ppapi-flash-version=$FLASH_VERSION \ + --user-data-dir="$VIVALDI_USER_DATA_DIR" \ + --ppapi-flash-path=$FLASH_PATH --ppapi-flash-version=$FLASH_VERSION $VIVALDI_USER_FLAGS \ "$@" else exec -a "$0" "$HERE/vivaldi"-bin \ - --ppapi-flash-path=$FLASH_PATH --ppapi-flash-version=$FLASH_VERSION \ + --ppapi-flash-path=$FLASH_PATH --ppapi-flash-version=$FLASH_VERSION $VIVALDI_USER_FLAGS \ "$@" fi
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.