From nobody@FreeBSD.org  Sat Dec  4 00:19:20 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9AFB7106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  4 Dec 2010 00:19:20 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 6E3D98FC1A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  4 Dec 2010 00:19:20 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id oB40JKNe035369
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 4 Dec 2010 00:19:20 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id oB40JKfx035368;
	Sat, 4 Dec 2010 00:19:20 GMT
	(envelope-from nobody)
Message-Id: <201012040019.oB40JKfx035368@red.freebsd.org>
Date: Sat, 4 Dec 2010 00:19:20 GMT
From: Ruben <chromium@hybridsource.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: www/chromium add support for non-SSE2 and for removing explicit gconf dependency
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         152816
>Category:       ports
>Synopsis:       www/chromium add support for non-SSE2 and for removing explicit gconf dependency
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rene
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 04 00:20:08 UTC 2010
>Closed-Date:    Sun Dec 05 10:10:33 UTC 2010
>Last-Modified:  Sun Dec  5 10:20:13 UTC 2010
>Originator:     Ruben
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
>Description:
Some people reported problems building on older architectures that don't have SSE2, so I've added an option to take that out, plus I backported another patch from trunk that takes out the gconf2 dependency, though it still depends on dconf through libgnome-keyring.  I tested the gconf patch in a jail and it builds and runs fine.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ru chromium.orig/Makefile chromium/Makefile
--- chromium.orig/Makefile	2010-11-14 13:12:19.000000000 -0800
+++ chromium/Makefile	2010-12-01 17:45:52.000000000 -0800
@@ -43,7 +43,7 @@
 USE_GMAKE=	yes
 MAN1=		chrome.1
 USE_XORG=	scrnsaverproto
-USE_GNOME=	glib20 gtk20 gconf2 libxslt
+USE_GNOME=	glib20 gtk20 dconf libxslt
 LICENSE_COMB=	multi
 LICENSE=	BSD LGPL21 MPL
 
@@ -63,7 +63,9 @@
 #GYP_DEFINES+=	use_system_zlib=1
 
 OPTIONS=	CODECS		"Compile and enable patented codecs like H.264" off \
-		VPX		"Use system libvpx for VP8 codec" on
+		GCONF		"Use gconf2 for preferences"		on \
+		SSE2		"Use SSE2, disable this for PIII or older" on \
+		VPX		"Use system libvpx for VP8 codec"	on
 
 .include <bsd.port.pre.mk>
 
@@ -77,6 +79,16 @@
 GYP_DEFINES+=	ffmpeg_branding=Chromium
 .endif
 
+.if defined(WITH_GCONF)
+USE_GNOME+=	gconf2
+.else
+GYP_DEFINES+=	use_gconf=0
+.endif
+
+.if defined(WITHOUT_SSE2)
+GYP_DEFINES+=	disable_sse2=1
+.endif
+
 .if defined(WITH_VPX)
 LIB_DEPENDS+=	vpx:${PORTSDIR}/multimedia/libvpx
 GYP_DEFINES+=	use_system_vpx=1
diff -ru chromium.orig/files/patch-chromium chromium/files/patch-chromium
--- chromium.orig/files/patch-chromium	2010-11-13 01:22:45.000000000 -0800
+++ chromium/files/patch-chromium	2010-12-01 16:26:27.000000000 -0800
@@ -509,7 +509,16 @@
  
      # Set Thumb compilation flags.
      'arm_thumb%': 0,
