Projects
Extra
vivaldi
vivaldi-1.6.689.46_launcher.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File vivaldi-1.6.689.46_launcher.patch of Package vivaldi (Revision 20)
Currently displaying revision
20
,
Show latest
diff -ruN vivaldi-stable-1.6.689.46.orig/opt/vivaldi/vivaldi vivaldi-stable-1.6.689.46/opt/vivaldi/vivaldi --- vivaldi-stable-1.6.689.46.orig/opt/vivaldi/vivaldi 2016-12-24 23:30:24.740249628 +0300 +++ vivaldi-stable-1.6.689.46/opt/vivaldi/vivaldi 2016-12-24 23:53:05.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,65 +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 - if [ -r "/usr/lib/chromium-browser/libs/libffmpeg.so" ]; then - LIBFFMPEG_PATH="/usr/lib/chromium-browser/libs" - elif [ -r "/usr/lib/chromium-browser/libffmpeg.so" ]; then - LIBFFMPEG_PATH="/usr/lib/chromium-browser" - fi - if [[ -n "$LIBFFMPEG_PATH" ]]; then - CHR_CODECS_VER=`gzip -cd "$CHR_CODECS_CL" | - sed -n '1s/^chromium-browser (\([0-9]\+\.\)\{2\}\([0-9]\+\)\.[0-9]\+-.*/\2/p'` - fi -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 - # chromium-ffmpeg recently changed the path for libffmpeg.so, so we need to - # check both locations - if [ -r "/usr/lib$LIB_DIR_SUFFIX/chromium/libffmpeg.so" ]; then - LIBFFMPEG_PATH=/usr/lib$LIB_DIR_SUFFIX/chromium - elif [ -r "/usr/lib$LIB_DIR_SUFFIX/chromium/lib/libffmpeg.so" ]; then - LIBFFMPEG_PATH=/usr/lib$LIB_DIR_SUFFIX/chromium/lib - fi - if [[ -n "$LIBFFMPEG_PATH" ]]; 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 - fi -fi -if [[ -n "$CHR_CODECS_VER" ]] && [ "$CHR_CODECS_VER" -ge "2564" ]; then - # Seperate libffmpeg.so from the rest of the libs, as we do not want to prefer - # the others to our own. - VIVALDI_LOCAL_LIBS="$HOME/.local/lib/vivaldi" - if [ ! -r "$VIVALDI_LOCAL_LIBS/libffmpeg.so" ]; then - mkdir -p "$VIVALDI_LOCAL_LIBS" - ln -fs "$LIBFFMPEG_PATH/libffmpeg.so" "$VIVALDI_LOCAL_LIBS/libffmpeg.so" +CODECS_DIR="$(rpm -ql @PKG_FFMPEG@ | grep -m1 "\.so" | xargs dirname)" +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 - FFMPEG_LD_LIBRARY_PATH=":$VIVALDI_LOCAL_LIBS" 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" @@ -98,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
.