diff options
-rw-r--r-- | user/libsoup/APKBUILD | 14 | ||||
-rw-r--r-- | user/libsoup/musl.patch | 189 |
2 files changed, 200 insertions, 3 deletions
diff --git a/user/libsoup/APKBUILD b/user/libsoup/APKBUILD index dc5d4c132..7a99e06e3 100644 --- a/user/libsoup/APKBUILD +++ b/user/libsoup/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Sheila Aman <sheila@vulpine.house> # Maintainer: Sheila Aman <sheila@vulpine.house> pkgname=libsoup -pkgver=2.70.0 +pkgver=2.74.2 pkgrel=0 pkgdesc="GObject-based HTTP library" url="https://wiki.gnome.org/Projects/libsoup" @@ -12,12 +12,19 @@ depends="" makedepends="glib-dev libxml2-dev sqlite-dev libpsl-dev intltool vala-dev gobject-introspection-dev glib-networking meson ninja krb5-dev" subpackages="$pkgname-dev $pkgname-lang" -source="https://download.gnome.org/sources/libsoup/${pkgver%.*}/libsoup-$pkgver.tar.xz" +source="https://download.gnome.org/sources/libsoup/${pkgver%.*}/libsoup-$pkgver.tar.xz + musl.patch + " # secfixes: # 2.68.2-r0: # - CVE-2019-17266 +prepare() { + meson subprojects download + default_prepare +} + build() { meson -Dprefix=/usr build ninja -C build @@ -31,4 +38,5 @@ package() { DESTDIR="$pkgdir" ninja -C build install } -sha512sums="c3e2a963f4b38b2eee5d772b68a325c076fde19c26413bb3ada91824d3c7e108fbc325bfdc49a28141a641233485d3044d18142720c2aebaa7cc820f8718159b libsoup-2.70.0.tar.xz" +sha512sums="6f9da3296364e210103093cef9ef34fb40f694a8ef90966fc1fbd834c11f3db1031784a0901e9181bf3124e0682708148bd3598a31d60f1cce61eaae2e19ba7a libsoup-2.74.2.tar.xz +39edda5e49afbab5ba2f368b6e1536d195509b7ce26f9cc75b4f1d3aa53e78bd59abc9a4dc6258cf16f236590f11065f4463777c3e49e88cf64ab3c1bb9cb347 musl.patch" diff --git a/user/libsoup/musl.patch b/user/libsoup/musl.patch new file mode 100644 index 000000000..8de29f689 --- /dev/null +++ b/user/libsoup/musl.patch @@ -0,0 +1,189 @@ +From 50439c9ca9a52f39681fb81bd6768f306125516a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= + <congdanhqx@gmail.com> +Date: Tue, 15 Sep 2020 08:21:50 +0700 +Subject: [PATCH 1/3] compat: add fallback implementation for reallocarray(3) + +ZV: This is from https://gitlab.gnome.org/GNOME/sysprof/-/merge_requests/37.patch + modified to remove the meson-related bits, and add 'subprojects/sysprof' +--- + src/libsysprof-capture/sysprof-capture-cursor.c | 4 +++- + src/libsysprof-capture/sysprof-capture-reader.c | 2 +- + .../sysprof-capture-util-private.h | 8 ++++++++ + src/libsysprof-capture/sysprof-capture-util.c | 13 +++++++++++++ + src/libsysprof-capture/sysprof-capture-writer-cat.c | 7 ++++--- + 6 files changed, 30 insertions(+), 5 deletions(-) + +diff --git a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-cursor.c b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-cursor.c +index 24563f0a..cf11bcd5 100644 +--- a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-cursor.c ++++ b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-cursor.c +@@ -293,7 +293,9 @@ sysprof_capture_cursor_add_condition (SysprofCaptureCursor *self, + * + * FIXME: There’s currently no error reporting from this function, so ENOMEM + * results in an abort. */ +- self->conditions = reallocarray (self->conditions, ++self->n_conditions, sizeof (*self->conditions)); ++ self->conditions = _sysprof_reallocarray (self->conditions, ++ ++self->n_conditions, ++ sizeof (*self->conditions)); + assert (self->conditions != NULL); + + self->conditions[self->n_conditions - 1] = sysprof_steal_pointer (&condition); +diff --git a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-reader.c b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-reader.c +index 67c6b28b..9a5aa912 100644 +--- a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-reader.c ++++ b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-reader.c +@@ -1270,7 +1270,7 @@ array_append (const char ***files, + const char **new_files; + + *n_files_allocated = (*n_files_allocated > 0) ? 2 * *n_files_allocated : 4; +- new_files = reallocarray (*files, *n_files_allocated, sizeof (**files)); ++ new_files = _sysprof_reallocarray (*files, *n_files_allocated, sizeof (**files)); + if (new_files == NULL) + return false; + *files = new_files; +diff --git a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util-private.h b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util-private.h +index 1b1d93e9..13ec1eed 100644 +--- a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util-private.h ++++ b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util-private.h +@@ -108,3 +108,11 @@ size_t _sysprof_strlcpy (char *dest, + const char *src, + size_t dest_size); + #endif ++ ++#ifdef HAVE_REALLOCARRAY ++# define _sysprof_reallocarray(p,m,n) reallocarray(p,m,n) ++#else ++void *_sysprof_reallocarray (void *ptr, ++ size_t m, ++ size_t n); ++#endif +diff --git a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util.c b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util.c +index 0bbea06a..acb71acf 100644 +--- a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util.c ++++ b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util.c +@@ -58,6 +58,7 @@ + + #include <assert.h> + #include <errno.h> ++#include <stdint.h> + #include <unistd.h> + + #ifdef _WIN32 +@@ -253,3 +254,15 @@ size_t + + return i; + } ++ ++void * ++(_sysprof_reallocarray) (void *ptr, ++ size_t m, ++ size_t n) ++{ ++ if (n && m > (size_t)(-1) / n) { ++ errno = ENOMEM; ++ return NULL; ++ } ++ return realloc(ptr, m * n); ++} +diff --git a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-writer-cat.c b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-writer-cat.c +index 66171b92..a157ed73 100644 +--- a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-writer-cat.c ++++ b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-writer-cat.c +@@ -64,6 +64,7 @@ + #include <unistd.h> + + #include "sysprof-capture.h" ++#include "sysprof-capture-util-private.h" + #include "sysprof-macros-internal.h" + + typedef struct +@@ -133,7 +134,7 @@ translate_table_add (TranslateTable *tables, + if (table_ptr->n_items == table_ptr->n_items_allocated) + { + table_ptr->n_items_allocated = (table_ptr->n_items_allocated > 0) ? table_ptr->n_items_allocated * 2 : 4; +- table_ptr->items = reallocarray (table_ptr->items, table_ptr->n_items_allocated, sizeof (*table_ptr->items)); ++ table_ptr->items = _sysprof_reallocarray (table_ptr->items, table_ptr->n_items_allocated, sizeof (*table_ptr->items)); + assert (table_ptr->items != NULL); + } + +@@ -481,8 +482,8 @@ sysprof_capture_writer_cat (SysprofCaptureWriter *self, + if (n_elements == n_elements_allocated) + { + n_elements_allocated = (n_elements_allocated > 0) ? n_elements_allocated * 2 : 4; +- ids = reallocarray (ids, n_elements_allocated, sizeof (*ids)); +- values = reallocarray (values, n_elements_allocated, sizeof (*values)); ++ ids = _sysprof_reallocarray (ids, n_elements_allocated, sizeof (*ids)); ++ values = _sysprof_reallocarray (values, n_elements_allocated, sizeof (*values)); + if (ids == NULL || values == NULL) + goto panic; + } +-- +GitLab + + +From 429223635e5a9a1de7903465ae1e8a5eb6d61be9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= + <congdanhqx@gmail.com> +Date: Tue, 15 Sep 2020 08:47:12 +0700 +Subject: [PATCH 2/3] compat: add TEMP_FAILURE_RETRY compatiable implementation + +--- + src/libsysprof-capture/sysprof-capture-util-private.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util-private.h b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util-private.h +index 13ec1eed..6181212c 100644 +--- a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util-private.h ++++ b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-util-private.h +@@ -60,10 +60,19 @@ + # include <sys/sendfile.h> + #endif + ++#include <errno.h> + #include <stdlib.h> + #include <string.h> + #include <unistd.h> + ++#ifndef TEMP_FAILURE_RETRY ++#define TEMP_FAILURE_RETRY(expression) \ ++ ({ long int __result; \ ++ do { __result = (long int) (expression); } \ ++ while (__result == -1L && errno == EINTR); \ ++ __result; }) ++#endif ++ + static inline void * + sysprof_malloc0 (size_t size) + { +-- +GitLab + + +From 088408c085e5d668c872769391787481875293a6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= + <congdanhqx@gmail.com> +Date: Tue, 15 Sep 2020 20:51:28 +0700 +Subject: [PATCH 3/3] sysprof-capture-condition: always return even if + unreachable + +Fix the problem with -Werror=return-type +--- + src/libsysprof-capture/sysprof-capture-condition.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-condition.c b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-condition.c +index 8f891577..4b829a98 100644 +--- a/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-condition.c ++++ b/subprojects/sysprof/src/libsysprof-capture/sysprof-capture-condition.c +@@ -269,6 +269,7 @@ sysprof_capture_condition_copy (const SysprofCaptureCondition *self) + } + + sysprof_assert_not_reached (); ++ return NULL; + } + + static void +-- +GitLab + |