rpms/totem/devel totem-xul.patch,NONE,1.1 totem.spec,1.141,1.142

Bastien Nocera (hadess) fedora-extras-commits at redhat.com
Fri Jan 11 11:32:24 UTC 2008


Author: hadess

Update of /cvs/pkgs/rpms/totem/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15333

Modified Files:
	totem.spec 
Added Files:
	totem-xul.patch 
Log Message:
Add patch to allow building against xulrunner


totem-xul.patch:

--- NEW FILE totem-xul.patch ---
Index: browser-plugin/totemStringGlue.h
===================================================================
--- browser-plugin/totemStringGlue.h	(revision 5011)
+++ browser-plugin/totemStringGlue.h	(working copy)
@@ -1,58 +0,0 @@
-/* Totem browser plugin
- *
- * Copyright © 2006 Bastien Nocera <hadess at hadess.net>
- * Copyright © 2006 Christian Persch
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <nsEmbedString.h>
-
-#ifndef NS_LITERAL_CSTRING
-#define NS_LITERAL_CSTRING(x) (x)
-#endif
-
-class nsString : public nsEmbedString {
-  public:
-    PRBool IsEmpty () { return !Length (); }
-};
-
-class nsCString : public nsEmbedCString {
-  public:
-    nsCString () : nsEmbedCString () { }
-    explicit nsCString (const char *aData, PRUint32 aLength) : nsEmbedCString (aData, aLength) { }
-    explicit nsCString (const abstract_string_type& aOther) { Assign (aOther); }
-    explicit nsCString (const char *&aOther) { Assign (aOther); }
-    explicit nsCString (const nsCString& aData, int aStartPos, PRUint32 aLength) : nsEmbedCString (aData.get() + aStartPos, aLength-aStartPos) { }
-    PRBool IsEmpty () { return !Length (); }
-    PRBool Equals (const self_type& aOther) { return !strcmp (aOther.get (), get ()); }
-    PRBool Equals (const char_type *aOther) { return !strcmp (aOther, get ()); }
-    void SetLength (PRUint32 aLen) { Assign (""); }
-    self_type& operator=(const abstract_string_type& aOther) { Assign (aOther); return *this; }
-    self_type& operator=(const char_type* aOther) { Assign (aOther); return *this; }
-};
-
-class NS_ConvertUTF16toUTF8 : public nsCString {
-  public:
-    explicit NS_ConvertUTF16toUTF8 (const nsAString& aString) {
-	 NS_UTF16ToCString (aString, NS_CSTRING_ENCODING_UTF8, *this);
-      }
-};
-
-typedef nsString nsDependentString;
-typedef nsCString nsDependentCString;
-typedef nsCString nsDependentCSubstring;
-
Index: browser-plugin/totemPlugin.h
===================================================================
--- browser-plugin/totemPlugin.h	(revision 5011)
+++ browser-plugin/totemPlugin.h	(working copy)
@@ -29,9 +29,8 @@
 
 #include <nsStringAPI.h>
 
-#ifdef NEED_STRING_GLUE
-#include "totemStringGlue.h"
-#endif
+#define NS_STATIC_CAST(__type, __ptr) static_cast< __type >(__ptr)
+#define NS_REINTERPRET_CAST(__type, __expr) reinterpret_cast< __type >(__expr)
 
 #if defined(TOTEM_COMPLEX_PLUGIN) && defined(HAVE_NSTARRAY_H)
 #include <nsTArray.h>
Index: browser-plugin/Makefile.am
===================================================================
--- browser-plugin/Makefile.am	(revision 5011)
+++ browser-plugin/Makefile.am	(working copy)
@@ -144,7 +144,6 @@
 	totemPluginGlue.h		\
 	totemPlugin.cpp			\
 	totemPlugin.h			\
-	totemStringGlue.h		\
 	totemBasicPlugin.cpp		\
 	totemBasicPlugin.h		\
 	totemClassInfo.h		\
@@ -210,7 +209,6 @@
 	totemPluginGlue.h		\
 	totemPlugin.cpp			\
 	totemPlugin.h			\
-	totemStringGlue.h		\
 	totemGMPPlugin.cpp		\
 	totemGMPPlugin.h		\
 	totemClassInfo.h		\
@@ -270,7 +268,6 @@
 	totemPluginGlue.h		\
 	totemPlugin.cpp			\
 	totemPlugin.h			\
-	totemStringGlue.h		\
 	totemComplexPlugin.cpp		\
 	totemComplexPlugin.h		\
 	totemClassInfo.h		\
@@ -330,7 +327,6 @@
 	totemPluginGlue.h		\
 	totemPlugin.cpp			\
 	totemPlugin.h			\
-	totemStringGlue.h		\
 	totemNarrowSpacePlugin.cpp	\
 	totemNarrowSpacePlugin.h	\
 	totemClassInfo.h		\
@@ -390,7 +386,6 @@
 	totemPluginGlue.h		\
 	totemPlugin.cpp			\
 	totemPlugin.h			\
-	totemStringGlue.h		\
 	totemMullYPlugin.cpp		\
 	totemMullYPlugin.h		\
 	totemClassInfo.h		\
@@ -450,7 +445,6 @@
 	totemPluginGlue.h		\
 	totemPlugin.cpp			\
 	totemPlugin.h			\
-	totemStringGlue.h		\
 	totemConePlugin.cpp		\
 	totemConePlugin.h		\
 	totemClassInfo.h		\
Index: configure.in
===================================================================
--- configure.in	(revision 5011)
+++ configure.in	(working copy)
@@ -560,61 +560,23 @@
 	[AS_HELP_STRING([--enable-browser-plugins],[compile the totem browser plugins])],
 	[],[enable_browser_plugins=autodetect])
 
-# Backward compatibility
-AC_ARG_ENABLE([mozilla],[],[enable_browser_plugins=$enableval],[])
-
 AC_MSG_RESULT([$enable_browser_plugins])
 
 # Check which mozilla to use
 
 if test "$enable_browser_plugins" != "no" ; then
-	AC_MSG_CHECKING([which gecko to use])
+	PKG_CHECK_MODULES([GECKO], [libxul >= 1.8], [gecko=xulrunner], [gecko=""])
 
-	AC_ARG_WITH([gecko],
-		[AS_HELP_STRING([--with-gecko],[Which gecko engine to use (default: autodetect)])])
-
-	# backward compat
-	AC_ARG_WITH([mozilla],[],[with_gecko=$withval])
-
-	GECKOS="xulrunner firefox mozilla-firefox seamonkey mozilla"
-	gecko=$with_gecko
-
-	if test -z "$with_gecko"; then
-		dnl Autodetect gecko
-		for g in $GECKOS; do
-			if $PKG_CONFIG --exists $g-xpcom; then
-				gecko=$g
-				break;
-			fi
-		done
-	elif ! $PKG_CONFIG --exists $gecko-xpcom; then
-		AC_MSG_ERROR([Gecko "$gecko" not found])
-	fi
-
-	if test -z "$gecko" -a "$enable_browser_plugins" = "autodetect"; then
+	if "$enable_browser_plugins" = "autodetect"; then
 		dnl No gecko found, disable plugin
 		AC_MSG_WARN([No gecko found, disabling plugin])
 		enable_browser_plugins=no
 	elif test -z "$gecko"; then
-		AC_MSG_ERROR([No gecko found])
-	elif ! ( echo "$GECKOS" | egrep "(^| )$gecko(\$| )" > /dev/null); then
-		AC_MSG_ERROR([Unknown gecko "$gecko" specified])
+		AC_MSG_ERROR([No xulrunner found])
 	else
 		enable_browser_plugins=yes
 	fi
 
-	AC_MSG_RESULT([$gecko])
-
-	case "$gecko" in
-		mozilla) MOZILLA_VERSION_MIN=1.7 ;;
-		seamonkey) MOZILLA_VERSION_MIN=1.0 ;;
-		*firefox) MOZILLA_VERSION_MIN=1.0 ;;
-		xulrunner) MOZILLA_VERSION_MIN=1.8 ;;
-	esac
-
-	MOZILLA=$gecko
-	AC_SUBST([MOZILLA])
-
 	if test "$enable_cxx_warnings" != "no" -a "$GXX" = "yes"; then
 		PLUGIN_EXTRA_WARN_CXXFLAGS="-Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Woverloaded-virtual"
 	else
@@ -627,8 +589,7 @@
 # separate vars
 if test "$enable_browser_plugins" = "yes" ; then
 	PKG_CHECK_MODULES([MOZILLA_NOT_LINKED],
-		[$MOZILLA-xpcom >= $MOZILLA_VERSION_MIN \
-		 $MOZILLA-plugin],,
+		[libxul >= 1.8],,
                 [enable_browser_plugins=no])
 fi
 # Check for other required modules, and merge CFLAGS, but not link
@@ -675,24 +636,28 @@
 
 # Sets some variables, and check for xpidl
 if test "$enable_browser_plugins" = "yes" ; then
-	MOZILLA_PREFIX="`$PKG_CONFIG $MOZILLA-xpcom --variable=prefix`"
-	MOZILLA_LIBDIR="`$PKG_CONFIG $MOZILLA-xpcom --variable=libdir`"
-	MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $MOZILLA-xpcom`"
-	MOZILLA_XPCOM_CFLAGS="-I`$PKG_CONFIG --variable=includedir $MOZILLA-xpcom`"
+	LIBXUL_SDK_DIR=`$PKG_CONFIG --variable=sdkdir libxul`
+	MOZILLA_PREFIX="`$PKG_CONFIG libxul --variable=prefix`"
+	MOZILLA_LIBDIR="`$PKG_CONFIG libxul --variable=libdir`"
+	MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir libxul`"
+	MOZILLA_XPCOM_CFLAGS="`$PKG_CONFIG --cflags --define-variable=includetype=unstable libxul`"
+	MOZILLA_LIBS="`$PKG_CONFIG --libs libxul`"
+
 	MOZILLA_PLUGINDIR="${MOZILLA_PLUGINDIR:-"\${libdir}/mozilla/plugins"}"
 
-	AC_PATH_PROG([MOZILLA_XPIDL], [xpidl], [no], [$MOZILLA_LIBDIR:$PATH])
+	AC_PATH_PROG([MOZILLA_XPIDL], [xpidl], [no], [$LIBXUL_SDK_DIR/bin:$PATH])
 	if test "x$MOZILLA_XPIDL" = "xno"; then
 		AC_MSG_ERROR([xpidl compiler not found])
 	fi
 
-	AC_PATH_PROG([MOZILLA_XPT_LINK],[xpt_link],[no],[$MOZILLA_LIBDIR:$PATH])
+	AC_PATH_PROG([MOZILLA_XPT_LINK],[xpt_link],[no],[$LIBXUL_SDK_DIR/bin:$PATH])
 	if test "$MOZILLA_XPT_LINK" = "no"; then
 		AC_MSG_ERROR([xpt_link not found])
 	fi
 
 	AC_SUBST([MOZILLA_PREFIX])
 	AC_SUBST([MOZILLA_LIBDIR])
+	AC_SUBST([MOZILLA_LIBS])
 	AC_SUBST([MOZILLA_XPCOM_CFLAGS])
 	AC_SUBST([MOZILLA_INCLUDE_ROOT])
 	AC_ARG_VAR([MOZILLA_PLUGINDIR],[Where to install the plugin to])
@@ -701,15 +666,7 @@
 # Search for the idl include directory
 if test "$enable_browser_plugins" = "yes" ; then
 	dnl This only works on gecko 1.8
-	MOZILLA_IDLDIR="`$PKG_CONFIG --variable=idldir $MOZILLA-xpcom`"
-	dnl Fallback for older versions
-	if test "x$MOZILLA_IDLDIR" = "x"; then
-		MOZILLA_IDLDIR="`echo $MOZILLA_LIBDIR | sed -e s!lib!share/idl!`"
-	fi
-	dnl Some distributions (Gentoo) have it in unusual places
-	if test "x$MOZILLA_IDLDIR" = "x"; then
-		MOZILLA_IDLDIR="$MOZILLA_INCLUDE_ROOT/idl"
-	fi
+	MOZILLA_IDLDIR="`$PKG_CONFIG --variable=idldir libxul`"
 
 	AC_SUBST([MOZILLA_IDLDIR])
 fi
@@ -782,32 +739,6 @@
 	fi
 fi
 
-# check for some additional xpcom headers and for string compatibility
-
-if test "$enable_browser_plugins" = "yes"; then
-	AC_LANG_PUSH([C++])
-	__SAVE_CPPFLAGS=$CPPFLAGS
-	CPPFLAGS="$CPPFLAGS $MOZILLA_NOT_LINKED_CFLAGS -I$MOZILLA_INCLUDE_ROOT -I$MOZILLA_INCLUDE_ROOT/xpcom"
-
-	AC_CHECK_HEADERS([nsTArray.h])
-
-	AC_MSG_CHECKING([whether we need string glue])
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-				#include <mozilla-config.h>
-				#include <nsStringAPI.h>
-		],[
-				nsDependentCString test("Test");
-		])],[need_string_glue=no],[need_string_glue=yes])
-	AC_MSG_RESULT([$need_string_glue])
-
-	CPPFLAGS=$__SAVE_CPPFLAGS
-	AC_LANG_POP([C++])
-
-	if test "$need_string_glue" = "yes"; then
-		AC_DEFINE([NEED_STRING_GLUE],[1],[Define if we need string glue])
-	fi
-fi
-
 # check which plugins to enable
 
 if test "$enable_browser_plugins" = "yes"; then
@@ -1097,7 +1028,7 @@
 	AC_MSG_NOTICE([   No Totem plugins enabled])
 fi
 if test x$enable_browser_plugins = xyes ; then
-	AC_MSG_NOTICE([** Browser plugin enabled (using $MOZILLA)])
+	AC_MSG_NOTICE([** Browser plugin enabled (using xulrunner)])
 	if test x$enable_basic_plugin = xyes ; then
 		AC_MSG_NOTICE([** Basic browser plugin enabled])
 	else


Index: totem.spec
===================================================================
RCS file: /cvs/pkgs/rpms/totem/devel/totem.spec,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -r1.141 -r1.142
--- totem.spec	7 Jan 2008 16:34:05 -0000	1.141
+++ totem.spec	11 Jan 2008 11:31:45 -0000	1.142
@@ -55,8 +55,14 @@
 BuildRequires: libepc-devel
 BuildRequires: totem-pl-parser-devel
 
+# For the xulrunner patch
+BuildRequires: intltool autoconf automake libtool gettext check-devel
+
 Obsoletes: nautilus-media
 
+# http://bugzilla.gnome.org/show_bug.cgi?id=458324
+Patch0: totem-xul.patch
+
 %description
 Totem is simple movie player for the Gnome desktop. It features a
 simple playlist, a full-screen mode, seek and volume controls, as well as
@@ -131,6 +137,7 @@
 
 %prep
 %setup -q
+autoreconf -f
 
 %build
 # try to work around a problem where gst-inspect does 
@@ -287,6 +294,7 @@
 %changelog
 * Mon Jan 07 2008 - Bastien Nocera <bnocera at redhat.com> - 2.21.90-1
 - Update to 2.21.90
+- Add patch to allow building against xulrunner
 
 * Mon Dec 10 2007 - Bastien Nocera <bnocera at redhat.com> - 2.21.5-4
 - Add the (non-working yet, missing files in the tarball) publish plugin




More information about the fedora-extras-commits mailing list