Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates-src > by-pkgid > 7bd852dfb0052e5fd697b7e8e3fd46c5 > files > 56

chromium-browser-stable-81.0.4044.129-1.mga7.src.rpm

#!/bin/bash
#
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Let the wrapped binary know that it has been run through the wrapper
export CHROME_WRAPPER="`readlink -f "$0"`"

PROGDIR="`dirname "$CHROME_WRAPPER"`"

case ":$PATH:" in
  *:$PROGDIR:*)
    # $PATH already contains $PROGDIR
    ;;
  *)
    # Append $PROGDIR to $PATH
    export PATH="$PATH:$PROGDIR"
    ;;
esac

# Always use our versions of ffmpeg libs.
# This also makes RPMs find the compatibly-named NSS3/NSPR symlinks.
LD_LIBRARY_PATH="$PROGDIR:$PROGDIR/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH

# Mageia addition: use PepperFlash from Google Chrome if installed:
EXTRA_ARGS=
CHROME_FLASH="/opt/google/chrome/PepperFlash/libpepflashplayer.so"
CHROME_FLASH_MANIFEST="/opt/google/chrome/PepperFlash/manifest.json"

if [ -e "$CHROME_FLASH" -a -e "$CHROME_FLASH_MANIFEST" ]; then
  # alternatives, for the record:
  # CHROME_FLASH_VERSION="$(grep -za '^LNX ' "$CHROME_FLASH" | tr , . | cut -f2 -d" ")"
  # CHROME_FLASH_VERSION="$(sed -ne 's,^.*"version".*"\(.*\)".*$,\1,p' "$CHROME_FLASH_MANIFEST")"
  CHROME_FLASH_VERSION="$(awk -F'"' '{ if ($2 == "version") { print $4; exit; } }' "$CHROME_FLASH_MANIFEST")"
  EXTRA_ARGS="$EXTRA_ARGS --ppapi-flash-path=$CHROME_FLASH --ppapi-flash-version=$CHROME_FLASH_VERSION"
fi

exec -a "$0" "$PROGDIR/chrome" $EXTRA_ARGS "$@"