Projects
Extra
vivaldi
vivaldi-2.0.1309.29_launcher.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File vivaldi-2.0.1309.29_launcher.patch of Package vivaldi (Revision 53)
Currently displaying revision
53
,
Show latest
--- opt/vivaldi/vivaldi.orig 2018-09-25 13:14:36.000000000 +0200 +++ opt/vivaldi/vivaldi 2018-09-27 23:15:39.923291815 +0200 @@ -9,6 +9,8 @@ HERE="`dirname "$CHROME_WRAPPER"`" +. @VIVALDI_CONFIG@ + # 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 @@ -26,60 +28,19 @@ fi # Find libffmpeg.so with additional codecs. -checkffmpeg () { - if [ "$VIVALDI_FFMPEG_FOUND" = "NO" ]; then - if [[ -n "$2" ]] && [ -e "$2" ] || [[ -z "$2" ]]; then - # Chromium's FFMpeg version N-91124-g1d669bcae9 is the oldest known working version - # chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h - if [ -r "$1" ]; then - if [[ `grep -aom1 'FFmpeg version N-[0-9]\+-' "$1" | cut -f2 -d-` -ge "91124" ]]; then - # Check the dependencies are satisfied as the user may have obtained this from - # another distro - if ! LANGUAGE=en ldd "$1" 2>&1 | grep -qm1 'not \(a dynamic executable\|found\)'; then - if [[ -n "$LD_PRELOAD" ]]; then - export LD_PRELOAD="$LD_PRELOAD:$1" - else - export LD_PRELOAD="$1" - fi - export VIVALDI_FFMPEG_FOUND=YES - fi - fi - fi - fi +FFMPEG_LIB="$(rpm -ql @PKG_FFMPEG@ | grep 'ffmpeg.so')" +if [[ -n "$FFMPEG_LIB" && -e "$FFMPEG_LIB" ]]; then + FFMPEG_VERSION="$(grep -aom1 'FFmpeg version N-[0-9]\+-' "$FFMPEG_LIB" | cut -f2 -d-)" + if [[ -n "$FFMPEG_VERSION" && "$FFMPEG_VERSION" -ge "82746" ]]; then + FFMPEG_LD_LIBRARY_PATH=":${FFMPEG_LIB%/*}" fi -} - -# Account for Debian multiarch directories -case "`uname -m`" in - x86_64) DEBARCH="x86_64-linux-gnu" ;; - i?86) DEBARCH="i386-linux-gnu" ;; -esac - -# Check for libs in preferred order. -# Where possible, use other files/directories to confirm it's the correct variant. -VIVALDI_FFMPEG_FOUND=NO -checkffmpeg '/usr/lib/chromium-browser/libffmpeg.so' '/usr/share/doc/chromium-codecs-ffmpeg-extra' -checkffmpeg "/usr/lib/$DEBARCH/oxide-qt/libffmpeg.so" '/usr/share/doc/oxideqt-codecs-extra' -checkffmpeg '/usr/lib64/chromium-ffmpeg-extra/libffmpeg.so' '/usr/share/doc/packages/chromium-ffmpeg-extra' - -# Check if the user has manually placed suitable libs. -checkffmpeg "$HOME/.local/lib/vivaldi/libffmpeg.so" -checkffmpeg "$HERE/libffmpeg.so" - -# Warn if proprietary media is not available -if [ "$VIVALDI_FFMPEG_FOUND" = "NO" ]; then -cat <<PMWARN >&2 - -No suitable library for HTML5 MP4 (H.264/AAC) was found, -therefore only open codecs will play. - -For assistance on how to enable proprietary media, visit: - -https://help.vivaldi.com/article/html5-mp4-h-264-aac-support-under-linux/ - -PMWARN fi +# Set LD_LIBRARY_PATH to prefer our libs, excluding $HERE/lib/libffmpeg.so if +# an alternative ffmpeg was found. +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" # We don't want bug-buddy intercepting our crashes. http://crbug.com/24120 @@ -91,5 +52,42 @@ exec > >(exec cat) exec 2> >(exec cat >&2) -# Note: exec -a below is a bashism. -exec -a "$0" "$HERE/vivaldi"-bin "$@" +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 + ┆ echo "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 + echo "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}" + +if [[ -n "$VIVALDI_DATA_DIR" ]]; then + exec -a "$0" "$HERE/vivaldi-bin" \ + --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 $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
.