[gst-devel] going into gnome 2.2 -> patch to move registry to /var/cache

Leif Johnson leif at ambient.2y.net
Wed Nov 27 03:09:03 CET 2002


Hi folks -

On Mon, 25 Nov 2002, Thomas Vander Stichele wrote:

> Here's (off the top of my head) some things we still need to do :
> [...]
> f) move the registry to /var/cache instead of in /etc
>    (it's a cache, not a config file)

I've attached a patch that compiles on my box. I haven't
tried installing it yet, or building the debs, but from the
extent of the changes it looks like it shouldn't be a
problem. (I used regexxer to look in gst-all/* for
GST_CONFIG_DIR and some related terms (like sysconfdir) but
didn't find anything else to change.)

> g) figure out where to put a capplet that handles the
>    gconf keys

I think it would be nice to put this in gnome-media. If
folks are going to be using gconf and gstreamer, doesn't
that imply that they will likely have gnome-media on their
systems as well ?

Cheers,

leif

--
(( Leif Morgan Johnson . http://ambient.2y.net/leif/ )
 ( IAESTE trainee      . http://www.iaeste.org/      )
 ( Salomon Automation  . http://www.salomon.at/      ))
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/configure.ac,v
retrieving revision 1.183
diff -u -r1.183 configure.ac
--- configure.ac	30 Oct 2002 10:08:17 -0000	1.183
+++ configure.ac	26 Nov 2002 08:07:18 -0000
@@ -218,14 +218,10 @@
 esac], 
 [USE_PROFILING=no]) dnl Default value
 
-dnl default to building registry in the source tree if we are enabling plugin build dir
-if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
-  GST_CONFIG_DIR=`pwd`
-else
-  GST_CONFIG_DIR=${sysconfdir}/gstreamer
-fi
+dnl set up a configuration dir
+GST_CONFIG_DIR=${sysconfdir}/gstreamer
 AC_ARG_WITH(configdir,
-AC_HELP_STRING([--with-configdir],[specify path to use for plugin and command completion registries]),
+AC_HELP_STRING([--with-configdir],[specify path to use for configuration files]),
 [case "${withval}" in
   yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
   no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
@@ -237,6 +233,27 @@
 AC_MSG_NOTICE(Using $GST_CONFIG_DIR as configuration dir)
 
 
+dnl use a cache dir for storing element registry info.
+dnl default to building registry in the source tree if we are enabling plugin build dir
+if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
+  GST_CACHE_DIR=`pwd`
+else
+  dnl ${localstatedir} points to PREFIX/var
+  GST_CACHE_DIR=${localstatedir}/cache/gstreamer
+fi
+AC_ARG_WITH(cachedir,
+AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
+[case "${withval}" in
+  yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
+  no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
+  *) GST_CACHE_DIR="${withval}" ;;
+esac], 
+[:]) dnl Default value
+
+AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
+AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
+
+
 dnl building of tests
 AC_ARG_ENABLE(tests,
 AC_HELP_STRING([--disable-tests],[disable building test apps]),
@@ -357,6 +374,10 @@
 dnl Set location of configuration dir.
 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
 AC_SUBST(GST_CONFIG_DIR)
+
+dnl Set location of registry dir.
+AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Define the registry directory])
+AC_SUBST(GST_CACHE_DIR)
 
 dnl Set location of plugin directory
 if test "x${prefix}" = "xNONE"; then
Index: debian/rules
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/debian/rules,v
retrieving revision 1.21
diff -u -r1.21 rules
--- debian/rules	3 Oct 2002 03:02:08 -0000	1.21
+++ debian/rules	26 Nov 2002 08:07:18 -0000
@@ -36,7 +36,9 @@
 		--with-html-dir=\$${prefix}/share/doc/gstreamer-doc \
 		--sysconfdir=/etc \
 		--with-configdir=/etc/gstreamer \
+		--localstatedir=/var \
+		--with-cachedir=/var/cache/gstreamer \
 		--disable-plugin-builddir \
 		--disable-tests \
 		--disable-examples \
Index: gst/Makefile.am
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/Makefile.am,v
retrieving revision 1.118
diff -u -r1.118 Makefile.am
--- gst/Makefile.am	2 Nov 2002 13:28:14 -0000	1.118
+++ gst/Makefile.am	26 Nov 2002 08:07:27 -0000
@@ -183,11 +183,11 @@
 distclean-local:
 	rm -f $(top_builddir)/gst/gstmarshal.c $(top_builddir)/gst/gstmarshal.h
 
-libgstreamer_la_CFLAGS = -D_GNU_SOURCE -DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\" \
+libgstreamer_la_CFLAGS = -D_GNU_SOURCE \
 	$(LIBGST_CFLAGS) \
-	-D_GNU_SOURCE \
 	-DG_LOG_DOMAIN=g_log_domain_gstreamer \
-	-DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\" 
+	-DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\" \
+	-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\" 
 
 # the compiler shoots cothreads.c in the head at -O6
 libcothreads_la_CFLAGS = $(libgstreamer_la_CFLAGS) -O2 
Index: gst/gstregistry.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstregistry.h,v
retrieving revision 1.7
diff -u -r1.7 gstregistry.h
--- gst/gstregistry.h	11 Aug 2002 21:00:18 -0000	1.7
+++ gst/gstregistry.h	26 Nov 2002 08:07:27 -0000
@@ -26,7 +26,7 @@
 
 #include <gst/gstplugin.h>
 
-#define GLOBAL_REGISTRY_DIR      GST_CONFIG_DIR
+#define GLOBAL_REGISTRY_DIR      GST_CACHE_DIR
 #define GLOBAL_REGISTRY_FILE     GLOBAL_REGISTRY_DIR"/registry.xml"
 #define GLOBAL_REGISTRY_FILE_TMP GLOBAL_REGISTRY_DIR"/.registry.xml.tmp"
 
Index: tools/Makefile.am
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/tools/Makefile.am,v
retrieving revision 1.36
diff -u -r1.36 Makefile.am
--- tools/Makefile.am	23 Sep 2002 06:02:17 -0000	1.36
+++ tools/Makefile.am	26 Nov 2002 08:07:27 -0000
@@ -23,29 +23,36 @@
 	gst-feedback.1
 
 gst_launch_LDADD = $(GST_LIBS) #-lefence
-gst_launch_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" 
+gst_launch_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
+	-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\" 
 
 gst_md5sum_LDADD = $(GST_LIBS) #-lefence
-gst_md5sum_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" 
+gst_md5sum_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
+	-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\" 
 
 if !GST_DISABLE_REGISTRY
 gst_register_LDADD = $(GST_LIBS)
-gst_register_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" 
+gst_register_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
+	-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\" 
 endif
 
 gst_inspect_LDADD = $(GST_LIBS) ../libs/gst/control/libgstcontrol.la
-gst_inspect_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" 
+gst_inspect_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
+	-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\" 
 
 gst_complete_LDADD = $(GST_LIBS)
-gst_complete_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" 
+gst_complete_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
+	-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\" 
 
 if !GST_DISABLE_LOADSAVE
 gst_compprep_LDADD = $(GST_LIBS)
-gst_compprep_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" 
+gst_compprep_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
+	-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\" 
 
 gst_xmllaunch_SOURCES = gst-launch.c
 gst_xmllaunch_LDADD = $(GST_LIBS)
-gst_xmllaunch_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" 
+gst_xmllaunch_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
+	-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\" 
 endif
 
 EXTRA_DIST = $(man_MANS) gst-feedback
Index: tools/gst-complete.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/tools/gst-complete.c,v
retrieving revision 1.3
diff -u -r1.3 gst-complete.c
--- tools/gst-complete.c	20 Sep 2002 03:27:54 -0000	1.3
+++ tools/gst-complete.c	26 Nov 2002 08:07:27 -0000
@@ -81,8 +81,8 @@
 
   /***** Loading the completion information from the registry *****/
 
-  if (stat (GST_CONFIG_DIR"/compreg.xml", &stat_buf) == 0) {
-    doc = xmlParseFile (GST_CONFIG_DIR"/compreg.xml");
+  if (stat (GST_CACHE_DIR"/compreg.xml", &stat_buf) == 0) {
+    doc = xmlParseFile (GST_CACHE_DIR"/compreg.xml");
   } else {
     exit (1);
   }
Index: tools/gst-compprep.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/tools/gst-compprep.c,v
retrieving revision 1.10
diff -u -r1.10 gst-compprep.c
--- tools/gst-compprep.c	1 Nov 2002 22:05:28 -0000	1.10
+++ tools/gst-compprep.c	26 Nov 2002 08:07:27 -0000
@@ -99,9 +99,9 @@
   }
 
 #ifdef HAVE_LIBXML2
-  xmlSaveFormatFile(GST_CONFIG_DIR "/compreg.xml",doc,1);
+  xmlSaveFormatFile(GST_CACHE_DIR "/compreg.xml",doc,1);
 #else
-  xmlSaveFile(GST_CONFIG_DIR "/compreg.xml",doc);
+  xmlSaveFile(GST_CACHE_DIR "/compreg.xml",doc);
 #endif
 
   return 0;


More information about the gstreamer-devel mailing list