diff options
Diffstat (limited to 'meta/recipes-extended/libsolv')
6 files changed, 67 insertions, 421 deletions
diff --git a/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch b/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch deleted file mode 100644 index a575d0ebce..0000000000 --- a/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch +++ /dev/null @@ -1,250 +0,0 @@ -From 4d9b6ec30b78d00ead0a22eb5d047dcdba37e99c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?= - =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?= - <ngompa13@gmail.com> -Date: Wed, 11 Nov 2015 20:32:17 -0500 -Subject: [PATCH 1/2] Add fallback fopencookie() implementation - -In environments where neither fopencookie() nor funopen() -are implemented, we need to provide a suitable implementation -of fopencookie() that we can use. - -Alex Kanavin: rebased CMakeLists.txt change to apply to latest upstream code. - -Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - ext/CMakeLists.txt | 7 ++ - ext/solv_xfopen.c | 10 +-- - ext/solv_xfopen_fallback_fopencookie.c | 123 +++++++++++++++++++++++++++++++++ - ext/solv_xfopen_fallback_fopencookie.h | 28 ++++++++ - 4 files changed, 164 insertions(+), 4 deletions(-) - create mode 100644 ext/solv_xfopen_fallback_fopencookie.c - create mode 100644 ext/solv_xfopen_fallback_fopencookie.h - -diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt -index 586eda8..477a2ef 100644 ---- a/ext/CMakeLists.txt -+++ b/ext/CMakeLists.txt -@@ -4,6 +4,13 @@ SET (libsolvext_SRCS - SET (libsolvext_HEADERS - tools_util.h solv_xfopen.h testcase.h) - -+IF (NOT HAVE_FOPENCOOKIE AND NOT HAVE_FUNOPEN) -+ SET (libsolvext_SRCS ${libsolvext_SRCS} -+ solv_xfopen_fallback_fopencookie.c) -+ SET (libsolvext_HEADERS ${libsolvext_HEADERS} -+ solv_xfopen_fallback_fopencookie.h) -+ENDIF (NOT HAVE_FOPENCOOKIE AND NOT HAVE_FUNOPEN) -+ - IF (ENABLE_RPMDB OR ENABLE_RPMPKG) - SET (libsolvext_SRCS ${libsolvext_SRCS} - pool_fileconflicts.c repo_rpmdb.c) -diff --git a/ext/solv_xfopen.c b/ext/solv_xfopen.c -index b0421bf..31345dd 100644 ---- a/ext/solv_xfopen.c -+++ b/ext/solv_xfopen.c -@@ -13,6 +13,10 @@ - #include <zlib.h> - #include <fcntl.h> - -+#if !defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE) -+#include "solv_xfopen_fallback_fopencookie.h" -+#endif -+ - #include "solv_xfopen.h" - #include "util.h" - -@@ -39,7 +43,7 @@ static FILE *cookieopen(void *cookie, const char *mode, - ssize_t (*cwrite)(void *, const char *, size_t), - int (*cclose)(void *)) - { --#ifdef HAVE_FUNOPEN -+#if defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE) - if (!cookie) - return 0; - return funopen(cookie, -@@ -48,7 +52,7 @@ static FILE *cookieopen(void *cookie, const char *mode, - (fpos_t (*)(void *, fpos_t, int))NULL, /* seekfn */ - cclose - ); --#elif defined(HAVE_FOPENCOOKIE) -+#else - cookie_io_functions_t cio; - - if (!cookie) -@@ -60,8 +64,6 @@ static FILE *cookieopen(void *cookie, const char *mode, - cio.write = cwrite; - cio.close = cclose; - return fopencookie(cookie, *mode == 'w' ? "w" : "r", cio); --#else --# error Need to implement custom I/O - #endif - } - -diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c -new file mode 100644 -index 0000000..0ce2571 ---- /dev/null -+++ b/ext/solv_xfopen_fallback_fopencookie.c -@@ -0,0 +1,123 @@ -+/* -+ * Provides a very limited fopencookie() for environments with a libc -+ * that lacks it. -+ * -+ * Author: zhasha -+ * Modified for libsolv by Neal Gompa -+ * -+ * This program is licensed under the BSD license, read LICENSE.BSD -+ * for further information. -+ * -+ */ -+ -+#define _LARGEFILE64_SOURCE 1 -+#include <pthread.h> -+#include <stdio.h> -+#include <stdlib.h> -+#include <unistd.h> -+#include <fcntl.h> -+#include <sys/types.h> -+#include <errno.h> -+#include "solv_xfopen_fallback_fopencookie.h" -+ -+extern int pipe2(int[2], int); -+ -+struct ctx { -+ int fd; -+ void *cookie; -+ struct cookie_io_functions_t io; -+ char buf[1024]; -+}; -+ -+static void *proxy(void *arg) -+{ -+ struct ctx *ctx = arg; -+ ssize_t r; -+ size_t n; -+ -+ pthread_detach(pthread_self()); -+ -+ while (1) { -+ r = ctx->io.read ? -+ (ctx->io.read)(ctx->cookie, ctx->buf, sizeof(ctx->buf)) : -+ read(ctx->fd, ctx->buf, sizeof(ctx->buf)); -+ if (r < 0) { -+ if (errno != EINTR) { break; } -+ continue; -+ } -+ if (r == 0) { break; } -+ -+ while (n > 0) { -+ r = ctx->io.write ? -+ (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) : -+ write(ctx->fd, ctx->buf + ((size_t)r - n), n); -+ if (r < 0) { -+ if (errno != EINTR) { break; } -+ continue; -+ } -+ if (r == 0) { break; } -+ -+ n -= (size_t)r; -+ } -+ if (n > 0) { break; } -+ } -+ -+ if (ctx->io.close) { (ctx->io.close)(ctx->cookie); } -+ close(ctx->fd); -+ return NULL; -+} -+ -+FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t io) -+{ -+ struct ctx *ctx = NULL; -+ int rd = 0, wr = 0; -+ int p[2] = { -1, -1 }; -+ FILE *f = NULL; -+ pthread_t dummy; -+ -+ switch (mode[0]) { -+ case 'a': -+ case 'r': rd = 1; break; -+ case 'w': wr = 1; break; -+ default: -+ errno = EINVAL; -+ return NULL; -+ } -+ switch (mode[1]) { -+ case '\0': break; -+ case '+': -+ if (mode[2] == '\0') { -+ errno = ENOTSUP; -+ return NULL; -+ } -+ default: -+ errno = EINVAL; -+ return NULL; -+ } -+ if (io.seek) { -+ errno = ENOTSUP; -+ return NULL; -+ } -+ -+ ctx = malloc(sizeof(*ctx)); -+ if (!ctx) { return NULL; } -+ if (pipe2(p, O_CLOEXEC) != 0) { goto err; } -+ if ((f = fdopen(p[wr], mode)) == NULL) { goto err; } -+ p[wr] = -1; -+ ctx->fd = p[rd]; -+ ctx->cookie = cookie; -+ ctx->io.read = rd ? io.read : NULL; -+ ctx->io.write = wr ? io.write : NULL; -+ ctx->io.seek = NULL; -+ ctx->io.close = io.close; -+ if (pthread_create(&dummy, NULL, proxy, ctx) != 0) { goto err; } -+ -+ return f; -+ -+err: -+ if (p[0] >= 0) { close(p[0]); } -+ if (p[1] >= 0) { close(p[1]); } -+ if (f) { fclose(f); } -+ free(ctx); -+ return NULL; -+} -diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h -new file mode 100644 -index 0000000..6a7bfee ---- /dev/null -+++ b/ext/solv_xfopen_fallback_fopencookie.h -@@ -0,0 +1,28 @@ -+/* -+ * Provides a very limited fopencookie() for environments with a libc -+ * that lacks it. -+ * -+ * Author: zhasha -+ * Modified for libsolv by Neal Gompa -+ * -+ * This program is licensed under the BSD license, read LICENSE.BSD -+ * for further information. -+ * -+ */ -+ -+#ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H -+#define SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H -+ -+#include <stdio.h> -+#include <stdint.h> -+ -+typedef struct cookie_io_functions_t { -+ ssize_t (*read)(void *, char *, size_t); -+ ssize_t (*write)(void *, const char *, size_t); -+ int (*seek)(void *, off64_t, int); -+ int (*close)(void *); -+} cookie_io_functions_t; -+ -+FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t io); -+ -+#endif --- -2.11.0 - diff --git a/meta/recipes-extended/libsolv/libsolv/0001-repo_rpmdb.c-increase-MAX_HDR_CNT-and-MAX_HDR_DSIZE.patch b/meta/recipes-extended/libsolv/libsolv/0001-repo_rpmdb.c-increase-MAX_HDR_CNT-and-MAX_HDR_DSIZE.patch deleted file mode 100644 index 4a4e5cba25..0000000000 --- a/meta/recipes-extended/libsolv/libsolv/0001-repo_rpmdb.c-increase-MAX_HDR_CNT-and-MAX_HDR_DSIZE.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 1c4c935cb73ac1ccb9693df1a51ba218a22e8ca8 Mon Sep 17 00:00:00 2001 -From: Ming Liu <liu.ming50@gmail.com> -Date: Sat, 30 Sep 2017 11:15:16 +0800 -Subject: [PATCH] repo_rpmdb.c: increase MAX_HDR_CNT and MAX_HDR_DSIZE - -Upstream-Status: Submitted [https://github.com/openSUSE/libsolv/pull/230] - -We encountered 'corrupt rpm' issues when installing extreme big RPM -packages like the kernel-devsrc package of Yocto project. - -It can be fixed by increasing MAX_HDR_CNT and MAX_HDR_DSIZE per test. - -Signed-off-by: Ming Liu <liu.ming50@gmail.com> ---- - ext/repo_rpmdb.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c -index c7000a9..7000835 100644 ---- a/ext/repo_rpmdb.c -+++ b/ext/repo_rpmdb.c -@@ -170,8 +170,8 @@ - #define MAX_SIG_CNT 0x100000 - #define MAX_SIG_DSIZE 0x100000 - --#define MAX_HDR_CNT 0x100000 --#define MAX_HDR_DSIZE 0x2000000 -+#define MAX_HDR_CNT 0x200000 -+#define MAX_HDR_DSIZE 0x4000000 - - typedef struct rpmhead { - int cnt; --- -2.7.4 - diff --git a/meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch b/meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch new file mode 100644 index 0000000000..6f0dea2e9c --- /dev/null +++ b/meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch @@ -0,0 +1,34 @@ +From 06321f1a2aa89b8e028946e793344657eaad0165 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 28 Oct 2021 22:28:45 -0700 +Subject: [PATCH] utils: Conside musl when wrapping qsort_r + +musl now has implemented qsort_r, the signature however matches glibc +and not BSD, current check makes it such that it falls into BSD case +when building for musl, which clearly is wrong, therefore instead of +just checking for glibc check for linux to decide which qsort_r +signature to use. This covers both glibc and musl + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/util.c b/src/util.c +index 72426e09..8f29bc5a 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -159,7 +159,7 @@ solv_setcloexec(int fd, int state) + + see also: http://sources.redhat.com/ml/libc-alpha/2008-12/msg00003.html + */ +-#if (defined(__GLIBC__) || defined(__NEWLIB__)) && (defined(HAVE_QSORT_R) || defined(HAVE___QSORT_R)) ++#if (defined(__linux__) || defined(__NEWLIB__)) && (defined(HAVE_QSORT_R) || defined(HAVE___QSORT_R)) + + void + solv_sort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *compard) +-- +2.33.1 + diff --git a/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch b/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch deleted file mode 100644 index efb4e3ad7e..0000000000 --- a/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 99b10cdf6a0f8a24e1670c1813b1d9563ae3f5b5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?= - =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?= - <ngompa13@gmail.com> -Date: Mon, 23 Nov 2015 18:19:41 -0500 -Subject: [PATCH 2/2] Fixes to internal fopencookie() implementation - -Credits to the fixes go to nsz on #musl on Freenode, -who gloriously fixed the implementation such that -the tests all pass. - -Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - ext/solv_xfopen_fallback_fopencookie.c | 19 ++++++++++--------- - ext/solv_xfopen_fallback_fopencookie.h | 10 +++++----- - 2 files changed, 15 insertions(+), 14 deletions(-) - -diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c -index 0ce2571..89426a9 100644 ---- a/ext/solv_xfopen_fallback_fopencookie.c -+++ b/ext/solv_xfopen_fallback_fopencookie.c -@@ -1,10 +1,10 @@ --/* -+/* - * Provides a very limited fopencookie() for environments with a libc - * that lacks it. -- * -- * Author: zhasha -+ * -+ * Authors: zhasha & nsz - * Modified for libsolv by Neal Gompa -- * -+ * - * This program is licensed under the BSD license, read LICENSE.BSD - * for further information. - * -@@ -33,7 +33,7 @@ static void *proxy(void *arg) - { - struct ctx *ctx = arg; - ssize_t r; -- size_t n; -+ size_t n, k; - - pthread_detach(pthread_self()); - -@@ -47,17 +47,18 @@ static void *proxy(void *arg) - } - if (r == 0) { break; } - -+ n = r, k = 0; - while (n > 0) { - r = ctx->io.write ? -- (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) : -- write(ctx->fd, ctx->buf + ((size_t)r - n), n); -+ (ctx->io.write)(ctx->cookie, ctx->buf + k, n) : -+ write(ctx->fd, ctx->buf + k, n); - if (r < 0) { - if (errno != EINTR) { break; } - continue; - } - if (r == 0) { break; } - -- n -= (size_t)r; -+ n -= r, k += r; - } - if (n > 0) { break; } - } -@@ -77,8 +78,8 @@ FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t i - - switch (mode[0]) { - case 'a': -- case 'r': rd = 1; break; - case 'w': wr = 1; break; -+ case 'r': rd = 1; break; - default: - errno = EINVAL; - return NULL; -diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h -index 6a7bfee..7223e3f 100644 ---- a/ext/solv_xfopen_fallback_fopencookie.h -+++ b/ext/solv_xfopen_fallback_fopencookie.h -@@ -1,13 +1,13 @@ --/* -+/* - * Provides a very limited fopencookie() for environments with a libc - * that lacks it. -- * -- * Author: zhasha -+ * -+ * Authors: zhasha & nsz - * Modified for libsolv by Neal Gompa -- * -+ * - * This program is licensed under the BSD license, read LICENSE.BSD - * for further information. -- * -+ * - */ - - #ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H --- -2.11.0 - diff --git a/meta/recipes-extended/libsolv/libsolv_0.6.29.bb b/meta/recipes-extended/libsolv/libsolv_0.6.29.bb deleted file mode 100644 index e216921ea4..0000000000 --- a/meta/recipes-extended/libsolv/libsolv_0.6.29.bb +++ /dev/null @@ -1,32 +0,0 @@ -SUMMARY = "Library for solving packages and reading repositories" -HOMEPAGE = "https://github.com/openSUSE/libsolv" -BUGTRACKER = "https://github.com/openSUSE/libsolv/issues" -SECTION = "devel" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8" - -DEPENDS = "expat zlib rpm" - -SRC_URI = "git://github.com/openSUSE/libsolv.git \ - file://0001-repo_rpmdb.c-increase-MAX_HDR_CNT-and-MAX_HDR_DSIZE.patch \ - " -SRC_URI_append_libc-musl = " file://0001-Add-fallback-fopencookie-implementation.patch \ - file://0002-Fixes-to-internal-fopencookie-implementation.patch \ - " - -SRCREV = "765be095eaeaef1b1d2a84f6a0e00d5abf677ae9" -UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)" - -S = "${WORKDIR}/git" - -inherit cmake - -EXTRA_OECMAKE = "-DLIB=${baselib} -DMULTI_SEMANTICS=ON -DENABLE_RPMMD=ON -DENABLE_RPMDB=ON -DENABLE_COMPLEX_DEPS=ON" - -PACKAGES =+ "${PN}-tools ${PN}ext" - -FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibSolv.cmake" -FILES_${PN}-tools = "${bindir}/*" -FILES_${PN}ext = "${libdir}/${PN}ext.so.*" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-extended/libsolv/libsolv_0.7.28.bb b/meta/recipes-extended/libsolv/libsolv_0.7.28.bb new file mode 100644 index 0000000000..201059323a --- /dev/null +++ b/meta/recipes-extended/libsolv/libsolv_0.7.28.bb @@ -0,0 +1,33 @@ +SUMMARY = "Library for solving packages and reading repositories" +DESCRIPTION = "This is libsolv, a free package dependency solver using a satisfiability algorithm for solving packages and reading repositories" +HOMEPAGE = "https://github.com/openSUSE/libsolv" +BUGTRACKER = "https://github.com/openSUSE/libsolv/issues" +SECTION = "devel" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8" + +DEPENDS = "expat zlib zstd" + +SRC_URI = "git://github.com/openSUSE/libsolv.git;branch=master;protocol=https \ + file://0001-utils-Conside-musl-when-wrapping-qsort_r.patch \ +" + +SRCREV = "c8dbb3a77c86600ce09d4f80a504cf4e78a3c359" + +UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)" + +S = "${WORKDIR}/git" + +inherit cmake + +PACKAGECONFIG ??= "${@bb.utils.contains('PACKAGE_CLASSES','package_rpm','rpm','',d)}" +PACKAGECONFIG[rpm] = "-DENABLE_RPMMD=ON -DENABLE_RPMDB=ON,,rpm" + +EXTRA_OECMAKE = "-DMULTI_SEMANTICS=ON -DENABLE_COMPLEX_DEPS=ON -DENABLE_ZSTD_COMPRESSION=ON" + +PACKAGES =+ "${PN}-tools ${PN}ext" + +FILES:${PN}-tools = "${bindir}/*" +FILES:${PN}ext = "${libdir}/${PN}ext.so.*" + +BBCLASSEXTEND = "native nativesdk" |