[Lunar-commits] <moonbase-other> chromium: Some adjustments here. Borrowed some hints and chromium-launcher.sh from

Dennis Veatch dennisveatch at bellsouth.net
Sat Sep 20 17:38:00 CEST 2014


commit cfbfa2eb228a9a4578bf87f50d3b53b1c03da06e
Author: Dennis Veatch <dennisveatch at bellsouth.net>
Date: Sat, 20 Sep 2014 09:19:30 -0400
URL: https://github.com/lunar-linux/moonbase-other/commit/cfbfa2eb228a9a4578bf87f50d3b53b1c03da06e

chromium: Some adjustments here. Borrowed some hints and chromium-launcher.sh from

the good folks at gentoo (hats off). The changes are mostly to accomodate the possible
use of pepperflash, there should be no issues with flash-plugin-11.
---
  web/chromium/BUILD                | +10/-1    
  web/chromium/PRE_BUILD            | +3/-0     
  web/chromium/chromium-launcher.sh | +24/-9    
  3 files changed, 37 insertions(+), 10 deletions(-)

--- a/web/chromium/BUILD
+++ b/web/chromium/BUILD
@@ -30,6 +30,7 @@
   fi &&
 
   install -m 755 $SCRIPT_DIRECTORY/chromium-launcher.sh ${CHROMIUM_HOME} &&
+  ln -sf ${CHROMIUM_HOME}/chromium-launcher.sh /usr/bin/chromium-browser &&
   ln -sf ${CHROMIUM_HOME}/chromium-launcher.sh /usr/bin/chromium &&
 
   install -Dm644 LICENSE /usr/share/licenses/chromium/LICENSE &&
@@ -41,4 +42,12 @@
 
   # theme installation
   mkdir -p /usr/share/themes/Chromium &&
-  cp -a $SOURCE_DIRECTORY/chrome/app/theme /usr/share/themes/Chromium/
+  cp -a $SOURCE_DIRECTORY/chrome/app/theme /usr/share/themes/Chromium/ &&
+
+  if [ ! -f /etc/$MODULE/chromium.default ] ; then
+      mkdir -p /etc/$MODULE &&
+      echo "# Default settings for chromium. This file is sourced by /bin/bash from" > /etc/$MODULE/chromium.default &&
+      echo "# the chromium launcher." >> /etc/$MODULE/chromium.default &&
+      echo "# Options to pass to chromium." >> /etc/$MODULE/chromium.default &&
+      echo "#CHROMIUM_FLAGS=\"\"" >> /etc/$MODULE/chromium.default
+  fi 
--- a/web/chromium/PRE_BUILD
+++ b/web/chromium/PRE_BUILD
@@ -8,6 +8,9 @@
   sedit "s:/bin/echo:/usr/bin/echo:g" build/common.gypi &&
   sedit "s:-Wno-#pragma-messages::g" third_party/opus/opus.gyp &&
 
+# When using pepperflash gets rid of; ERROR:audio_manager_base.cc(422)] Not implemented reached
+  sedit "s:NOTIMPLEMENTED();::" media/audio/audio_manager_base.cc
+
   cp -f $SCRIPT_DIRECTORY/nacl.gypi chrome/  &&
 
   echo Fixing dumb CPU optimizations please wait in patience...
--- a/web/chromium/chromium-launcher.sh
+++ b/web/chromium/chromium-launcher.sh
@@ -1,13 +1,21 @@
-#!/bin/sh
-#
-# 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.
+#!/bin/bash
+
+# Allow the user to override command-line flags, bug #357629.
+# This is based on Debian's chromium-browser package, and is intended
+# to be consistent with Debian.
+# This file taken from gentoo and adapted for use in Lunar-Linux
+for f in /etc/chromium/*; do
+    [[ -f ${f} ]] && source "${f}"
+done
+
+# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system
+# default CHROMIUM_FLAGS (from /etc/chromium/default).
+CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"}
 
 # Let the wrapped binary know that it has been run through the wrapper
-export CHROME_WRAPPER="`readlink -f "$0"`"
+export CHROME_WRAPPER=$(readlink -f "$0")
 
-PROGDIR="`dirname "$CHROME_WRAPPER"`"
+PROGDIR=${CHROME_WRAPPER%/*}
 
 case ":$PATH:" in
   *:$PROGDIR:*)
@@ -19,7 +27,14 @@ case ":$PATH:" in
     ;;
 esac
 
+if [[ ${EUID} == 0 && -O ${XDG_CONFIG_HOME:-${HOME}} ]]; then
+	# Running as root with HOME owned by root.
+	# Pass --user-data-dir to work around upstream failsafe.
+	CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-${HOME}/.config}/chromium
+		${CHROMIUM_FLAGS}"
+fi
+
 # Set the .desktop file name
-export CHROME_DESKTOP="chromium-chromium.desktop"
+export CHROME_DESKTOP="chromium-browser-chromium.desktop"
 
-exec "$PROGDIR/chrome" "$@"
+exec -a "chromium-browser" "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/lunar/plugins ${CHROMIUM_FLAGS} "$@"




More information about the Lunar-commits mailing list