diff mbox

[03/10] libxmlrpc: new package

Message ID d6e101fca46d16dbd2ebd312240f6b7de6bda48a.1338653505.git.thomas.petazzoni@free-electrons.com
State Changes Requested
Headers show

Commit Message

Thomas Petazzoni June 2, 2012, 4:13 p.m. UTC
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/Config.in                                  |    1 +
 package/libxmlrpc/Config.in                        |   10 +++++
 .../libxmlrpc/libxmlrpc-fix-gennmtab-build.patch   |   25 +++++++++++
 .../libxmlrpc-fix-non-cplusplus-build.patch        |   27 ++++++++++++
 .../libxmlrpc/libxmlrpc-fix-non-wchar-build.patch  |   24 +++++++++++
 .../libxmlrpc-remove-curl-types-h-include.patch    |   43 +++++++++++++++++++
 .../libxmlrpc-use-correct-curl-config.patch        |   22 ++++++++++
 package/libxmlrpc/libxmlrpc.mk                     |   44 ++++++++++++++++++++
 8 files changed, 196 insertions(+)
 create mode 100644 package/libxmlrpc/Config.in
 create mode 100644 package/libxmlrpc/libxmlrpc-fix-gennmtab-build.patch
 create mode 100644 package/libxmlrpc/libxmlrpc-fix-non-cplusplus-build.patch
 create mode 100644 package/libxmlrpc/libxmlrpc-fix-non-wchar-build.patch
 create mode 100644 package/libxmlrpc/libxmlrpc-remove-curl-types-h-include.patch
 create mode 100644 package/libxmlrpc/libxmlrpc-use-correct-curl-config.patch
 create mode 100644 package/libxmlrpc/libxmlrpc.mk

Comments

Arnout Vandecappelle June 4, 2012, 11:58 p.m. UTC | #1
On 06/02/12 18:13, Thomas Petazzoni wrote:
> +LIBXMLRPC_VERSION = 1.18.05
> +LIBXMLRPC_SOURCE = xmlrpc-c-$(LIBXMLRPC_VERSION).tgz
> +LIBXMLRPC_SITE ="http://xmlrpc-c.svn.sourceforge.net/viewvc/xmlrpc-c/advanced/?view=tar&pathrev=1716"

  It's a bit strange to use a three-year-old unstable version...
 From the website:

    Latest Tarballs
Series        Number
Development    unnumbered
Advanced    1.30.06
Stable        1.25.16
Super Stable    1.16.41

[snip]
> +# Override the download step since we don't have the normal
> +# site/source split (where site is the URL of the directory and source
> +# is the name of the tarball file).
> +$(LIBXMLRPC_DIR)/.stamp_downloaded:
> +    $(Q)$(call MESSAGE,"Downloading")
> +    $(call DOWNLOAD,$(LIBXMLRPC_SITE),$(LIBXMLRPC_SOURCE))
> +    $(Q)mkdir -p $(@D)
> +    $(Q)touch $@

  A simpler solution would be to just use the svn download method, from
https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable/


  Regards,
  Arnout
Thomas Petazzoni June 5, 2012, 9:26 p.m. UTC | #2
Hello,

Le Tue, 05 Jun 2012 01:57:33 +0200,
Arnout Vandecappelle <arnout@mind.be> a écrit :

> On 06/02/12 18:13, Thomas Petazzoni wrote:
> > +LIBXMLRPC_VERSION = 1.18.05
> > +LIBXMLRPC_SOURCE = xmlrpc-c-$(LIBXMLRPC_VERSION).tgz
> > +LIBXMLRPC_SITE ="http://xmlrpc-c.svn.sourceforge.net/viewvc/xmlrpc-c/advanced/?view=tar&pathrev=1716"
> 
>   It's a bit strange to use a three-year-old unstable version...
>  From the website:
> 
>     Latest Tarballs
> Series		Number
> Development	unnumbered
> Advanced	1.30.06
> Stable		1.25.16
> Super Stable	1.16.41

This package comes from a customer project, and the customer had its
software running with this version, so that's the version I tested. Of
course, packaging more recent versions would be better, but I thought
that having the package would be better than nothing.

>   A simpler solution would be to just use the svn download method, from
> https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable/

Sure, I'll look into that.

Thomas
Peter Korsgaard Jan. 12, 2013, 8:17 p.m. UTC | #3
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi Thomas,

