mediatomb, revive old bep file (#2447)

This commit is contained in:
Schrijvers Luc
2018-06-24 06:03:22 +02:00
committed by waddlesplash
parent 129b5b4aba
commit 4990a7f76c
3 changed files with 398 additions and 109 deletions

View File

@@ -1,31 +1,84 @@
SUMMARY="Open source UPnP Media Server"
DESCRIPTION="MediaTomb is an open source UPnP MediaServer"
HOMEPAGE="http://mediatomb.cc/"
SOURCE_URI="http://downloads.sourceforge.net/project/mediatomb/MediaTomb/0.12.1/mediatomb-0.12.1.tar.gz"
HOMEPAGE="https://sourceforge.net/projects/mediatomb/"
COPYRIGHT="2005 Gena Batyan, Sergey 'Jin' Bostandzhyan, Leonhard Wimmer"
LICENSE="GNU GPL v2"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
MESSAGE="This port only builds with gcc4. Use 'setgcc gcc4' before building."
CHECKSUM_MD5="e927dd5dc52d3cfcebd8ca1af6f0d3c2"
SOURCE_URI="https://downloads.sourceforge.net/mediatomb/mediatomb-$portVersion.tar.gz"
CHECKSUM_SHA256="31163c34a7b9d1c9735181737cb31306f29f1f2a0335fb4f53ecccf8f62f11cd"
PATCHES="mediatomb-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="?x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
mediatomb$secondaryArchSuffix = $portVersion
cmd:mediatomb$commandSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
#lib:libavcodec$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libexif$secondaryArchSuffix
lib:libexpat$secondaryArchSuffix
#lib:libextractor$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libmagic$secondaryArchSuffix
#lib:libmozjs185$secondaryArchSuffix
#lib:libmp4v2$secondaryArchSuffix
lib:libsqlite3$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libtag$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
#devel:libavcodec$secondaryArchSuffix
devel:libcurl$secondaryArchSuffix
devel:libcrypto$secondaryArchSuffix
devel:libexif$secondaryArchSuffix
devel:libexpat$secondaryArchSuffix
#devel:libextractor$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libmagic$secondaryArchSuffix
#devel:libmozjs185$secondaryArchSuffix
#devel:libmp4v2$secondaryArchSuffix
devel:libsqlite3$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libtag$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:awk
cmd:autoreconf
cmd:gcc$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cd mediatomb-0.12.1
libtoolize --force --copy --install
aclocal
autoconf
automake
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--with-iconv-libs=`finddir B_COMMON_LIB_DIRECTORY` \
--with-sqlite3-libs=`finddir B_COMMON_LIB_DIRECTORY` \
--with-expat-libs=`finddir B_COMMON_LIB_DIRECTORY`
make
autoreconf -vfi
runConfigure --omit-dirs binDir ./configure \
--bindir=$commandBinDir #\
#--with-js-h="`finddir B_SYSTEM_DEVELOP_DIRECTORY`/headers/x86/js"
make $jobArgs
}
INSTALL()
{
cd mediatomb-0.12.1
make install
}
LICENSE="GNU GPL v2"
COPYRIGHT="2005 Gena Batyan, Sergey 'Jin' Bostandzhyan
2006-2010 Gena Batyan, Sergey 'Jin' Bostandzhyan, Leonhard Wimmer"

View File

