Add a way to disable xptv support
authorThibault Saunier <tsaunier@igalia.com>
Fri, 30 Nov 2018 15:41:04 +0000 (12:41 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Fri, 30 Nov 2018 18:40:43 +0000 (15:40 -0300)
This formatter is in very bad shape and is generally not useful.

It has been deprecated since 1.0... and I bet noone uses it.

ges/ges-pitivi-formatter.c
ges/ges.c
ges/ges.h
ges/meson.build
meson.build
meson_options.txt

index 835554b..76cdda0 100644 (file)
@@ -37,6 +37,7 @@
 #include <libxml/xmlwriter.h>
 
 #include "ges-internal.h"
+#include <ges/ges-pitivi-formatter.h>
 #include <ges/ges.h>
 
 /* The Pitivi etree formatter is 0.1 we set GES one to 0.2 */
index 28d94ca..993d36a 100644 (file)
--- a/ges/ges.c
+++ b/ges/ges.c
 #include "ges/gstframepositioner.h"
 #include "ges-internal.h"
 
+#ifndef DISABLE_XPTV
+#include <ges/ges-pitivi-formatter.h>
+#endif
+
 #define GES_GNONLIN_VERSION_NEEDED_MAJOR 1
 #define GES_GNONLIN_VERSION_NEEDED_MINOR 2
 #define GES_GNONLIN_VERSION_NEEDED_MICRO 0
@@ -100,7 +104,9 @@ ges_init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
   g_type_class_ref (GES_TYPE_GROUP);
 
   /* register formatter types with the system */
+#ifndef DISABLE_XPTV
   g_type_class_ref (GES_TYPE_PITIVI_FORMATTER);
+#endif
   g_type_class_ref (GES_TYPE_COMMAND_LINE_FORMATTER);
   g_type_class_ref (GES_TYPE_XML_FORMATTER);
 
@@ -171,7 +177,10 @@ ges_deinit (void)
   g_type_class_unref (g_type_class_peek (GES_TYPE_GROUP));
 
   /* register formatter types with the system */
+#ifndef DISABLE_XPTV
   g_type_class_unref (g_type_class_peek (GES_TYPE_PITIVI_FORMATTER));
+#endif
+
   g_type_class_unref (g_type_class_peek (GES_TYPE_COMMAND_LINE_FORMATTER));
   g_type_class_unref (g_type_class_peek (GES_TYPE_XML_FORMATTER));
 
index f088923..d9445db 100644 (file)
--- a/ges/ges.h
+++ b/ges/ges.h
@@ -76,7 +76,6 @@
 #include <ges/ges-effect-asset.h>
 #include <ges/ges-effect.h>
 #include <ges/ges-formatter.h>
-#include <ges/ges-pitivi-formatter.h>
 #include <ges/ges-command-line-formatter.h>
 #include <ges/ges-utils.h>
 #include <ges/ges-meta-container.h>
index 853ca8c..79df1c8 100644 (file)
@@ -40,7 +40,6 @@ ges_sources = [
     'ges-effect.c',
     'ges-screenshot.c',
     'ges-formatter.c',
-    'ges-pitivi-formatter.c',
     'ges-asset.c',
     'ges-uri-asset.c',
     'ges-clip-asset.c',
@@ -109,7 +108,6 @@ ges_headers = [
     'ges-text-overlay.h',
     'ges-screenshot.h',
     'ges-formatter.h',
-    'ges-pitivi-formatter.h',
     'ges-asset.h',
     'ges-uri-asset.h',
     'ges-clip-asset.h',
@@ -126,6 +124,10 @@ ges_headers = [
     'ges-group.h'
 ]
 
+if libxml_dep.found()
+  ges_sources += ['ges-pitivi-formatter.c']
+  ges_headers += ['ges-pitivi-formatter.h']
+endif
 
 version_data = configuration_data()
 version_data.set('GES_VERSION_MAJOR', gst_version_major)
index 340d8bd..80cf650 100644 (file)
@@ -86,7 +86,8 @@ gstvalidate_dep = dependency('gst-validate-1.0', version : gst_req, required : f
   fallback : ['gst-devtools', 'validate_dep'])
 
 gio_dep = dependency('gio-2.0', fallback: ['glib', 'libgio_dep'])
-libxml_dep = dependency('libxml-2.0', fallback: ['libxml2', 'xml2lib_dep'])
+libxml_dep = dependency('libxml-2.0', required: get_option('xptv'))
+cdata.set('DISABLE_XPTV', not libxml_dep.found())
 
 # TODO Properly port to Gtk 3
 # gtk_dep = dependency('gtk+-3.0', required : false)
index 6fc63ec..cc9bde3 100644 (file)
@@ -6,3 +6,5 @@ option('tests', type : 'feature', value : 'auto', yield : true,
        description : 'Build and enable unit tests')
 option('pygi-overrides-dir', type : 'string', value : '',
         description: 'Path to pygobject overrides directory')
+option('xptv', type : 'feature', value : 'auto',
+       description : 'Build the deprecated xptv formater')
\ No newline at end of file