-@@ -285,7 +285,7 @@
+@@ -279,13 +279,16 @@
+     # whether to compile in the sources for the GPU plugin / process.
+     'enable_gpu%': 1,
+ 
++    # Use GConf, the GNOME configuration system.
++    'use_gconf%': 1,
++
+     'conditions': [
+       ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
+         # This will set gcc_version to XY if you are running gcc X.Y.*.
          # This is used to tweak build flags for gcc 4.4.
          'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
          # Figure out the python architecture to decide if we build pyauto.
@@ -568,6 +577,22 @@
 index 876579a..23d1c6c 100644
 --- build/linux/system.gyp
 +++ build/linux/system.gyp
+@@ -188,11 +188,14 @@
+       'target_name': 'gconf',
+       'type': 'settings',
+       'conditions': [
+-        ['_toolset=="target"', {
++        ['use_gconf==1 and _toolset=="target"', {
+           'direct_dependent_settings': {
+             'cflags': [
+               '<!@(<(pkg-config) --cflags gconf-2.0)',
+             ],
++            'defines': [
++              'USE_GCONF',
++            ],
+           },
+           'link_settings': {
+             'ldflags': [
 @@ -283,7 +283,6 @@
              }, {
                'link_settings': {
@@ -1174,6 +1199,104 @@
    void OnGetViewXID(gfx::NativeViewId id, unsigned long* xid);
  #endif
  
+diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc
+index dea24e6..77adb09 100644
+--- chrome/browser/gtk/browser_titlebar.cc
++++ chrome/browser/gtk/browser_titlebar.cc
+@@ -23,7 +23,9 @@
+ #include "chrome/browser/gtk/accelerators_gtk.h"
+ #include "chrome/browser/gtk/browser_window_gtk.h"
+ #include "chrome/browser/gtk/custom_button.h"
++#if defined(USE_GCONF)
+ #include "chrome/browser/gtk/gconf_titlebar_listener.h"
++#endif
+ #include "chrome/browser/gtk/gtk_theme_provider.h"
+ #include "chrome/browser/gtk/gtk_util.h"
+ #include "chrome/browser/gtk/menu_gtk.h"
+@@ -193,6 +195,9 @@ void PopupPageMenuModel::Build() {
+ ////////////////////////////////////////////////////////////////////////////////
+ // BrowserTitlebar
+ 
++// static
++const char BrowserTitlebar::kDefaultButtonString[] = ":minimize,maximize,close";
++
+ BrowserTitlebar::BrowserTitlebar(BrowserWindowGtk* browser_window,
+                                  GtkWindow* window)
+     : browser_window_(browser_window),
+@@ -299,9 +304,13 @@ void BrowserTitlebar::Init() {
+   gtk_box_pack_end(GTK_BOX(container_hbox_), titlebar_right_buttons_vbox_,
+                    FALSE, FALSE, 0);
+ 
++#if defined(USE_GCONF)
+   // Either read the gconf database and register for updates (on GNOME), or use
+   // the default value (anywhere else).
+   Singleton<GConfTitlebarListener>()->SetTitlebarButtons(this);
++#else
++  BuildButtons(kDefaultButtonString);
++#endif
+ 
+   // We use an alignment to control the titlebar height.
+   titlebar_alignment_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
+@@ -363,7 +372,9 @@ void BrowserTitlebar::Init() {
+ 
+ BrowserTitlebar::~BrowserTitlebar() {
+   ActiveWindowWatcherX::RemoveObserver(this);
++#if defined(USE_GCONF)
+   Singleton<GConfTitlebarListener>()->RemoveObserver(this);
++#endif
+ }
+ 
+ void BrowserTitlebar::BuildButtons(const std::string& button_string) {
+diff --git a/chrome/browser/gtk/browser_titlebar.h b/chrome/browser/gtk/browser_titlebar.h
+index c6da855..5cd30e6 100644
+--- chrome/browser/gtk/browser_titlebar.h
++++ chrome/browser/gtk/browser_titlebar.h
+@@ -31,6 +31,10 @@ class BrowserTitlebar : public NotificationObserver,
+                         public ActiveWindowWatcherX::Observer,
+                         public menus::SimpleMenuModel::Delegate {
+  public:
++  // A default button order string for when we aren't asking gconf for the
++  // metacity configuration.
++  static const char kDefaultButtonString[];
++
+   BrowserTitlebar(BrowserWindowGtk* browser_window, GtkWindow* window);
+   virtual ~BrowserTitlebar();
+ 
+diff --git a/chrome/browser/gtk/gconf_titlebar_listener.cc b/chrome/browser/gtk/gconf_titlebar_listener.cc
+index 81b5ef0..237332f 100644
+--- chrome/browser/gtk/gconf_titlebar_listener.cc
++++ chrome/browser/gtk/gconf_titlebar_listener.cc
+@@ -13,10 +13,6 @@
+ 
+ namespace {
+ 
+-// A default button order string for when we aren't asking gconf for the
+-// metacity configuration.
+-const char* kDefaultButtonPlacement = ":minimize,maximize,close";
+-
+ // The GConf key we read for the button placement string. Even through the key
+ // has "metacity" in it, it's shared between metacity and compiz.
+ const char* kButtonLayoutKey = "/apps/metacity/general/button_layout";
+@@ -34,7 +30,7 @@ void GConfTitlebarListener::SetTitlebarButtons(BrowserTitlebar* titlebar) {
+     titlebar->BuildButtons(current_value_);
+     titlebars_.insert(titlebar);
+   } else {
+-    titlebar->BuildButtons(kDefaultButtonPlacement);
++    titlebar->BuildButtons(BrowserTitlebar::kDefaultButtonString);
+   }
+ }
+ 
+@@ -113,8 +109,8 @@ bool GConfTitlebarListener::HandleGError(GError* error, const char* key) {
+ void GConfTitlebarListener::ParseAndStoreValue(GConfValue* gconf_value) {
+   if (gconf_value) {
+     const char* value = gconf_value_get_string(gconf_value);
+-    current_value_ = value ? value : kDefaultButtonPlacement;
++    current_value_ = value ? value : BrowserTitlebar::kDefaultButtonString;
+   } else {
+-    current_value_ = kDefaultButtonPlacement;
++    current_value_ = BrowserTitlebar::kDefaultButtonString;
+   }
+ }
 diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc
 index 5c38d97..29a73d7 100644
 --- chrome/browser/memory_details.cc
@@ -2668,7 +2791,18 @@
 index 05a38da..b64be85 100644
 --- chrome/chrome_browser.gypi
 +++ chrome/chrome_browser.gypi
-@@ -2862,7 +2862,7 @@
+@@ -2883,12 +2883,18 @@
+             ],
+           },
+         }],
++        ['use_gconf==0', {
++          'sources!': [
++            'browser/gtk/gconf_titlebar_listener.cc',
++            'browser/gtk/gconf_titlebar_listener.h',
++          ],
++        }],
+         ['touchui==0', {
+           'sources!': [
              # Nothing yet.
            ],
          }],


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->rene 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Dec 4 00:20:16 UTC 2010 
Responsible-Changed-Why:  
rene@ wants this port PRs (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152816 

From: Rene Ladan <rene@freebsd.org>
To: bug-followup@FreeBSD.org, chromium@hybridsource.org
Cc:  
Subject: Re: ports/152816: www/chromium add support for non-SSE2 and for removing
 explicit gconf dependency
Date: Sat, 04 Dec 2010 23:34:55 +0100

 While here, the BROKEN marker for FreeBSD < 7.0 can now be safely
 removed (since 6.X ended on November 30th) and the two bsd.port.*.mk
 lines can be collapsed into one at the end.
State-Changed-From-To: open->closed 
State-Changed-By: rene 
State-Changed-When: Sun Dec 5 10:09:41 UTC 2010 
State-Changed-Why:  
Committed, also removed check for 6.X 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152816 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/152816: commit references a PR
Date: Sun,  5 Dec 2010 10:09:32 +0000 (UTC)

 rene        2010-12-05 10:09:28 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/chromium         Makefile 
     www/chromium/files   patch-chromium 
   Log:
   - Add explicit dependency on dconf
   - Make dependency on gconf2 optionable (for setting the preferences)
   - Add support for pre-SSE2 processors
   
   While here, remove BROKEN check for 6.X
   
   Port remains FORBIDDEN
   PR:             ports/152816
   Submitted by:   maintainer
   
   Revision  Changes    Path
   1.11      +15 -9     ports/www/chromium/Makefile
   1.3       +136 -2    ports/www/chromium/files/patch-chromium
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
