Projects
Extra
vivaldi
vivaldi-1.4.589.41_run.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File vivaldi-1.4.589.41_run.patch of Package vivaldi (Revision 14)
Currently displaying revision
14
,
Show latest
diff -ruN vivaldi-stable-1.4.589.41.orig/opt/vivaldi/vivaldi vivaldi-stable-1.4.589.41/opt/vivaldi/vivaldi --- vivaldi-stable-1.4.589.41.orig/opt/vivaldi/vivaldi 2016-11-08 07:09:00.818546199 +0300 +++ vivaldi-stable-1.4.589.41/opt/vivaldi/vivaldi 2016-11-08 07:55:54.000000000 +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,12 +71,45 @@ exec > >(exec cat) exec 2> >(exec cat >&2) +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 + +# 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" "$@" + --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 "$@" + exec -a "$0" "$HERE/vivaldi"-bin \ + --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
.