Patchwork [7/7] libzypp: Fix build with uclibc

login
register
mail settings
Submitter Khem Raj
Date June 4, 2012, 10:21 p.m.
Message ID <048f41bb35e65cb5235eca7b7d1f891517af6827.1338848379.git.raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/29209/
State New
Headers show

Comments

Khem Raj - June 4, 2012, 10:21 p.m.
cstdio is included indrectly with eglibc based systems
but not with uclibc based systems and use of functions
like ::eof are then reported as warnings. Therefore
we include cstdio explicitly.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-extended/libzypp/libzypp/cstdio.patch |   49 ++++++++++++++++++++
 meta/recipes-extended/libzypp/libzypp_git.bb       |   10 +++-
 2 files changed, 57 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-extended/libzypp/libzypp/cstdio.patch

Patch

diff --git a/meta/recipes-extended/libzypp/libzypp/cstdio.patch b/meta/recipes-extended/libzypp/libzypp/cstdio.patch
new file mode 100644
index 0000000..a021d58
--- /dev/null
+++ b/meta/recipes-extended/libzypp/libzypp/cstdio.patch
@@ -0,0 +1,49 @@ 
+include cstdio to get definitions of ::xxx functions which
+are now reported by gcc-4.7 as wanrings and warnings are treated
+as errors
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: git/zypp/ExternalProgram.cc
+===================================================================
+--- git.orig/zypp/ExternalProgram.cc	2012-06-01 16:25:17.098304709 -0700
++++ git/zypp/ExternalProgram.cc	2012-06-01 16:25:37.254305681 -0700
+@@ -22,6 +22,7 @@
+ #include <cstring> // strsignal
+ #include <iostream>
+ #include <sstream>
++#include <cstdio>
+ 
+ #include "zypp/base/Logger.h"
+ #include "zypp/base/String.h"
+Index: git/zypp/PluginScript.cc
+===================================================================
+--- git.orig/zypp/PluginScript.cc	2012-06-01 16:21:37.814294089 -0700
++++ git/zypp/PluginScript.cc	2012-06-01 16:24:41.002302961 -0700
+@@ -14,6 +14,7 @@
+ 
+ #include <iostream>
+ #include <sstream>
++#include <cstdio>
+ 
+ #include "zypp/base/LogTools.h"
+ #include "zypp/base/DefaultIntegral.h"
+@@ -336,7 +337,7 @@
+     if ( fd == -1 )
+       ZYPP_THROW( PluginScriptException( "Bad file descriptor" ) );
+ 
+-    ::clearerr( filep );
++    std::clearerr( filep );
+     std::string data;
+     {
+       PluginDebugBuffer _debug( data ); // dump receive buffer if PLUGIN_DEBUG
+@@ -370,7 +371,7 @@
+ 	    int retval = select( fd+1, &rfds, NULL, NULL, &tv );
+ 	    if ( retval > 0 )	// FD_ISSET( fd, &rfds ) will be true.
+ 	    {
+-	      ::clearerr( filep );
++	      std::clearerr( filep );
+ 	    }
+ 	    else if ( retval == 0 )
+ 	    {
diff --git a/meta/recipes-extended/libzypp/libzypp_git.bb b/meta/recipes-extended/libzypp/libzypp_git.bb
index 3c3a9f0..0fe6114 100644
--- a/meta/recipes-extended/libzypp/libzypp_git.bb
+++ b/meta/recipes-extended/libzypp/libzypp_git.bb
@@ -11,7 +11,7 @@  DEPENDS  = "rpm boost curl libxml2 zlib sat-solver expat openssl udev libproxy"
 S = "${WORKDIR}/git"
 SRCREV = "15b6c52260bbc52b3d8e585e271b67e10cc7c433"
 PV = "0.0-git${SRCPV}"
-PR = "r20"
+PR = "r21"
 
 SRC_URI = "git://github.com/openSUSE/libzypp.git;protocol=git \
            file://no-doc.patch \
@@ -23,6 +23,7 @@  SRC_URI = "git://github.com/openSUSE/libzypp.git;protocol=git \
 	   file://fix_for_compile_wth_gcc-4.6.0.patch \
 	   file://hardcode-lib-fix.patch \
 	   file://close.patch \
+	   file://cstdio.patch \
           "
 
 SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch"
@@ -31,7 +32,10 @@  SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch"
 SRC_URI_append_arm  = " file://arm-workaround-global-constructor.patch"
 
 # rpmdb2solv from sat-solver is run from libzypp
-RDEPENDS_${PN} = "sat-solver rpm-libs gzip gnupg"
+RDEPENDS_${PN} = "sat-solver rpm-libs gzip ${RDEPGNUPG}"
+
+RDEPGNUPG = "gnupg"
+RDEPGNUPG_libc-uclibc = ""
 
 PACKAGES =+ "${PN}-pkgmgt"
 
@@ -45,6 +49,8 @@  FILES_${PN}-pkgmgt = "${bindir}/package-manager \
 
 EXTRA_OECMAKE += " -DLIB=${@os.path.basename('${libdir}')}"
 
+LDFLAGS += "-lpthread"
+
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 AVOID_CONSTRUCTOR = ""