Projects
Extra
vivaldi
vivaldi-stable-1.3.551.30_run.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File vivaldi-stable-1.3.551.30_run.patch of Package vivaldi (Revision 13)
Currently displaying revision
13
,
Show latest
diff -U 3 -dHrN vivaldi-stable-1.3.551.30.orig/opt/vivaldi/vivaldi vivaldi-stable-1.3.551.30/opt/vivaldi/vivaldi --- vivaldi-stable-1.3.551.30.orig/opt/vivaldi/vivaldi 2016-08-13 15:47:38.220060683 +0300 +++ vivaldi-stable-1.3.551.30/opt/vivaldi/vivaldi 2016-08-13 15:59:55.127218619 +0300 @@ -7,7 +7,27 @@ # 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 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 +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 @@ -26,57 +46,18 @@ fi # Find libffmpeg.so with additional codecs. -CHR_CODECS_CL="/usr/share/doc/chromium-codecs-ffmpeg-extra/changelog.Debian.gz" -if [ -r "$CHR_CODECS_CL" ]; then - LIBFFMPEG_PATH="/usr/lib/chromium-browser/libs" - CHR_CODECS_VER=`gzip -cd "$CHR_CODECS_CL" | - sed -n '1s/^chromium-browser (\([0-9]\+\.\)\{2\}\([0-9]\+\)\.[0-9]\+-.*/\2/p'` -elif [ -r "/etc/os-release" ]; then - # Check distro, to allow distro specific tests to locate a suitable libffmpeg.so - . /etc/os-release - # os-release does not mandate ID_LIKE so set it to something (if empty), to - # avoid having an empty variable. - ID_LIKE="${ID_LIKE:-unknown}" - set_lib_dir_suf() - { - case "`uname -m`" in - x86_64) LIB_DIR_SUFFIX="64" ;; - *) LIB_DIR_SUFFIX="" ;; - esac - } - # OpenSUSE, SLES and derivatives will all have an ID_LIKE that includes "suse" - if [[ "$ID_LIKE" =~ "suse" ]]; then - set_lib_dir_suf - LIBFFMPEG_PATH="/usr/lib$LIB_DIR_SUFFIX/chromium/lib" - if [ -r "$LIBFFMPEG_PATH/libffmpeg.so" ]; then - # Query RPM database and set the version if chromium-ffmpeg is installed. - CHR_CODECS_VER=`rpm -qf "$LIBFFMPEG_PATH/libffmpeg.so" | - sed -n 's/^chromium-ffmpeg-\([0-9]\+\.\)\{2\}\([0-9]\+\)\.[0-9]\+-.*/\2/p'` - fi - # Slackware has the ID "slackware" but no ID_LIKE defined. Presumably derivatives - # might use ID_LIKE containing "slackware". - elif [ "$ID" = "slackware" ] || [[ "$ID_LIKE" =~ "slackware" ]]; then - set_lib_dir_suf - LIBFFMPEG_PATH="/usr/lib$LIB_DIR_SUFFIX/chromium/lib" - if [ -r "$LIBFFMPEG_PATH/libffmpeg.so" ]; then - # Query the package log and set the version if AlienBob's Chromium package - # is installed. - CHR_CODECS_VER=`echo /var/log/packages/chromium-*alien | - sed -n 's/.*chromium-\([0-9]\+\.\)\{2\}\([0-9]\+\)\.[0-9]\+-.*/\2/p'` - fi +CODECS_DIR="@LIBDIR@/chromium/lib" +if [[ -n "$CODECS_DIR" && -d "$CODECS_DIR" ]]; then + CODECS_VERSION="$(rpm -q --qf '%{VERSION}' chromium-ffmpeg | awk 'BEGIN{FS="."}{print $1 * 1000000 + $2 * 1000 + $3}')" + if [[ -n "$CODECS_VERSION" && "$CODECS_VERSION" -ge "48002564" ]]; then + FFMPEG_LD_LIBRARY_PATH=":$CODECS_DIR" fi fi -if [[ -n "$CHR_CODECS_VER" ]] && [ "$CHR_CODECS_VER" -ge "2564" ]; then - FFMPEG_LD_LIBRARY_PATH=":$LIBFFMPEG_PATH" -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:$HERE/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + export LD_LIBRARY_PATH export CHROME_VERSION_EXTRA="stable" @@ -90,37 +71,45 @@ 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 +PEPPER_PATH="@LIBDIR@/chromium/PepperFlash/libpepflashplayer.so" +if [[ -n "$PEPPER_PATH" && -f "$PEPPER_PATH" ]]; then + FLASH_PATH="$PEPPER_PATH" + FLASH_VERSION="$(grep -ao -m1 "LNX [,0-9]\+" $PEPPER_PATH | sed 's/[^0-9]\+//;s/,/./g')" 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"` + +# 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 $? + 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 $? + 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 +if [[ -n "$VIVALDI_DATA_DIR" ]]; then # Note: exec -a below is a bashism. 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
.