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 9)
Currently displaying revision
9
,
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-18 01:10:41.000000000 +0300 +++ vivaldi-stable-1.2.490.43/opt/vivaldi/vivaldi 2016-07-19 09:16:37.172767119 +0300 @@ -7,27 +7,28 @@ # Let the wrapped binary know that it has been run through the wrapper. export CHROME_WRAPPER="`readlink -f "$0"`" -HERE="`dirname "$CHROME_WRAPPER"`" +HERE="${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 -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 +# Check for existence of needed config file +VIVALDI_CONF_FILE="@VIVALDI_CONFIG@" +if which zenity &> /dev/null; then + xMESSAGE="zenity" +elif which gmessage &> /dev/null; then + xMESSAGE="gmessage" +elif which xmessage &> /dev/null; then + xMESSAGE="xmessage" +else + xMESSAGE="echo" +fi +if [[ -r "$VIVALDI_CONF_FILE" ]]; then + if [ $? != 0 ]; then + $xMESSAGE "$VIVALDI_CONF_FILE not existing." + exit 1 fi - 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,21 +46,20 @@ 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" +CODECS_DIR="@CODECS_DIR@" +if [[ -n "$CODECS_DIR" && -d "$CODECS_DIR" ]]; then + CODECS_VER="@CODECS_VER@" + if [[ -n "$CODECS_VER" && "$CODECS_VER" -ge "48002564" ]]; then + FFMPEG_LD_LIBRARY_PATH=":$CODECS_DIR" 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" -else - LD_LIBRARY_PATH="$HERE$FFMPEG_LD_LIBRARY_PATH:$HERE/lib" -fi +LD_LIBRARY_PATH="$HERE$FFMPEG_LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + export LD_LIBRARY_PATH export CHROME_VERSION_EXTRA="stable" @@ -73,37 +73,44 @@ 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 -fi -if [ -f $FLASH_PATH ]; then +PEPPER_PATH="@LIBDIR@/chromium/PepperFlash/libpepflashplayer.so" +if [[ -n "$PEPPER_PATH" && -f "$PEPPER_PATH" ]]; then + FLASH_PATH="$PEPPER_PATH" 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 +VIVALDI_SANDBOX_FILE="$HERE/@VIVALDI_SANDBOX_FILE@" +VIVALDI_FLAGS="${VIVALDI_USER_FLAGS:-$VIVALDI_FLAGS}" +if which xdg-su &> /dev/null; then + if [[ "$VIVALDI_FLAGS" =~ 'disable-setuid-sandbox' || "$@" =~ 'disable-setuid-sandbox' ]]; then + if [[ -u "$VIVALDI_SANDBOX_FILE" ]]; then + $xMESSAGE "Removing the setuid permission on sandbox" + xdg-su -c "chmod u-s $VIVALDI_SANDBOX_FILE" &> /dev/null || exit 1 + fi + elif [[ ! -u "$VIVALDI_SANDBOX_FILE" ]]; then + $xMESSAGE "Setting the setuid permission on sandbox" + xdg-su -c "chmod u+s $VIVALDI_SANDBOX_FILE" &> /dev/null || exit 1 + fi +fi + +VIVALDI_FLAGS="${VIVALDI_FLAGS//--disable-setuid-sandbox/}" +if [[ ! -u "$VIVALDI_SANDBOX_FILE" ]]; then + VIVALDI_FLAGS="$VIVALDI_FLAGS --disable-setuid-sandbox" +fi + +export VIVALDI_FLAGS="$VIVALDI_FLAGS" +export VIVALDI_DATA_DIR="${VIVALDI_USER_DATA_DIR:-$VIVALDI_DATA_DIR}" + # 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_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_DATA_DIR" \ + --ppapi-flash-path=$FLASH_PATH --ppapi-flash-version=$FLASH_VERSION $VIVALDI_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_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
.