Package: mediatomb
Version: 0.12.1-2
Severity: normal
Tags: patch pending

Dear maintainer,

I've prepared an NMU for mediatomb (versioned as 0.12.1-2.1) and
I had no plans to upload. 

I fixed the FTBFS, but I had to disable libjs to fix the build, maybe someone 
with proper JS knowledge can have a look to it.

Please dont remove the package from the archive... doh! I think I am late for 
that now.

Regards.

-- 
  Hector Oron
diff -Nru mediatomb-0.12.1/debian/changelog mediatomb-0.12.1/debian/changelog
--- mediatomb-0.12.1/debian/changelog	2011-02-24 21:29:03.000000000 +0100
+++ mediatomb-0.12.1/debian/changelog	2012-03-03 21:24:31.000000000 +0100
@@ -1,3 +1,18 @@
+mediatomb (0.12.1-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix FTBFS, missing include for size_t (Closes: #624921)
+    - Thanks Brian M. Carlson for patch.
+  * A rebuild fixes installability (Closes: #652534)
+  * Fix to build with xulrunner-9.0 (Closes: #631046) 
+  * Fix to build when using libavformat-dev (>= 4:0.7)
+  * Fix JS 1.8 compatibility
+  * Temporarily disable libjs, drops spidermonkey dependency and
+    allows package to build.
+    - Someone with better JS knowledge should look into that.
+
+ -- Hector Oron <zu...@debian.org>  Sat, 03 Mar 2012 17:52:17 +0000
+
 mediatomb (0.12.1-2) unstable; urgency=low
 
   * Team upload.
diff -Nru mediatomb-0.12.1/debian/patches/fix-FTBFS-624921.patch mediatomb-0.12.1/debian/patches/fix-FTBFS-624921.patch
--- mediatomb-0.12.1/debian/patches/fix-FTBFS-624921.patch	1970-01-01 01:00:00.000000000 +0100
+++ mediatomb-0.12.1/debian/patches/fix-FTBFS-624921.patch	2012-03-03 18:43:53.000000000 +0100
@@ -0,0 +1,20 @@
+Description: Fix FTBFS, missing include for size_t
+ mediatomb (0.12.1-2.1) unstable; urgency=low
+ .
+   * Non-maintainer upload.
+   * Fix FTBFS, missing include for size_t (Closes: #624921)
+     - Thanks Brian M. Carlson for patch.
+Author: Hector Oron <zu...@debian.org>
+Bug-Debian: http://bugs.debian.org/624921
+
+--- mediatomb-0.12.1.orig/src/zmm/object.h
++++ mediatomb-0.12.1/src/zmm/object.h
+@@ -32,7 +32,7 @@
+ #ifndef __ZMM_OBJECT_H__
+ #define __ZMM_OBJECT_H__
+ 
+-#include <new> // for size_t
++#include <cstddef> // for size_t
+ #include "atomic.h"
+ 
+ namespace zmm
diff -Nru mediatomb-0.12.1/debian/patches/fix-FTBFS-JS-1.8-compat.patch mediatomb-0.12.1/debian/patches/fix-FTBFS-JS-1.8-compat.patch
--- mediatomb-0.12.1/debian/patches/fix-FTBFS-JS-1.8-compat.patch	1970-01-01 01:00:00.000000000 +0100
+++ mediatomb-0.12.1/debian/patches/fix-FTBFS-JS-1.8-compat.patch	2012-03-03 19:07:24.000000000 +0100
@@ -0,0 +1,498 @@
+Description: Fix FTBFS porting JS 1.8 functions
+ mediatomb (0.12.1-2.1) unstable; urgency=low
+ .
+   * Non-maintainer upload.
+   * Fix FTBFS, missing include for size_t (Closes: #624921)
+     - Thanks Brian M. Carlson for patch.
+   * A rebuild fixes installability (Closes: #652534)
+   * Temporarily disable libjs and drop spidermonkey dependency.
+   * Fix to build with xulrunner-9.0 (Closes: #631046)
+   * Fix to build when using libavformat-dev (>= 4:0.7)
+   * Fix JS 1.8 compatibility
+Author: Hector Oron <zu...@debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Bug: http://sourceforge.net/tracker/?func=detail&aid=3409482&group_id=129766&atid=715782
+
+--- mediatomb-0.12.1.orig/src/scripting/js_functions.h
++++ mediatomb-0.12.1/src/scripting/js_functions.h
+@@ -40,18 +40,18 @@
+ extern "C" {
+ 
+ /// \brief Log output.
+-JSBool js_print(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
++JSBool js_print(JSContext *cx, uintN argc, jsval *argv);
+ 
+ /// \brief Adds an object to the database.
+-JSBool js_addCdsObject(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
++JSBool js_addCdsObject(JSContext *cx, uintN argc, jsval *argv);
+ 
+ /// \brief Makes a copy of an CDS object.
+-JSBool js_copyObject(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
++JSBool js_copyObject(JSContext *cx, uintN argc, jsval *argv);
+ 
+-JSBool js_f2i(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
+-JSBool js_m2i(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
+-JSBool js_p2i(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
+-JSBool js_j2i(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
++JSBool js_f2i(JSContext *cx, uintN argc, jsval *argv);
++JSBool js_m2i(JSContext *cx, uintN argc, jsval *argv);
++JSBool js_p2i(JSContext *cx, uintN argc, jsval *argv);
++JSBool js_j2i(JSContext *cx, uintN argc, jsval *argv);
+ 
+ } // extern "C"
+ 
+--- mediatomb-0.12.1.orig/src/scripting/script.h
++++ mediatomb-0.12.1/src/scripting/script.h
+@@ -66,8 +66,8 @@ public:
+     JSRuntime *rt;
+     JSContext *cx;
+     JSObject  *glob;
+-    JSScript *script;
+-    JSScript *common_script;
++    JSObject  *script;
++    JSObject  *common_script;
+     
+ public:
+     Script(zmm::Ref<Runtime> runtime);
+@@ -115,8 +115,8 @@ private:
+     JSObject *common_root;
+ 
+     void initGlobalObject();
+-    JSScript *_load(zmm::String scriptPath);
+-    void _execute(JSScript *scr);
++    JSObject *_load(zmm::String scriptPath);
++    void _execute(JSObject *scr);
+     zmm::Ref<StringConverter> _p2i;
+     zmm::Ref<StringConverter> _j2i;
+     zmm::Ref<StringConverter> _f2i;
+--- mediatomb-0.12.1.orig/src/scripting/script.cc
++++ mediatomb-0.12.1/src/scripting/script.cc
+@@ -87,7 +87,7 @@ String Script::getProperty(JSObject *obj
+     str = JS_ValueToString(cx, val);
+     if (! str)
+         return nil;
+-    return JS_GetStringBytes(str);
++    return JS_EncodeString(cx, str);
+ }
+ 
+ int Script::getBoolProperty(JSObject *obj, String name)
+@@ -427,14 +427,14 @@ static JSFunctionSpec js_global_function
+         try
+         {
+             common_script = _load(common_scr_path);
+-            common_root = JS_NewScriptObject(cx, common_script);
+-            JS_AddNamedRoot(cx, &common_root, "common-script");
++            common_root = JS_NewObject(cx, NULL, common_script, NULL);
++            JS_AddNamedObjectRoot(cx, &common_root, "common-script");
+             _execute(common_script);
+         }
+         catch (Exception e)
+         {
+             if (common_root)
+-                JS_RemoveRoot(cx, &common_root);
++                JS_RemoveObjectRoot(cx, &common_root);
+ 
+             log_js("Unable to load %s: %s\n", common_scr_path.c_str(), 
+                     e.getMessage().c_str());
+@@ -460,7 +460,7 @@ Script::~Script()
+     JS_BeginRequest(cx);
+ #endif
+     if (common_root)
+-        JS_RemoveRoot(cx, &common_root);
++        JS_RemoveObjectRoot(cx, &common_root);
+ 
+ /*
+  * scripts are unrooted and will be cleaned up by GC
+@@ -504,11 +504,11 @@ void Script::initGlobalObject()
+     static JSClass global_class =
+     {
+         "global",                                   /* name */
+-        JSCLASS_HAS_PRIVATE,                        /* flags */
++        JSCLASS_HAS_PRIVATE | JSCLASS_GLOBAL_FLAGS,/* flags */
+         JS_PropertyStub,                            /* add property */
+         JS_PropertyStub,                            /* del property */
+         JS_PropertyStub,                            /* get property */
+-        JS_PropertyStub,                            /* set property */
++        JS_StrictPropertyStub,                      /* set property */
+         JS_EnumerateStandardClasses,                /* enumerate */
+         JS_ResolveStub,                             /* resolve */
+         JS_ConvertStub,                             /* convert */
+@@ -517,7 +517,7 @@ void Script::initGlobalObject()
+     };
+ 
+     /* create the global object here */
+-    glob = JS_NewObject(cx, &global_class, NULL, NULL);
++    glob = JS_NewCompartmentAndGlobalObject(cx, &global_class, NULL);
+     if (! glob)
+         throw _Exception(_("Scripting: could not initialize glboal class"));
+ 
+@@ -539,12 +539,12 @@ void Script::defineFunctions(JSFunctionS
+         throw _Exception(_("Scripting: JS_DefineFunctions failed"));
+ }
+ 
+-JSScript *Script::_load(zmm::String scriptPath)
++JSObject *Script::_load(zmm::String scriptPath)
+ {
+     if (glob == NULL)
+         initGlobalObject();
+ 
+-    JSScript *scr;
++    JSObject *scr;
+ 
+     String scriptText = read_text_file(scriptPath);
+ 
+@@ -571,14 +571,11 @@ JSScript *Script::_load(zmm::String scri
+ 
+ void Script::load(zmm::String scriptPath)
+ {
+-    if (script)
+-        JS_DestroyScript(cx, script);
+-
+     script = _load((scriptPath));
+ }
+ 
+ 
+-void Script::_execute(JSScript *scr)
++void Script::_execute(JSObject *scr)
+ {
+     jsval ret_val;
+ 
+@@ -662,7 +659,7 @@ Ref<CdsObject> Script::jsObject2cdsObjec
+     JSObject *js_meta = getObjectProperty(js, _("meta"));
+     if (js_meta)
+     {
+-        JS_AddNamedRoot(cx, &js_meta, "meta");
++        JS_AddNamedObjectRoot(cx, &js_meta, "meta");
+         /// \todo: only metadata enumerated in MT_KEYS is taken
+         for (int i = 0; i < M_MAX; i++)
+         {
+@@ -687,7 +684,7 @@ Ref<CdsObject> Script::jsObject2cdsObjec
+                 }
+             }
+         }
+-        JS_RemoveRoot(cx, &js_meta);
++        JS_RemoveObjectRoot(cx, &js_meta);
+     }
+     
+     // stuff that has not been exported to js
+--- mediatomb-0.12.1.orig/src/scripting/import_script.cc
++++ mediatomb-0.12.1/src/scripting/import_script.cc
+@@ -53,8 +53,8 @@ ImportScript::ImportScript(Ref<Runtime>
+     try 
+     {
+         load(scriptPath);
+-        root = JS_NewScriptObject(cx, script);
+-        JS_AddNamedRoot(cx, &root, "ImportScript");
++        root = JS_NewObject(cx, NULL, script, NULL);
++        JS_AddNamedObjectRoot(cx, &root, "ImportScript");
+     }
+     catch (Exception ex)
+     {
+@@ -117,7 +117,7 @@ ImportScript::~ImportScript()
+ #endif
+     
+     if (root)
+-        JS_RemoveRoot(cx, &root);
++        JS_RemoveObjectRoot(cx, &root);
+ 
+ #ifdef JS_THREADSAFE
+     JS_EndRequest(cx);
+--- mediatomb-0.12.1.orig/src/scripting/js_functions.cc
++++ mediatomb-0.12.1/src/scripting/js_functions.cc
+@@ -49,30 +49,45 @@ using namespace zmm;
+ extern "C" {
+ 
+ JSBool 
+-js_print(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
++js_print(JSContext *cx, uintN argc, jsval *argv)
+ {
+-    uintN i;
++    uintN i, j;
+     JSString *str;
+ 
+     for (i = 0; i < argc; i++) 
+     {
+-        str = JS_ValueToString(cx, argv[i]);
++    	String fmtStr;
++    	for (j = 0; j < argc; j++)
++    	{
++    		if (j == i)
++    			fmtStr = fmtStr + "S";
++    		else
++    			fmtStr = fmtStr + "*";
++    	}
++    	if(!JS_ConvertArguments(cx, 1, JS_ARGV(cx, argv), fmtStr.c_str(), &str))
++		{
++			log_debug("Could not parse input arguments\n");
++			return JS_TRUE;
++		}
++
+         if (!str)
+             return JS_TRUE;
+-        argv[i] = STRING_TO_JSVAL(str);
+-        log_js("%s\n", JS_GetStringBytes(str));
++
++        char * log_str = JS_EncodeString(cx, str);
++        log_js("%s\n", log_str);
++        JS_free(cx, log_str);
+     }
+     return JS_TRUE;
+ }
+ 
+ JSBool
+-js_copyObject(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
++js_copyObject(JSContext *cx, uintN argc, jsval *argv)
+ {
+     jsval arg;
+     JSObject *js_cds_obj;
+     JSObject *js_cds_clone_obj;
+ 
+-    Script *self = (Script *)JS_GetPrivate(cx, obj);
++    Script *self = (Script *)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, argv));
+ 
+     try
+     {
+@@ -91,7 +106,7 @@ js_copyObject(JSContext *cx, JSObject *o
+ 
+         self->cdsObject2jsObject(cds_obj, js_cds_clone_obj);
+ 
+-        *rval = OBJECT_TO_JSVAL(js_cds_clone_obj);
++        JS_SET_RVAL(cx, argv, OBJECT_TO_JSVAL(js_cds_clone_obj));
+ 
+         return JS_TRUE;
+ 
+@@ -110,28 +125,58 @@ js_copyObject(JSContext *cx, JSObject *o
+ }
+ 
+ JSBool
+-js_addCdsObject(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
++js_addCdsObject(JSContext *cx, uintN argc, jsval *argv)
+ {
+     try
+     {
+-        jsval arg;
+-        JSString *str;
+-        String path;
+-        String containerclass;
++    	// Inputs from native code
++        JSObject *js_cds_obj = NULL;
++        JSString *str =  NULL;
++        JSString *cont = NULL;
+ 
+-        JSObject *js_cds_obj;
++        String path = nil;
++        String containerclass = nil;
++
++        JSObject *obj = JS_THIS_OBJECT(cx, argv);
+         JSObject *js_orig_obj = NULL;
+         Ref<CdsObject> orig_object;
+ 
+         Ref<StringConverter> p2i;
+         Ref<StringConverter> i2i;
++        switch (argc)
++        {
++        case 0:
++        	log_debug("No input arguments given\n");
++        	return JS_FALSE;
++        case 1:
++			if(!JS_ConvertArguments(cx, 1, JS_ARGV(cx, argv), "o", &js_cds_obj))
++			{
++				log_debug("Could not parse input arguments\n");
++				return JS_TRUE;
++			}
++			break;
++        case 2:
++        	if(!JS_ConvertArguments(cx, 2, JS_ARGV(cx, argv), "oS", &js_cds_obj, &str))
++			{
++				log_debug("Could not parse input arguments\n");
++				return JS_TRUE;
++			}
++			break;
++        default:
++        	if(!JS_ConvertArguments(cx, 3, JS_ARGV(cx, argv), "oSS", &js_cds_obj, &str, &cont))
++			{
++				log_debug("Could not parse input arguments\n");
++				return JS_TRUE;
++			}
++			break;
++        }
+ 
+         Script *self = (Script *)JS_GetPrivate(cx, obj);
+ 
+         if (self == NULL)
+         {
+             log_debug("Could not retrieve class instance from global object\n");
+-            return JS_FALSE;
++            return JS_TRUE;
+         }
+ 
+         if (self->whoami() == S_PLAYLIST)
+@@ -142,26 +187,17 @@ js_addCdsObject(JSContext *cx, JSObject
+         {
+             i2i = StringConverter::i2i();
+         }
+- 
+-        arg = argv[0];
+-        if (!JSVAL_IS_OBJECT(arg))
+-            return JS_TRUE;
+-        if (!JS_ValueToObject(cx, arg, &js_cds_obj))
+-            return JS_TRUE;
+ 
+-        // root it
+-        argv[0] = OBJECT_TO_JSVAL(js_cds_obj);
+ 
+-        str = JS_ValueToString(cx, argv[1]);
+         if (!str)
+             path = _("/");
+         else
+-            path = JS_GetStringBytes(str);
++            path = JS_EncodeString(cx, str);
++
+ 
+-        JSString *cont = JS_ValueToString(cx, argv[2]);
+         if (cont)
+         {
+-            containerclass = JS_GetStringBytes(cont);
++            containerclass = JS_EncodeString(cx, cont);
+             if (!string_ok(containerclass) || containerclass == "undefined")
+                 containerclass = nil;
+         }
+@@ -177,9 +213,6 @@ js_addCdsObject(JSContext *cx, JSObject
+             return JS_TRUE;
+         }
+ 
+-        // root it
+-        argv[1] = OBJECT_TO_JSVAL(js_orig_obj);
+-
+         orig_object = self->jsObject2cdsObject(js_orig_obj, self->getProcessedObject());
+         if (orig_object == nil)
+             return JS_TRUE;
+@@ -285,8 +318,7 @@ js_addCdsObject(JSContext *cx, JSObject
+         JSString *str2 = JS_NewStringCopyN(cx, tmp.c_str(), tmp.length());
+         if (!str2)
+             return JS_TRUE;
+-        *rval = STRING_TO_JSVAL(str2);
+-
++        JS_SET_RVAL(cx, argv, STRING_TO_JSVAL(str2)); 
+         return JS_TRUE;
+     }
+     catch (ServerShutdownException se)
+@@ -302,7 +334,7 @@ js_addCdsObject(JSContext *cx, JSObject
+     return JS_TRUE;
+ }
+ 
+-static JSBool convert_charset_generic(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval, charset_convert_t chr)
++static JSBool convert_charset_generic(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, charset_convert_t chr)
+ {
+     try
+     {
+@@ -321,7 +353,7 @@ static JSBool convert_charset_generic(JS
+         {
+             str = JS_ValueToString(cx, argv[0]);
+             if (str)
+-                result = JS_GetStringBytes(str);
++                result = JS_EncodeString(cx, str);
+         }
+ 
+         if (result != nil)
+@@ -330,7 +362,7 @@ static JSBool convert_charset_generic(JS
+             JSString *str2 = JS_NewStringCopyN(cx, result.c_str(), result.length());
+             if (!str2)
+                 return JS_TRUE;
+-            *rval = STRING_TO_JSVAL(str2);
++            JS_SET_RVAL(cx, argv, STRING_TO_JSVAL(str2));
+         }
+     }
+     catch (ServerShutdownException se)
+@@ -347,24 +379,23 @@ static JSBool convert_charset_generic(JS
+ }
+ 
+ 
+-JSBool js_f2i(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
++JSBool js_f2i(JSContext *cx, uintN argc, jsval *argv)
+ {
+-     return convert_charset_generic(cx, obj, argc, argv, rval, F2I);
++     return convert_charset_generic(cx, JS_THIS_OBJECT(cx, argv), argc, argv, F2I);
+ }
+ 
+-JSBool js_m2i(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
++JSBool js_m2i(JSContext *cx, uintN argc, jsval *argv)
+ {
+-     return convert_charset_generic(cx, obj, argc, argv, rval, M2I);
+-}
++     return convert_charset_generic(cx, JS_THIS_OBJECT(cx, argv), argc, argv, M2I); }
+ 
+-JSBool js_p2i(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
++JSBool js_p2i(JSContext *cx, uintN argc, jsval *argv)
+ {
+-     return convert_charset_generic(cx, obj, argc, argv, rval, P2I);
++     return convert_charset_generic(cx, JS_THIS_OBJECT(cx, argv), argc, argv, P2I);
+ }
+ 
+-JSBool js_j2i(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
++JSBool js_j2i(JSContext *cx, uintN argc, jsval *argv)
+ {
+-     return convert_charset_generic(cx, obj, argc, argv, rval, J2I);
++     return convert_charset_generic(cx, JS_THIS_OBJECT(cx, argv), argc, argv, J2I);
+ }
+ 
+ } // extern "C"
+--- mediatomb-0.12.1.orig/src/scripting/playlist_parser_script.cc
++++ mediatomb-0.12.1/src/scripting/playlist_parser_script.cc
+@@ -46,9 +46,9 @@ using namespace zmm;
+ extern "C" {
+ 
+ static JSBool
+-js_readln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
++js_readln(JSContext *cx, uintN argc, jsval *argv)
+ {
+-    PlaylistParserScript *self = (PlaylistParserScript *)JS_GetPrivate(cx, obj);
++    PlaylistParserScript *self = (PlaylistParserScript *)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, argv));
+ 
+     String line;
+     
+@@ -69,7 +69,7 @@ js_readln(JSContext *cx, JSObject *obj,
+ 
+     JSString *jsline = JS_NewStringCopyZ(cx, line.c_str());
+ 
+-    *rval = STRING_TO_JSVAL(jsline);
++    JS_SET_RVAL(cx, argv, STRING_TO_JSVAL(jsline));
+   
+     return JS_TRUE;
+ }
+@@ -93,8 +93,8 @@ PlaylistParserScript::PlaylistParserScri
+ 
+         String scriptPath = ConfigManager::getInstance()->getOption(CFG_IMPORT_SCRIPTING_PLAYLIST_SCRIPT); 
+         load(scriptPath);
+-        root = JS_NewScriptObject(cx, script);
+-        JS_AddNamedRoot(cx, &root, "PlaylistScript");
++        root = JS_NewObject(cx, NULL, script, NULL);
++        JS_AddNamedObjectRoot(cx, &root, "PlaylistScript");
+     }
+     catch (Exception ex)
+     {
+@@ -245,7 +245,7 @@ PlaylistParserScript::~PlaylistParserScr
+ #endif
+ 
+     if (root)
+-        JS_RemoveRoot(cx, &root);
++        JS_RemoveObjectRoot(cx, &root);
+ 
+ #ifdef JS_THREADSAFE
+     JS_EndRequest(cx);
+--- mediatomb-0.12.1.orig/build/Makefile.in
++++ mediatomb-0.12.1/build/Makefile.in
+@@ -257,7 +257,7 @@ CURL_LIBS = @CURL_LIBS@
+ CXX = @CXX@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+-CXXFLAGS = @CXXFLAGS@
++CXXFLAGS = -fpermissive @CXXFLAGS@
+ CYGPATH_W = @CYGPATH_W@
+ DB_AUTOCREATE_OPTION_ENABLED = @DB_AUTOCREATE_OPTION_ENABLED@
+ DB_AUTOCREATE_OPTION_REQUESTED = @DB_AUTOCREATE_OPTION_REQUESTED@
diff -Nru mediatomb-0.12.1/debian/patches/fix-FTBFS-libavformat-dev.patch mediatomb-0.12.1/debian/patches/fix-FTBFS-libavformat-dev.patch
--- mediatomb-0.12.1/debian/patches/fix-FTBFS-libavformat-dev.patch	1970-01-01 01:00:00.000000000 +0100
+++ mediatomb-0.12.1/debian/patches/fix-FTBFS-libavformat-dev.patch	2012-03-03 19:00:05.000000000 +0100
@@ -0,0 +1,85 @@
+Description: Fix to build when using libavformat-dev
+ mediatomb (0.12.1-2.1) unstable; urgency=low
+ .
+   * Non-maintainer upload.
+   * Fix FTBFS, missing include for size_t (Closes: #624921)
+     - Thanks Brian M. Carlson for patch.
+   * A rebuild fixes installability (Closes: #652534)
+   * Temporarily disable libjs and drop spidermonkey dependency.
+   * Fix to build with xulrunner-9.0 (Closes: #631046)
+   * Fix to build when using libavformat-dev (>= 4:0.7)
+   * Fix JS 1.8 compatibility
+Author: Hector Oron <zu...@debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: upstream, 
+Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=3291062&group_id=129766&atid=715780
+Bug-Ubuntu: https://launchpad.net/bugs/784431
+Forwarded: http://sourceforge.net/tracker/index.php?func=detail&aid=3291062&group_id=129766&atid=715780
+
+--- mediatomb-0.12.1.orig/src/metadata/ffmpeg_handler.cc
++++ mediatomb-0.12.1/src/metadata/ffmpeg_handler.cc
+@@ -89,6 +89,33 @@ static void addFfmpegMetadataFields(Ref<
+ 
+ 	Ref<StringConverter> sc = StringConverter::m2i();
+     
++	/* Tabs are 4 characters here */
++	typedef struct {const char *avname; metadata_fields_t field;} mapping_t;
++	static const mapping_t mapping[] =
++	{
++		{"title",   M_TITLE},
++		{"artist",  M_ARTIST},
++		{"album",   M_ALBUM},
++		{"date",    M_DATE},
++		{"genre",   M_GENRE},
++		{"comment", M_DESCRIPTION},
++		{"track",   M_TRACKNUMBER},
++		{NULL,      M_MAX},
++	};
++
++	if (!pFormatCtx->metadata)
++		return;
++	for (const mapping_t *m = mapping; m->avname != NULL; m++)
++	{
++		AVMetadataTag *tag = NULL;
++		tag = av_metadata_get(pFormatCtx->metadata, m->avname, NULL, 0);
++		if (tag && tag->value && tag->value[0])
++		{
++			log_debug("Added metadata %s: %s\n", m->avname, tag->value);
++			item->setMetadata(MT_KEYS[m->field].upnp, sc->convert(tag->value));
++		}
++	}
++	/* Old algorithm (doesn't work with libav >= 0.7)
+ 	if (strlen(pFormatCtx->title) > 0) 
+     {
+ 	    log_debug("Added metadata title: %s\n", pFormatCtx->title);
+@@ -131,6 +158,7 @@ static void addFfmpegMetadataFields(Ref<
+         item->setMetadata(MT_KEYS[M_TRACKNUMBER].upnp, 
+                           sc->convert(String::from(pFormatCtx->track)));
+ 	}
++	*/
+ }
+ 
+ // ffmpeg library calls
+@@ -178,7 +206,7 @@ static void addFfmpegResourceFields(Ref<
+ 	for(i=0; i<pFormatCtx->nb_streams; i++) 
+     {
+ 		AVStream *st = pFormatCtx->streams[i];
+-		if((st != NULL) && (videoset == false) && (st->codec->codec_type == CODEC_TYPE_VIDEO))
++		if((st != NULL) && (videoset == false) && (st->codec->codec_type == AVMEDIA_TYPE_VIDEO))
+         {
+             if (st->codec->codec_tag > 0)
+             {
+@@ -209,7 +237,7 @@ static void addFfmpegResourceFields(Ref<
+                 *y = st->codec->height;
+ 			}
+ 		} 
+-		if(st->codec->codec_type == CODEC_TYPE_AUDIO) 
++		if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO) 
+         {
+ 			// Increase number of audiochannels
+ 			audioch++;
diff -Nru mediatomb-0.12.1/debian/patches/series mediatomb-0.12.1/debian/patches/series
--- mediatomb-0.12.1/debian/patches/series	2011-02-24 20:49:16.000000000 +0100
+++ mediatomb-0.12.1/debian/patches/series	2012-03-03 20:12:46.000000000 +0100
@@ -2,3 +2,6 @@
 config_xml_comment.patch
 const_char_conversion.patch
 autoreconf_-fi.patch
+fix-FTBFS-624921.patch
+fix-FTBFS-libavformat-dev.patch
+fix-FTBFS-JS-1.8-compat.patch
diff -Nru mediatomb-0.12.1/debian/rules mediatomb-0.12.1/debian/rules
--- mediatomb-0.12.1/debian/rules	2011-02-24 20:49:16.000000000 +0100
+++ mediatomb-0.12.1/debian/rules	2012-03-03 20:14:42.000000000 +0100
@@ -51,7 +51,7 @@
 			--infodir=\$${prefix}/share/info \
 			--enable-sqlite3 \
 			--enable-mysql \
-			--enable-libjs \
+			--disable-libjs \
 			--enable-libmagic \
 			$(ENABLE_INOTIFY) \
 			--enable-libexif \

Reply via email to