@@ -1,88 +0,0 @@
diff -urN mediatomb-0.12.1/configure.ac mediatomb-0.12.1-haiku/configure.ac
--- mediatomb-0.12.1/configure.ac 2010-04-07 22:38:51.058982400 +0000
+++ mediatomb-0.12.1-haiku/configure.ac 2011-02-06 23:56:23.000000000 +0000
@@ -45,6 +45,7 @@
CYGWIN_OS=0
FREEBSD_OS=0
OPENBSD_OS=0
+HAIKU_OS=0
LIBS_SAVE="$LIBS"
@@ -67,6 +68,11 @@
*-*-openbsd*)
OPENBSD_OS=1
;;
+ *-*-haiku*)
+ HAIKU_OS=1
+ SEARCH_DIR="/boot/common"
+ LIBS="$LIBS -lnetwork"
+ ;;
esac
MT_SET_SEARCHPATH
@@ -721,7 +727,7 @@
AC_SUBST(NSL_LIBS)
],
[
- if test $CYGWIN_OS -eq 0; then
+ if ((test $CYGWIN_OS -eq 0) && (test $HAIKU_OS -eq 0)); then
AC_MSG_ERROR(required library function not found)
fi
]
diff -urN mediatomb-0.12.1/src/tools.cc mediatomb-0.12.1-haiku/src/tools.cc
--- mediatomb-0.12.1/src/tools.cc 2010-03-25 14:58:11.015466496 +0000
+++ mediatomb-0.12.1-haiku/src/tools.cc 2011-02-07 01:45:18.225968128 +0000
@@ -46,7 +46,7 @@
#include <string.h>
#include "config_manager.h"
-#ifndef SOLARIS
+#if !defined SOLARIS && !defined __HAIKU__
#include <net/if.h>
#else
#include <fcntl.h>
diff -urN mediatomb-0.12.1/tombupnp/threadutil/src/ThreadPool.c mediatomb-0.12.1-haiku/tombupnp/threadutil/src/ThreadPool.c
--- mediatomb-0.12.1/tombupnp/threadutil/src/ThreadPool.c 2010-03-25 14:58:13.043515904 +0000
+++ mediatomb-0.12.1-haiku/tombupnp/threadutil/src/ThreadPool.c 2011-02-07 01:07:38.354156544 +0000
@@ -372,7 +372,7 @@
gettimeofday( &t, NULL );
#if defined(WIN32)
srand( ( unsigned int )(t.tv_usec/1000) + (unsigned int)ithread_get_current_thread_id( ).p );
-#elif defined(__FreeBSD__) || defined (__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#elif defined(__FreeBSD__) || defined (__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
srand( ( unsigned int )(t.tv_usec/1000) + (unsigned int)ithread_get_current_thread_id( ) );
#else
srand( ( unsigned int )(t.tv_usec/1000) + ithread_get_current_thread_id( ) );
diff -urN mediatomb-0.12.1/tombupnp/upnp/src/api/upnpapi.c mediatomb-0.12.1-haiku/tombupnp/upnp/src/api/upnpapi.c
--- mediatomb-0.12.1/tombupnp/upnp/src/api/upnpapi.c 2010-03-25 14:58:12.049283072 +0000
+++ mediatomb-0.12.1-haiku/tombupnp/upnp/src/api/upnpapi.c 2011-02-07 01:25:10.416546816 +0000
@@ -66,7 +66,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
- #ifndef SOLARIS
+ #if !defined SOLARIS && !defined __HAIKU__
// #include <linux/if.h>
#include <net/if.h>
#else
diff -urN mediatomb-0.12.1/tombupnp/upnp/src/genlib/net/uri/uri.c mediatomb-0.12.1-haiku/tombupnp/upnp/src/genlib/net/uri/uri.c
--- mediatomb-0.12.1/tombupnp/upnp/src/genlib/net/uri/uri.c 2010-03-25 14:58:12.046661632 +0000
+++ mediatomb-0.12.1-haiku/tombupnp/upnp/src/genlib/net/uri/uri.c 2011-02-07 01:39:58.739770368 +0000
@@ -71,7 +71,6 @@
#include "inet_pton.h"
#endif
-
/************************************************************************
* Function : is_reserved
*
@@ -639,7 +638,7 @@
int errCode = 0;
//call gethostbyname_r (reentrant form of gethostbyname)
-#if defined(WIN32) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__OpenBSD__)
+#if defined(WIN32) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__HAIKU__)
h=gethostbyname(temp_host_name);
#elif defined(SOLARIS)
h = gethostbyname_r( temp_host_name,

View File

@@ -0,0 +1,324 @@
From 24c37e9411fb0ced565a3ae4d1c57f165a98b316 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 14 Apr 2018 23:08:53 +0200
Subject: import previous patch, fix build
diff --git a/configure.ac b/configure.ac
index 26ecf93..8fa45ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,6 +34,7 @@ AM_CONFIG_HEADER([autoconfig.h tombupnp/upnp/inc/upnpconfig.h])
AC_CONFIG_AUX_DIR(configure_aux)
AC_CONFIG_SRCDIR([src/common.h])
AM_INIT_AUTOMAKE([1.9 -Wall])
+AM_PROG_AR
if test "x${prefix}" = "xNONE"; then
prefix="${ac_default_prefix}"
@@ -45,6 +46,7 @@ DARWIN_OS=0
CYGWIN_OS=0
FREEBSD_OS=0
OPENBSD_OS=0
+HAIKU_OS=0
LIBS_SAVE="$LIBS"
@@ -67,6 +69,11 @@ case $host in
*-*-openbsd*)
OPENBSD_OS=1
;;
+ *-*-haiku*)
+ HAIKU_OS=1
+ SEARCH_DIR=/boot/system
+ LIBS="$LIBS -lnetwork"
+ ;;
esac
MT_SET_SEARCHPATH
@@ -721,7 +728,7 @@ AC_CHECK_FUNCS([if_nameindex],[],
AC_SUBST(NSL_LIBS)
],
[
- if test $CYGWIN_OS -eq 0; then
+ if ((test $CYGWIN_OS -eq 0) && (test $HAIKU_OS -eq 0)); then
AC_MSG_ERROR(required library function not found)
fi
]
diff --git a/src/hash/dbo_hash.h b/src/hash/dbo_hash.h
index 2e58627..16c15b3 100644
--- a/src/hash/dbo_hash.h
+++ b/src/hash/dbo_hash.h
@@ -106,7 +106,7 @@ public:
inline bool remove(KT key)
{
struct dbo_hash_slot<KT, VT> *slot;
- if (! search(key, &slot))
+ if (! this->search(key, &slot))
return false;
slot->key = deletedKey;
slot->value->release();
@@ -136,7 +136,7 @@ public:
inline void put(KT key, zmm::Ref<VT> value)
{
struct dbo_hash_slot<KT, VT> *slot;
- search(key, &slot);
+ this->search(key, &slot);
put(key, (hash_slot_t)slot, value);
}
void put(KT key, hash_slot_t destSlot, zmm::Ref<VT> value)
@@ -162,7 +162,7 @@ public:
inline zmm::Ref<VT> get(KT key)
{
struct dbo_hash_slot<KT, VT> *slot;
- bool found = search(key, &slot);
+ bool found = this->search(key, &slot);
if (found)
return zmm::Ref<VT>(slot->value);
else
@@ -174,7 +174,7 @@ public:
inline zmm::Ref<VT> get(KT key, hash_slot_t *destSlot)
{
struct dbo_hash_slot<KT, VT> **slot = (struct dbo_hash_slot<KT, VT> **)destSlot;
- bool found = search(key, slot);
+ bool found = this->search(key, slot);
if (found)
return zmm::Ref<VT>((*slot)->value);
else
diff --git a/src/hash/dbr_hash.h b/src/hash/dbr_hash.h
index 6e65d7f..176ff93 100644
--- a/src/hash/dbr_hash.h
+++ b/src/hash/dbr_hash.h
@@ -124,7 +124,7 @@ public:
inline bool remove(KT key)
{
struct dbr_hash_slot<KT> *slot;
- if (! search(key, &slot))
+ if (! this->search(key, &slot))
return false;
slot->key = deletedKey;
int array_slot = slot->array_slot;
@@ -134,7 +134,7 @@ public:
return true;
}
data_array[array_slot] = data_array[--this->count];
- if (! search(data_array[array_slot], &slot))
+ if (! this->search(data_array[array_slot], &slot))
{
log_debug("DBR-Hash-Error: (%d; array_slot=%d; count=%d)\n", data_array[array_slot], array_slot, this->count);
throw zmm::Exception(_("DBR-Hash-Error: key in data_array not found in hashtable"));
@@ -146,7 +146,7 @@ public:
inline void put(KT key)
{
struct dbr_hash_slot<KT> *slot;
- if (! search(key, &slot))
+ if (! this->search(key, &slot))
{
#ifdef TOMBDEBUG
if (this->count >= realCapacity)
diff --git a/src/hash/dso_hash.h b/src/hash/dso_hash.h
index adfb97f..03ec852 100644
--- a/src/hash/dso_hash.h
+++ b/src/hash/dso_hash.h
@@ -100,7 +100,7 @@ public:
inline bool remove(zmm::String key)
{
struct dso_hash_slot<VT> *slot;
- if (! search(key, &slot))
+ if (! this->search(key, &slot))
return false;
slot->key->release();
slot->value->release();
@@ -112,7 +112,7 @@ public:
inline void put(zmm::String key, zmm::Ref<VT> value)
{
struct dso_hash_slot<VT> *slot;
- search(key, &slot);
+ this->search(key, &slot);
put(key, (hash_slot_t)slot, value);
}
void put(zmm::String key, hash_slot_t destSlot, zmm::Ref<VT> value)
@@ -141,7 +141,7 @@ public:
inline zmm::Ref<VT> get(zmm::String key)
{
struct dso_hash_slot<VT> *slot;
- bool found = search(key, &slot);
+ bool found = this->search(key, &slot);
if (found)
return zmm::Ref<VT>(slot->value);
else
@@ -153,7 +153,7 @@ public:
inline zmm::Ref<VT> get(zmm::String key, hash_slot_t *destSlot)
{
struct dso_hash_slot<VT> **slot = (struct dso_hash_slot<VT> **)destSlot;
- bool found = search(key, slot);
+ bool found = this->search(key, slot);
if (found)
return zmm::Ref<VT>((*slot)->value);
else
diff --git a/src/tools.cc b/src/tools.cc
index da694f2..6524c9e 100644
--- a/src/tools.cc
+++ b/src/tools.cc
@@ -46,7 +46,7 @@
#include <string.h>
#include "config_manager.h"
-#ifndef SOLARIS
+#if !defined SOLARIS && !defined __HAIKU__
#include <net/if.h>
#else
#include <fcntl.h>
diff --git a/src/zmm/object.h b/src/zmm/object.h
index 1aa1656..a38153e 100644
--- a/src/zmm/object.h
+++ b/src/zmm/object.h
@@ -34,6 +34,7 @@
#include <new> // for size_t
#include "atomic.h"
+#include <cstddef>
namespace zmm
{
@@ -48,7 +49,7 @@ public:
void release();
int getRefCount();
- static void* operator new (size_t size);
+ static void* operator new (std::size_t size);
static void operator delete (void *ptr);
protected:
mt_atomic_t _ref_count;
diff --git a/tombupnp/threadutil/src/ThreadPool.c b/tombupnp/threadutil/src/ThreadPool.c
index f2e23b7..5865a99 100644
--- a/tombupnp/threadutil/src/ThreadPool.c
+++ b/tombupnp/threadutil/src/ThreadPool.c
@@ -372,7 +372,7 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
gettimeofday( &t, NULL );
#if defined(WIN32)
srand( ( unsigned int )(t.tv_usec/1000) + (unsigned int)ithread_get_current_thread_id( ).p );
-#elif defined(__FreeBSD__) || defined (__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#elif defined(__FreeBSD__) || defined (__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
srand( ( unsigned int )(t.tv_usec/1000) + (unsigned int)ithread_get_current_thread_id( ) );
#else
srand( ( unsigned int )(t.tv_usec/1000) + ithread_get_current_thread_id( ) );
diff --git a/tombupnp/upnp/src/api/upnpapi.c b/tombupnp/upnp/src/api/upnpapi.c
index a4a9392..cfd59d6 100644
--- a/tombupnp/upnp/src/api/upnpapi.c
+++ b/tombupnp/upnp/src/api/upnpapi.c
@@ -66,8 +66,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
- #ifndef SOLARIS
-// #include <linux/if.h>
+ #if !defined SOLARIS && !defined __HAIKU__
#include <net/if.h>
#else
#include <fcntl.h>
diff --git a/tombupnp/upnp/src/genlib/net/uri/uri.c b/tombupnp/upnp/src/genlib/net/uri/uri.c
index d02e5db..73e5e33 100644
--- a/tombupnp/upnp/src/genlib/net/uri/uri.c
+++ b/tombupnp/upnp/src/genlib/net/uri/uri.c
@@ -71,7 +71,6 @@
#include "inet_pton.h"
#endif
-
/************************************************************************
* Function : is_reserved
*
@@ -639,7 +638,7 @@ parse_hostport( const char *in,
int errCode = 0;
//call gethostbyname_r (reentrant form of gethostbyname)
-#if defined(WIN32) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__OpenBSD__)
+#if defined(WIN32) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__HAIKU__)
h=gethostbyname(temp_host_name);
#elif defined(SOLARIS)
h = gethostbyname_r( temp_host_name,
--
2.16.2
From 7dcad243359ccacd8d92c4e8cda3df8d6b014a7d Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 21 Apr 2018 13:42:57 +0200
Subject: fix check for libmozjs185
diff --git a/configure.ac b/configure.ac
index 8fa45ad..a075bcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -963,15 +963,15 @@ dnl fi
for sm_path in $SEARCH_DIR_HEADERS \
/usr/include/js \
/usr/include/smjs \
- /usr/include/mozjs \
+ /usr/include/mozjs185 \
/usr/local/include/js \
/usr/local/include/smjs \
- /usr/local/include/mozjs \
+ /usr/local/include/mozjs185 \
/usr/include/spidermonkey \
/usr/local/include/spidermonkey \
$SEARCH_DIR_HEADERS/js \
$SEARCH_DIR_HEADERS/smjs \
- $SEARCH_DIR_HEADERS/mozjs \
+ $SEARCH_DIR_HEADERS/mozjs185 \
$SEARCH_DIR_HEADERS/spidermonkey; do
if test "x$ac_cv_header_jsapi_h" != xyes ; then
AC_MSG_CHECKING([checking alternative libjs header location: $sm_path])
@@ -1013,11 +1013,11 @@ if test "x$JS_OK" = xyes; then
MOZLIB=smjs
],
[
- LDFLAGS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -lmozjs $ADD_PTHREAD_CFLAGS"
- AC_CHECK_LIB(mozjs, JS_NewObject,
+ LDFLAGS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -lmozjs185185 $ADD_PTHREAD_CFLAGS"
+ AC_CHECK_LIB(mozjs185, JS_NewObject,
[
- JS_LIBS="-L$JS_SEARCH_LIBS -lmozjs"
- MOZLIB=mozjs
+ JS_LIBS="-L$JS_SEARCH_LIBS -lmozjs185"
+ MOZLIB=mozjs185
],
[
AC_MSG_ERROR([Spidermonkey not found in requested location $JS_SEARCH_LIBS])
@@ -1043,10 +1043,10 @@ if test "x$JS_OK" = xyes; then
],
[
unset ac_cv_lib_smjs_JS_NewObject
- AC_CHECK_LIB(mozjs, JS_NewObject,
+ AC_CHECK_LIB(mozjs185, JS_NewObject,
[
- MOZLIB=mozjs
- JS_LIBS="-lmozjs"
+ MOZLIB=mozjs185
+ JS_LIBS="-lmozjs185"
],
[
LDFLAGS="-L$SEARCH_DIR_LIBS $LDFLAGS_SAVE $ADD_PTHREAD_CFLAGS"
@@ -1064,12 +1064,12 @@ if test "x$JS_OK" = xyes; then
MOZLIB=smjs
],
[
- LDFLAGS="-L$SEARCH_DIR_LIBS $LDFLAGS_SAVE -lmozjs"
- unset ac_cv_lib_mozjs_JS_NewObject
- AC_CHECK_LIB(mozjs, JS_NewObject,
+ LDFLAGS="-L$SEARCH_DIR_LIBS $LDFLAGS_SAVE -lmozjs185"
+ unset ac_cv_lib_mozjs185_JS_NewObject
+ AC_CHECK_LIB(mozjs185, JS_NewObject,
[
- JS_LIBS="-L$SEARCH_DIR_LIBS -lmozjs"
- MOZLIB=mozjs
+ JS_LIBS="-L$SEARCH_DIR_LIBS -lmozjs185"
+ MOZLIB=mozjs185
],
[
JS_OK=missing
--
2.16.2