Browse files

aur/mediatomb to 0.12.1-7

  • Loading branch information...
1 parent 23196a1 commit b597c6b9b72d761bd7734ac4a6af1f0fc7743a3f Kevin Mihelich committed Apr 15, 2012
Showing with 158 additions and 10 deletions.
  1. +14 −10 aur/mediatomb/PKGBUILD
  2. +144 −0 aur/mediatomb/jsparse.patch
View
24 aur/mediatomb/PKGBUILD
@@ -1,3 +1,4 @@
+# Maintainer: Peter Richard Lewis <plewis@aur.archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>
# Contributor: Nikhil Bysani <nikron@gmail.com>
# Contributor: Mika Hynnä <igheax@gmail.com>
@@ -7,9 +8,9 @@ plugrel=1
pkgname=mediatomb
pkgver=0.12.1
-pkgrel=6
+pkgrel=7
pkgdesc="Free UPnP/DLNA media server"
-arch=('i686' 'x86_64' 'arm')
+arch=('i686' 'x86_64')
url="http://mediatomb.cc/"
license=('GPL')
depends=('curl' 'ffmpegthumbnailer' 'js' 'libexif' 'libmp4v2' 'sqlite3' 'taglib')
@@ -19,19 +20,22 @@ source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
'mediatomb.rc'
'mediatomb.conf'
'gcc46.patch'
- 'tonewjs.patch'
- 'libav_0.7_support.patch')
-md5sums=('e927dd5dc52d3cfcebd8ca1af6f0d3c2'
- 'aa1191ec508d8bd4b3b9a5fe48efc079'
- 'bec297e4178332a26b42bbde873b94cd'
- '0ae34c0d73b76e3d215887834c3c08cf'
- 'd9e02a9956eecf5ff645bddf6dac0331'
- '88144653ff2dc602bcb737f59b2421ce')
+ 'tonewjs.patch'
+ 'jsparse.patch'
+ 'libav_0.7_support.patch')
+sha256sums=('31163c34a7b9d1c9735181737cb31306f29f1f2a0335fb4f53ecccf8f62f11cd'
+ '1a67a1deb8a41467fe9bbf66358a255f0df97b0170a5fc3d48c1f768c8d328b9'
+ 'ba9753a4a380d4c717c987efec03a3c6d401d3ff93a6fced28098adbd3a44cc9'
+ '0c02a20032f0c296800b1bb9644638970c2dedbc5ab7141d66a637235e9da6ce'
+ '2cd8f5628c3a38b290526f008bae351b90211825f86e5959bf95f140748de574'
+ 'd9a3062858900d32b977f0d50d168fd7d36785b6ecc038c019e661e27f7b1c17'
+ 'c6523e8bf5e2da89b7475d6777ef9bffe7d089752ef2f7b27b5e39a4130fb0ff')
build() {
cd "$srcdir/$pkgname-$pkgver"
patch -Np1 -i "$srcdir/gcc46.patch"
patch -Np1 -i "$srcdir/tonewjs.patch"
+ patch -Np1 -i "$srcdir/jsparse.patch"
patch -Np1 -i "$srcdir/libav_0.7_support.patch"
./configure --prefix=/usr \
View
144 aur/mediatomb/jsparse.patch
@@ -0,0 +1,144 @@
+diff -rup mediatomb-0.12.1/src/scripting/js_functions.cc ../mediatomb-0.12.1/src/scripting/js_functions.cc
+--- mediatomb-0.12.1/src/scripting/js_functions.cc 2011-06-29 21:51:13.641025479 -0400
++++ ../mediatomb-0.12.1/src/scripting/js_functions.cc 2011-06-29 21:49:21.071800273 -0400
+@@ -51,15 +51,28 @@ extern "C" {
+ JSBool
+ 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);
++
+ char * log_str = JS_EncodeString(cx, str);
+ log_js("%s\n", log_str);
+ JS_free(cx, log_str);
+@@ -116,24 +129,54 @@ js_addCdsObject(JSContext *cx, uintN arg
+ {
+ 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, JS_THIS_OBJECT(cx, argv));
++ 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)
+@@ -144,23 +187,14 @@ js_addCdsObject(JSContext *cx, uintN arg
+ {
+ 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_EncodeString(cx, str);
+
+- JSString *cont = JS_ValueToString(cx, argv[2]);
++
+ if (cont)
+ {
+ containerclass = JS_EncodeString(cx, cont);
+@@ -169,9 +203,9 @@ js_addCdsObject(JSContext *cx, uintN arg
+ }
+
+ if (self->whoami() == S_PLAYLIST)
+- js_orig_obj = self->getObjectProperty(JS_THIS_OBJECT(cx, argv), _("playlist"));
++ js_orig_obj = self->getObjectProperty(obj, _("playlist"));
+ else if (self->whoami() == S_IMPORT)
+- js_orig_obj = self->getObjectProperty(JS_THIS_OBJECT(cx, argv), _("orig"));
++ js_orig_obj = self->getObjectProperty(obj, _("orig"));
+
+ if (js_orig_obj == NULL)
+ {
+@@ -179,9 +213,6 @@ js_addCdsObject(JSContext *cx, uintN arg
+ 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;

0 comments on commit b597c6b

Please sign in to comment.