mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
206
package/ushare/0001-compile-fixes.patch
Normal file
206
package/ushare/0001-compile-fixes.patch
Normal file
@@ -0,0 +1,206 @@
|
||||
Patch nixed from OpenWRT svn to fix build breakage.
|
||||
|
||||
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||
|
||||
--- a/src/cds.c
|
||||
+++ b/src/cds.c
|
||||
@@ -20,6 +20,8 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
#include <upnp/upnp.h>
|
||||
#include <upnp/upnptools.h>
|
||||
|
||||
--- a/src/http.c
|
||||
+++ b/src/http.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -77,8 +78,7 @@ set_info_file (struct File_Info *info, c
|
||||
info->content_type = ixmlCloneDOMString (content_type);
|
||||
}
|
||||
|
||||
-static int
|
||||
-http_get_info (const char *filename, struct File_Info *info)
|
||||
+int http_get_info (const char *filename, struct File_Info *info)
|
||||
{
|
||||
extern struct ushare_t *ut;
|
||||
struct upnp_entry_t *entry = NULL;
|
||||
@@ -197,8 +197,7 @@ get_file_memory (const char *fullpath, c
|
||||
return ((UpnpWebFileHandle) file);
|
||||
}
|
||||
|
||||
-static UpnpWebFileHandle
|
||||
-http_open (const char *filename, enum UpnpOpenFileMode mode)
|
||||
+UpnpWebFileHandle http_open (const char *filename, enum UpnpOpenFileMode mode)
|
||||
{
|
||||
extern struct ushare_t *ut;
|
||||
struct upnp_entry_t *entry = NULL;
|
||||
@@ -251,8 +250,7 @@ http_open (const char *filename, enum Up
|
||||
return ((UpnpWebFileHandle) file);
|
||||
}
|
||||
|
||||
-static int
|
||||
-http_read (UpnpWebFileHandle fh, char *buf, size_t buflen)
|
||||
+int http_read (UpnpWebFileHandle fh, char *buf, size_t buflen)
|
||||
{
|
||||
struct web_file_t *file = (struct web_file_t *) fh;
|
||||
ssize_t len = -1;
|
||||
@@ -286,8 +284,7 @@ http_read (UpnpWebFileHandle fh, char *b
|
||||
return len;
|
||||
}
|
||||
|
||||
-static int
|
||||
-http_write (UpnpWebFileHandle fh __attribute__((unused)),
|
||||
+int http_write (UpnpWebFileHandle fh __attribute__((unused)),
|
||||
char *buf __attribute__((unused)),
|
||||
size_t buflen __attribute__((unused)))
|
||||
{
|
||||
@@ -296,8 +293,7 @@ http_write (UpnpWebFileHandle fh __attri
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int
|
||||
-http_seek (UpnpWebFileHandle fh, off_t offset, int origin)
|
||||
+int http_seek (UpnpWebFileHandle fh, off_t offset, int origin)
|
||||
{
|
||||
struct web_file_t *file = (struct web_file_t *) fh;
|
||||
off_t newpos = -1;
|
||||
@@ -371,8 +367,7 @@ http_seek (UpnpWebFileHandle fh, off_t o
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int
|
||||
-http_close (UpnpWebFileHandle fh)
|
||||
+int http_close (UpnpWebFileHandle fh)
|
||||
{
|
||||
struct web_file_t *file = (struct web_file_t *) fh;
|
||||
|
||||
@@ -402,13 +397,3 @@ http_close (UpnpWebFileHandle fh)
|
||||
|
||||
return 0;
|
||||
}
|
||||
-
|
||||
-struct UpnpVirtualDirCallbacks virtual_dir_callbacks =
|
||||
- {
|
||||
- http_get_info,
|
||||
- http_open,
|
||||
- http_read,
|
||||
- http_write,
|
||||
- http_seek,
|
||||
- http_close
|
||||
- };
|
||||
--- a/src/http.h
|
||||
+++ b/src/http.h
|
||||
@@ -25,6 +25,18 @@
|
||||
#include <upnp/upnp.h>
|
||||
#include <upnp/upnptools.h>
|
||||
|
||||
-struct UpnpVirtualDirCallbacks virtual_dir_callbacks;
|
||||
+int http_get_info (const char *filename, struct File_Info *info);
|
||||
+
|
||||
+UpnpWebFileHandle http_open (const char *filename, enum UpnpOpenFileMode mode);
|
||||
+
|
||||
+int http_read (UpnpWebFileHandle fh, char *buf, size_t buflen);
|
||||
+
|
||||
+int http_seek (UpnpWebFileHandle fh, off_t offset, int origin);
|
||||
+
|
||||
+int http_write (UpnpWebFileHandle fh __attribute__((unused)),
|
||||
+ char *buf __attribute__((unused)),
|
||||
+ size_t buflen __attribute__((unused)));
|
||||
+
|
||||
+int http_close (UpnpWebFileHandle fh);
|
||||
|
||||
#endif /* _HTTP_H_ */
|
||||
--- a/src/ushare.c
|
||||
+++ b/src/ushare.c
|
||||
@@ -188,7 +188,7 @@ handle_action_request (struct Upnp_Actio
|
||||
if (strcmp (request->DevUDN + 5, ut->udn))
|
||||
return;
|
||||
|
||||
- ip = request->CtrlPtIPAddr.s_addr;
|
||||
+ ip = (*(struct sockaddr_in *)&request->CtrlPtIPAddr).sin_addr.s_addr;
|
||||
ip = ntohl (ip);
|
||||
sprintf (val, "%d.%d.%d.%d",
|
||||
(ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF);
|
||||
@@ -348,13 +348,23 @@ init_upnp (struct ushare_t *ut)
|
||||
|
||||
UpnpEnableWebserver (TRUE);
|
||||
|
||||
- res = UpnpSetVirtualDirCallbacks (&virtual_dir_callbacks);
|
||||
- if (res != UPNP_E_SUCCESS)
|
||||
- {
|
||||
- log_error (_("Cannot set virtual directory callbacks\n"));
|
||||
- free (description);
|
||||
- return -1;
|
||||
- }
|
||||
+#define upnp_set_callback(cb, func) \
|
||||
+ do { \
|
||||
+ res = UpnpVirtualDir_set_##cb##Callback(func); \
|
||||
+ if (res != UPNP_E_SUCCESS) \
|
||||
+ { \
|
||||
+ log_error (_("Cannot set virtual directory callbacks\n")); \
|
||||
+ free (description); \
|
||||
+ return -1; \
|
||||
+ } \
|
||||
+ } while(0)
|
||||
+
|
||||
+ upnp_set_callback(GetInfo, http_get_info);
|
||||
+ upnp_set_callback(Open, http_open);
|
||||
+ upnp_set_callback(Read, http_read);
|
||||
+ upnp_set_callback(Seek, http_seek);
|
||||
+ upnp_set_callback(Write, http_write);
|
||||
+ upnp_set_callback(Close, http_close);
|
||||
|
||||
res = UpnpAddVirtualDir (VIRTUAL_DIR);
|
||||
if (res != UPNP_E_SUCCESS)
|
||||
--- a/src/cms.c
|
||||
+++ b/src/cms.c
|
||||
@@ -20,6 +20,8 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
#include <upnp/upnp.h>
|
||||
#include <upnp/upnptools.h>
|
||||
|
||||
--- a/src/mime.c
|
||||
+++ b/src/mime.c
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "mime.h"
|
||||
--- a/src/presentation.c
|
||||
+++ b/src/presentation.c
|
||||
@@ -19,6 +19,8 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
# include <langinfo.h>
|
||||
--- a/src/services.c
|
||||
+++ b/src/services.c
|
||||
@@ -20,6 +20,8 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
#include <upnp/upnp.h>
|
||||
#include <upnp/upnptools.h>
|
||||
|
||||
49
package/ushare/0002-ushare-fix-building-with-gcc-5.x.patch
Normal file
49
package/ushare/0002-ushare-fix-building-with-gcc-5.x.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 6abc52190accc8d8b17455420e234a1d7dc7ba55 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Korsgaard <peter@korsgaard.com>
|
||||
Date: Mon, 16 Nov 2015 23:15:27 +0100
|
||||
Subject: [PATCH] ushare: fix building with gcc 5.x
|
||||
|
||||
GCC5 defaults to -std=gnu11, which has different semantics for inline than
|
||||
previous versions:
|
||||
|
||||
https://gcc.gnu.org/gcc-5/porting_to.html
|
||||
|
||||
Which causes linker issues when display_headers() and start_log() are
|
||||
referenced from other files. There's no real reason why these needs to be
|
||||
inline, so just drop the keyword.
|
||||
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
---
|
||||
src/trace.c | 2 +-
|
||||
src/ushare.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/trace.c b/src/trace.c
|
||||
index 50729ef..4e314ef 100644
|
||||
--- a/src/trace.c
|
||||
+++ b/src/trace.c
|
||||
@@ -57,7 +57,7 @@ print_log (log_level level, const char *format, ...)
|
||||
va_end (va);
|
||||
}
|
||||
|
||||
-inline void
|
||||
+void
|
||||
start_log (void)
|
||||
{
|
||||
openlog (PACKAGE_NAME, LOG_PID, LOG_DAEMON);
|
||||
diff --git a/src/ushare.c b/src/ushare.c
|
||||
index b64451e..af46e78 100644
|
||||
--- a/src/ushare.c
|
||||
+++ b/src/ushare.c
|
||||
@@ -496,7 +496,7 @@ reload_config (int s __attribute__ ((unused)))
|
||||
}
|
||||
}
|
||||
|
||||
-inline void
|
||||
+void
|
||||
display_headers (void)
|
||||
{
|
||||
printf (_("%s (version %s), a lightweight UPnP A/V and DLNA Media Server.\n"),
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
ushare.c: include config.h before checking for CONFIG_NLS
|
||||
|
||||
When NLS support is enabled, we get following build errors:
|
||||
|
||||
ushare.c: In function 'setup_i18n':
|
||||
ushare.c:745:3: warning: implicit declaration of function 'setlocale' [-Wimplicit-function-declaration]
|
||||
setlocale (LC_ALL, "");
|
||||
^
|
||||
ushare.c:745:14: error: 'LC_ALL' undeclared (first use in this function)
|
||||
setlocale (LC_ALL, "");
|
||||
^
|
||||
ushare.c:745:14: note: each undeclared identifier is reported only once for each function it appears in
|
||||
make[2]: *** [ushare.o] Error 1
|
||||
|
||||
When NLS support is enabled, configure script creates macro in config.h.
|
||||
We check for CONFIG_NLS before including config.h which results in above
|
||||
build errors as locale.h doesn't get included.
|
||||
|
||||
This patch fixes above build error by including config.h before we check for
|
||||
CONFIG_NLS.
|
||||
|
||||
This build error is detected by Buildroot autobuilder
|
||||
http://autobuild.buildroot.net/results/19d/19d67dd43e5a313c77e4be97ecb9811ffa52f797/
|
||||
|
||||
Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
|
||||
|
||||
--- ushare-1.1a/src/ushare.c.old 2016-09-20 19:04:00.915239326 +0530
|
||||
+++ ushare-1.1a/src/ushare.c 2016-09-20 19:04:24.707239276 +0530
|
||||
@@ -56,11 +56,12 @@
|
||||
#include <upnp/upnp.h>
|
||||
#include <upnp/upnptools.h>
|
||||
|
||||
+#include "config.h"
|
||||
+
|
||||
#if (defined(HAVE_SETLOCALE) && defined(CONFIG_NLS))
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
-#include "config.h"
|
||||
#include "ushare.h"
|
||||
#include "services.h"
|
||||
#include "http.h"
|
||||
17
package/ushare/Config.in
Normal file
17
package/ushare/Config.in
Normal file
@@ -0,0 +1,17 @@
|
||||
config BR2_PACKAGE_USHARE
|
||||
bool "ushare"
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # libupnp
|
||||
# ushare has a completely custom configure script that does
|
||||
# broken things with library ordering, which breaks static
|
||||
# linking.
|
||||
depends on !BR2_STATIC_LIBS
|
||||
select BR2_PACKAGE_LIBUPNP
|
||||
help
|
||||
uShare is a UPnP (TM) A/V & DLNA Media Server.
|
||||
It implements the server component that provides UPnP media
|
||||
devices with information on available multimedia files.
|
||||
|
||||
http://ushare.geexbox.org/
|
||||
|
||||
comment "ushare needs a toolchain w/ threads, dynamic library"
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
|
||||
2
package/ushare/ushare.hash
Normal file
2
package/ushare/ushare.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
# locally computed hash
|
||||
sha256 7b9b85c79968d4f4560f02a99e33c6a33ff58f9d41d8faea79e31cce2ee78665 ushare-1.1a.tar.bz2
|
||||
44
package/ushare/ushare.mk
Normal file
44
package/ushare/ushare.mk
Normal file
@@ -0,0 +1,44 @@
|
||||
################################################################################
|
||||
#
|
||||
# ushare
|
||||
#
|
||||
################################################################################
|
||||
|
||||
USHARE_VERSION = 1.1a
|
||||
USHARE_SOURCE = ushare-$(USHARE_VERSION).tar.bz2
|
||||
USHARE_SITE = http://ushare.geexbox.org/releases
|
||||
USHARE_DEPENDENCIES = host-pkgconf libupnp $(TARGET_NLS_DEPENDENCIES)
|
||||
USHARE_LICENSE = GPL-2.0+
|
||||
USHARE_LICENSE_FILES = COPYING
|
||||
USHARE_LDFLAGS = $(TARGET_NLS_LIBS)
|
||||
|
||||
USHARE_CONF_OPTS = \
|
||||
--prefix=/usr \
|
||||
--cross-compile \
|
||||
--cross-prefix="$(TARGET_CROSS)" \
|
||||
--sysconfdir=/etc \
|
||||
--disable-strip
|
||||
|
||||
ifeq ($(BR2_SYSTEM_ENABLE_NLS),)
|
||||
USHARE_CONF_OPTS += --disable-nls
|
||||
endif
|
||||
|
||||
define USHARE_CONFIGURE_CMDS
|
||||
(cd $(@D); \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
./configure \
|
||||
$(USHARE_CONF_OPTS) \
|
||||
)
|
||||
endef
|
||||
|
||||
define USHARE_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) LDFLAGS="$(TARGET_LDFLAGS) $(USHARE_LDFLAGS)" -C $(@D)
|
||||
endef
|
||||
|
||||
define USHARE_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
|
||||
rm -f $(TARGET_DIR)/etc/init.d/ushare
|
||||
endef
|
||||
|
||||
# Even though configure is called it's not autoconf
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user