Patchwork [10/16] zypper: Fix build on uclibc

login
register
mail settings
Submitter Khem Raj
Date June 9, 2012, 4:43 p.m.
Message ID <a9beecfdd7dc9928ccd4099d65727cbf93bfd442.1339259893.git.raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/29575/
State New
Headers show

Comments

Khem Raj - June 9, 2012, 4:43 p.m.
uclibc does not have rpmatch() so we define
it if zypper is being compiled for uclibc

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-extended/zypper/zypper/rpmatch.patch |   23 +++++++++++++++++++++
 meta/recipes-extended/zypper/zypper_git.bb        |    4 ++-
 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-extended/zypper/zypper/rpmatch.patch

Patch

diff --git a/meta/recipes-extended/zypper/zypper/rpmatch.patch b/meta/recipes-extended/zypper/zypper/rpmatch.patch
new file mode 100644
index 0000000..a750a3b
--- /dev/null
+++ b/meta/recipes-extended/zypper/zypper/rpmatch.patch
@@ -0,0 +1,23 @@ 
+rpmatch() is missing in uclibc so we provide a local definition
+in form of a macro
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: git/src/utils/prompt.h
+===================================================================
+--- git.orig/src/utils/prompt.h	2012-06-06 15:51:00.899112775 -0700
++++ git/src/utils/prompt.h	2012-06-06 15:52:17.003116762 -0700
+@@ -172,4 +172,12 @@
+   return errstr;
+ }
+ 
++#ifdef __UCLIBC__
++#define rpmatch(line) \
++       ( (line == NULL)? -1 : \
++         (*line == 'y' || *line == 'Y')? 1 : \
++         (*line == 'n' || *line == 'N')? 0 : \
++         -1 )
++#endif /* __UCLIBC__ */
++
+ #endif /*ZYPPERPROMPT_H_*/
diff --git a/meta/recipes-extended/zypper/zypper_git.bb b/meta/recipes-extended/zypper/zypper_git.bb
index 56ccc86..c5d7c61 100644
--- a/meta/recipes-extended/zypper/zypper_git.bb
+++ b/meta/recipes-extended/zypper/zypper_git.bb
@@ -5,7 +5,7 @@  LICENSE  = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=3201406e350b39e05a82e28b5020f413"
 
 DEPENDS  = "libzypp augeas"
-PR = "r2"
+PR = "r3"
 SRCREV = "2c5bb6ceb99ecd950ef993e43d77bf0569ea0582"
 
 inherit cmake
@@ -16,6 +16,7 @@  SRC_URI = "git://github.com/openSUSE/zypper.git;protocol=git \
            file://dso_linking_change_build_fix.patch \
            file://rpm5-flag.patch \
            file://gcc-scope.patch \
+           file://rpmatch.patch \
           "
 S = "${WORKDIR}/git"
 
@@ -25,3 +26,4 @@  RDEPENDS_${PN} = "rpm-libs"
 RRECOMMENDS_${PN} = "procps util-linux-uuidgen"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
+OECMAKE_CXX_LINK_FLAGS_libc-uclibc += "-lintl"