Old mail ..

 Thomas> Hello,
 Thomas> Le Tue, 05 Jun 2012 01:57:33 +0200,
 Thomas> Arnout Vandecappelle <arnout@mind.be> a écrit :

 >> On 06/02/12 18:13, Thomas Petazzoni wrote:
 >> > +LIBXMLRPC_VERSION = 1.18.05
 >> > +LIBXMLRPC_SOURCE = xmlrpc-c-$(LIBXMLRPC_VERSION).tgz
 >> > +LIBXMLRPC_SITE ="http://xmlrpc-c.svn.sourceforge.net/viewvc/xmlrpc-c/advanced/?view=tar&pathrev=1716"
 >> 
 >> It's a bit strange to use a three-year-old unstable version...
 >> From the website:
 >> 
 >> Latest Tarballs
 >> Series		Number
 >> Development	unnumbered
 >> Advanced	1.30.06
 >> Stable		1.25.16
 >> Super Stable	1.16.41

 Thomas> This package comes from a customer project, and the customer had its
 Thomas> software running with this version, so that's the version I tested. Of
 Thomas> course, packaging more recent versions would be better, but I thought
 Thomas> that having the package would be better than nothing.

 >> A simpler solution would be to just use the svn download method, from
 >> https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable/

 Thomas> Sure, I'll look into that.

Any news on this?
Thomas Petazzoni Jan. 13, 2013, 2:08 p.m. UTC | #4
Dear Peter Korsgaard,

On Sat, 12 Jan 2013 21:17:29 +0100, Peter Korsgaard wrote:

>  >> A simpler solution would be to just use the svn download method, from
>  >> https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable/
> 
>  Thomas> Sure, I'll look into that.
> 
> Any news on this?

At this point, I am no longer that much interested by xmlrpc. It was
for a project on which I'm no longer working, and I don't expect many
people to use this stuff, so I don't want to spend too much time
packaging this.

I'd say you can discard the patch in patchwork, and be done with it :)

Thanks!

Thomas
Peter Korsgaard Jan. 13, 2013, 4:10 p.m. UTC | #5
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> Dear Peter Korsgaard,
 Thomas> On Sat, 12 Jan 2013 21:17:29 +0100, Peter Korsgaard wrote:

 >> >> A simpler solution would be to just use the svn download method, from
 >> >> https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable/
 >> 
 Thomas> Sure, I'll look into that.
 >> 
 >> Any news on this?

 Thomas> At this point, I am no longer that much interested by xmlrpc. It was
 Thomas> for a project on which I'm no longer working, and I don't expect many
 Thomas> people to use this stuff, so I don't want to spend too much time
 Thomas> packaging this.

 Thomas> I'd say you can discard the patch in patchwork, and be done with it :)

Ok, will do.
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 61f3fec..044b59b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -468,6 +468,7 @@  source "package/json-c/Config.in"
 source "package/libroxml/Config.in"
 source "package/libxml-parser-perl/Config.in"
 source "package/libxml2/Config.in"
+source "package/libxmlrpc/Config.in"
 source "package/libxslt/Config.in"
 source "package/libyaml/Config.in"
 source "package/mxml/Config.in"
