]> code.ossystems Code Review - openembedded-core.git/commitdiff
sat-solver: Fix build on uclibc
authorKhem Raj <raj.khem@gmail.com>
Mon, 4 Jun 2012 22:06:52 +0000 (15:06 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 Jun 2012 14:54:18 +0000 (15:54 +0100)
futimes is not available on uclibc so use utimes
qsort is also not as expected by sat-solver therefore
for uclibc we resort to using internal version of
qsort

Signed-off-by: Khem Raj <raj.khem@gmail.com>
meta/recipes-extended/sat-solver/sat-solver/futimes.patch [new file with mode: 0644]
meta/recipes-extended/sat-solver/sat-solver_git.bb

diff --git a/meta/recipes-extended/sat-solver/sat-solver/futimes.patch b/meta/recipes-extended/sat-solver/sat-solver/futimes.patch
new file mode 100644 (file)
index 0000000..b24d852
--- /dev/null
@@ -0,0 +1,32 @@
+This patch uses utimes instead of futimes for uclibc
+since futimes is not available
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: git/examples/solv.c
+===================================================================
+--- git.orig/examples/solv.c   2012-06-01 12:06:22.041552848 -0700
++++ git/examples/solv.c        2012-06-01 12:49:17.417677449 -0700
+@@ -1027,7 +1027,8 @@
+   int flags;
+   cinfo = repo->appdata;
+-  if (!(fp = fopen(calccachepath(repo, repoext), "r")))
++  const char* fname = calccachepath(repo, repoext);
++  if (!(fp = fopen(fname, "r")))
+     return 0;
+   if (fseek(fp, -sizeof(mycookie), SEEK_END) || fread(mycookie, sizeof(mycookie), 1, fp) != 1)
+     {
+@@ -1068,7 +1069,11 @@
+       memcpy(cinfo->extcookie, myextcookie, sizeof(myextcookie));
+     }
+   if (mark)
++#ifdef __UCLIBC__
++    utimes(fname, 0); /* try to set modification time */
++#else
+     futimes(fileno(fp), 0);   /* try to set modification time */
++#endif
+   fclose(fp);
+   return 1;
+ }
index b0382f6af0e8cec40b08eb2b602a40f5e15f2fa1..e1054e9e22907f61f3f159b7fce34e6f400de0b7 100644 (file)
@@ -20,6 +20,7 @@ SRC_URI = "git://github.com/openSUSE/sat-solver.git;protocol=git \
            file://sat-solver_core.patch \
            file://fix_gcc-4.6.0_compile_issue.patch \
            file://0001-sat_xfopen.c-Forward-port-to-zlib-1.2.6-gzFile.patch \
+           file://futimes.patch \
           "
 
 S = "${WORKDIR}/git"
@@ -28,6 +29,8 @@ EXTRA_OECMAKE += "-DRPM5=RPM5 -DOE_CORE=OE_CORE"
 
 EXTRA_OECMAKE += " -DLIB=${@os.path.basename('${libdir}')}"
 
+TUNE_CCARGS_append_libc-uclibc = " -DUSE_OWN_QSORT=1 "
+
 inherit cmake pkgconfig
 
 RDEPENDS_${PN} = "rpm-libs"