diff --git a/package/libxmlrpc/Config.in b/package/libxmlrpc/Config.in
new file mode 100644
index 0000000..26e4a52
--- /dev/null
+++ b/package/libxmlrpc/Config.in
@@ -0,0 +1,10 @@ 
+config BR2_PACKAGE_LIBXMLRPC
+	bool "libxmlrpc"
+	select BR2_PACKAGE_LIBCURL
+	help
+	  XML-RPC is a quick-and-easy way to make procedure calls over
+	  the Internet. It converts the procedure call into an XML
+	  document, sends it to a remote server using HTTP, and gets
+	  back the response as XML.
+
+	  http://xmlrpc-c.sourceforge.net/
diff --git a/package/libxmlrpc/libxmlrpc-fix-gennmtab-build.patch b/package/libxmlrpc/libxmlrpc-fix-gennmtab-build.patch
new file mode 100644
index 0000000..8cdd932
--- /dev/null
+++ b/package/libxmlrpc/libxmlrpc-fix-gennmtab-build.patch
@@ -0,0 +1,25 @@ 
+Fix build of host tool
+
+genmtab is a tool that needs to be built for the host as it is used
+during the compilation process of libxmlrpc. Its Makefile needs a bit
+of tuning to use the conventional CC_FOR_BUILD, CFLAGS_FOR_BUILD and
+LDFLAGS_FOR_BUILD variables.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/lib/expat/gennmtab/Makefile
+===================================================================
+--- a/lib/expat/gennmtab/Makefile
++++ b/lib/expat/gennmtab/Makefile
+@@ -40,9 +40,9 @@
+ dep: dep-common
+ 
+ gennmtab.o:%.o:%.c
+-	$(BUILDTOOL_CC) -c $< -o $@ $(CFLAGS_ALL) $(INCLUDES)
++	$(CC_FOR_BUILD) -c $< -o $@ $(CFLAGS_FOR_BUILD) $(INCLUDES)
+ 
+ gennmtab:%:%.o
+-	$(BUILDTOOL_CCLD) -o $@ $(LDFLAGS) $^
++	$(CC_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $^
+ 
+ include depend.mk
diff --git a/package/libxmlrpc/libxmlrpc-fix-non-cplusplus-build.patch b/package/libxmlrpc/libxmlrpc-fix-non-cplusplus-build.patch
new file mode 100644
index 0000000..ed47ff7
--- /dev/null
+++ b/package/libxmlrpc/libxmlrpc-fix-non-cplusplus-build.patch
@@ -0,0 +1,27 @@ 
+Handle builds without C++
+
+libxmlrpc nicely handles the fact of being built without C++ support,
+except for one location, fixed by this patch.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/lib/util/Makefile
+===================================================================
+--- a/lib/util/Makefile
++++ b/lib/util/Makefile
+@@ -36,11 +36,14 @@
+ LIBOBJS = \
+   casprintf.o \
+   cmdline_parser.o \
+-  cmdline_parser_cpp.o \
+   getoptx.o \
+   string_parser.o \
+   stripcaseeq.o \
+ 
++ifeq ($(ENABLE_CPLUSPLUS),yes)
++LIBOBJS += cmdline_parser_cpp.o
++endif
++
+ .PHONY: all
+ all: $(LIBOBJS)
+ 
diff --git a/package/libxmlrpc/libxmlrpc-fix-non-wchar-build.patch b/package/libxmlrpc/libxmlrpc-fix-non-wchar-build.patch
new file mode 100644
index 0000000..7df1fc8
--- /dev/null
+++ b/package/libxmlrpc/libxmlrpc-fix-non-wchar-build.patch
@@ -0,0 +1,24 @@ 
+Disable wide-char specific code
+
+The vast majority of the libxmlrpc code nicely handles the absence of
+wide char support, except at one location, which is fixed by this
+patch.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/src/xmlrpc_decompose.c
+===================================================================
+--- a/src/xmlrpc_decompose.c
++++ b/src/xmlrpc_decompose.c
+@@ -221,7 +221,11 @@
+         xmlrpc_strfree(*decompRootP->store.Tstring.valueP);
+         break;
+     case 'w':
++#if HAVE_UNICODE_WCHAR
+         free((void*)*decompRootP->store.TwideString.valueP);
++#else
++	XMLRPC_ASSERT(false);
++#endif
+         break;
+     case '6':
+         free((void*)*decompRootP->store.TbitString.valueP);
diff --git a/package/libxmlrpc/libxmlrpc-remove-curl-types-h-include.patch b/package/libxmlrpc/libxmlrpc-remove-curl-types-h-include.patch
new file mode 100644
index 0000000..3688bd3
--- /dev/null
+++ b/package/libxmlrpc/libxmlrpc-remove-curl-types-h-include.patch
@@ -0,0 +1,43 @@ 
+Do not include <curl/types.h>
+
+In recent versions of Curl, <curl/types.h> no longer exists, and
+<curl/curl.h> should be used instead.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/lib/curl_transport/curlmulti.c
+===================================================================
+--- a/lib/curl_transport/curlmulti.c
++++ b/lib/curl_transport/curlmulti.c
+@@ -19,7 +19,6 @@
+ #endif
+ 
+ #include <curl/curl.h>
+-#include <curl/types.h>
+ #include <curl/easy.h>
+ #include <curl/multi.h>
+ 
+Index: b/lib/curl_transport/curltransaction.c
+===================================================================
+--- a/lib/curl_transport/curltransaction.c
++++ b/lib/curl_transport/curltransaction.c
+@@ -17,7 +17,6 @@
+ #include "version.h"
+ 
+ #include <curl/curl.h>
+-#include <curl/types.h>
+ #include <curl/easy.h>
+ 
+ #include "curlversion.h"
+Index: b/lib/curl_transport/xmlrpc_curl_transport.c
+===================================================================
+--- a/lib/curl_transport/xmlrpc_curl_transport.c
++++ b/lib/curl_transport/xmlrpc_curl_transport.c
+@@ -85,7 +85,6 @@
+ #include "xmlrpc-c/time_int.h"
+ 
+ #include <curl/curl.h>
+-#include <curl/types.h>
+ #include <curl/easy.h>
+ #include <curl/multi.h>
+ 
diff --git a/package/libxmlrpc/libxmlrpc-use-correct-curl-config.patch b/package/libxmlrpc/libxmlrpc-use-correct-curl-config.patch
new file mode 100644
index 0000000..55b72a1
--- /dev/null
+++ b/package/libxmlrpc/libxmlrpc-use-correct-curl-config.patch
@@ -0,0 +1,22 @@ 
+Use correct curl-config program
+
+Instead of calling again curl-config in src/Makefile (which ends up
+calling the wrong curl-config: the one in the PATH instead of the one
+pointed at by the environment variables at configure time), let's use
+the CURL_LDADD variable which was computed at configure time.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/src/Makefile
+===================================================================
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -56,7 +56,7 @@
+   TRANSPORT_MODS += $(BLDDIR)/lib/curl_transport/curltransaction
+   TRANSPORT_MODS += $(BLDDIR)/lib/curl_transport/curlmulti
+   TRANSPORT_MODS += $(BLDDIR)/lib/curl_transport/lock_pthread
+-  TRANSPORT_LIBDEP += $(shell curl-config --libs)
++  TRANSPORT_LIBDEP += $(CURL_LDADD)
+ endif
+ ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
+   TRANSPORT_MODS += $(BLDDIR)/lib/libwww_transport/xmlrpc_libwww_transport
diff --git a/package/libxmlrpc/libxmlrpc.mk b/package/libxmlrpc/libxmlrpc.mk
new file mode 100644
index 0000000..8c9fe49
--- /dev/null
+++ b/package/libxmlrpc/libxmlrpc.mk
@@ -0,0 +1,44 @@ 
+#############################################################
+#
+# libxmlrpc
+#
+#############################################################
+LIBXMLRPC_VERSION = 1.18.05
+LIBXMLRPC_SOURCE = xmlrpc-c-$(LIBXMLRPC_VERSION).tgz
+LIBXMLRPC_SITE = "http://xmlrpc-c.svn.sourceforge.net/viewvc/xmlrpc-c/advanced/?view=tar&pathrev=1716"
+LIBXMLRPC_INSTALL_STAGING = YES
+LIBXMLRPC_DEPENDENCIES = libcurl
+LIBXMLRPC_MAKE = $(MAKE1)
+
+LIBXMLRPC_CONF_OPT = \
+	$(if $(BR2_USE_WCHAR),,ac_cv_header_wchar_h=no) \
+	$(if $(BR2_INSTALL_LIBSTDCPP),,--disable-cplusplus) \
+	have_curl_config=$(STAGING_DIR)/usr/bin/curl-config \
+	CURL_CONFIG=$(STAGING_DIR)/usr/bin/curl-config
+
+# Our package uses autoconf, but not automake, so we need to pass
+# those variables at compile time as well.
+LIBXMLRPC_MAKE_ENV = \
+	CC_FOR_BUILD="$(HOSTCC)" \
+	LD_FOR_BUILD="$(HOSTLD)" \
+	CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
+	LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)"
+
+define LIBXMLRPC_REMOVE_DEVFILE
+	$(RM) $(TARGET_DIR)/usr/bin/xmlrpc-c-config
+endef
+
+ifeq ($(BR2_HAVE_DEVFILES),)
+LIBXMLRPC_POST_INSTALL_TARGET_HOOKS += LIBXMLRPC_REMOVE_DEVFILE
+endif
+
+$(eval $(call AUTOTARGETS))
+
+# Override the download step since we don't have the normal
+# site/source split (where site is the URL of the directory and source
+# is the name of the tarball file).
+$(LIBXMLRPC_DIR)/.stamp_downloaded:
+	$(Q)$(call MESSAGE,"Downloading")
+	$(call DOWNLOAD,$(LIBXMLRPC_SITE),$(LIBXMLRPC_SOURCE))
+	$(Q)mkdir -p $(@D)
+	$(Q)touch $@