From fc0d447adbd2e7d5127d38a87b1b9f5e67d048ba Mon Sep 17 00:00:00 2001 From: Fabian Dellwing Date: Wed, 17 Apr 2024 19:35:43 +0200 Subject: [PATCH] Ports: Update `jq` to 1.7.1 --- Ports/AvailablePorts.md | 2 +- Ports/jq/package.sh | 25 +++++-------- ...ure-assume-all-dependencies-are-okay.patch | 24 ------------- ...-return-a-dummy-allocation-for-zero.patch} | 6 ++-- ...k-to-bundled-strptime-implementation.patch | 36 +++++++++++++++++++ Ports/jq/patches/ReadMe.md | 12 +++---- 6 files changed, 55 insertions(+), 50 deletions(-) delete mode 100644 Ports/jq/patches/0001-Make-configure-assume-all-dependencies-are-okay.patch rename Ports/jq/patches/{0002-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch => 0001-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch} (80%) create mode 100644 Ports/jq/patches/0002-Fallback-to-bundled-strptime-implementation.patch diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 7f3b6df280a..b71e7dfdb4b 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -131,7 +131,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`jfduke3d`](jfduke3d/) | JonoF's Duke Nukem 3D Port | 41cd46b | https://github.com/jonof/jfduke3d | | [`joe`](joe/) | joe's own editor | 4.6 | https://joe-editor.sourceforge.io/ | | [`jot`](jot/) | jot (OpenBSD) | 6.6 | https://github.com/ibara/libpuffy | -| [`jq`](jq/) | jq | 1.6 | https://stedolan.github.io/jq/ | +| [`jq`](jq/) | jq | 1.7.1 | https://jqlang.github.io/jq/ | | [`julius`](julius/) | julius | 1.7.0 | https://github.com/bvschaik/julius | | [`kakoune`](kakoune/) | Modal text editor | e605ad8 | https://github.com/mawww/kakoune | | [`klong`](klong/) | Klong | 20220315 | https://t3x.org/klong/ | diff --git a/Ports/jq/package.sh b/Ports/jq/package.sh index 63356c7ab18..504e0d9d247 100755 --- a/Ports/jq/package.sh +++ b/Ports/jq/package.sh @@ -1,19 +1,12 @@ #!/usr/bin/env -S bash ../.port_include.sh -port=jq -version=1.6 -useconfigure=true -configopts=("--with-oniguruma=builtin" "--disable-maintainer-mode") +port='jq' +version='1.7.1' +useconfigure='true' +use_fresh_config_sub='true' +config_sub_paths=('config/config.sub') files=( - "https://github.com/stedolan/jq/releases/download/jq-${version}/jq-${version}.tar.gz#5de8c8e29aaa3fb9cc6b47bb27299f271354ebb72514e3accadc7d38b5bbaa72" + "https://github.com/jqlang/jq/releases/download/jq-${version}/jq-${version}.tar.gz#478c9ca129fd2e3443fe27314b455e211e0d8c60bc8ff7df703873deeee580c2" +) +depends=( + 'oniguruma' ) -makeopts=("LDFLAGS=-all-static") -use_fresh_config_sub=true -config_sub_paths=("config/config.sub" "modules/oniguruma/config.sub") - -pre_configure() { - # FIXME: The maintainer forgot to run autoconf before creating the tarball. - # Remove this when the next update is released. - pushd $workdir/modules/oniguruma - autoreconf -i - popd -} diff --git a/Ports/jq/patches/0001-Make-configure-assume-all-dependencies-are-okay.patch b/Ports/jq/patches/0001-Make-configure-assume-all-dependencies-are-okay.patch deleted file mode 100644 index ec5de8d160c..00000000000 --- a/Ports/jq/patches/0001-Make-configure-assume-all-dependencies-are-okay.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Ali Mohammad Pur -Date: Mon, 16 May 2022 16:20:52 +0430 -Subject: [PATCH] Make configure assume all dependencies are okay - ---- - configure | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/configure b/configure -index de9c48a..1ace244 100755 ---- a/configure -+++ b/configure -@@ -6828,6 +6828,10 @@ bsdi[45]*) - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -+*serenity*) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ - cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' diff --git a/Ports/jq/patches/0002-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch b/Ports/jq/patches/0001-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch similarity index 80% rename from Ports/jq/patches/0002-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch rename to Ports/jq/patches/0001-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch index e8e0f29fec2..e53d30304cf 100644 --- a/Ports/jq/patches/0002-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch +++ b/Ports/jq/patches/0001-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch @@ -10,10 +10,10 @@ And make jv_mem_free() accept it. 1 file changed, 9 insertions(+) diff --git a/src/jv_alloc.c b/src/jv_alloc.c -index fd7b257..9f5ced8 100644 +index 40c244c57560816b8f1683c754f4dd25e60b5aea..915fc32e1a9a7a20d3fd2876e0ea04a2e23e1bbd 100644 --- a/src/jv_alloc.c +++ b/src/jv_alloc.c -@@ -130,7 +130,14 @@ void* jv_mem_alloc_unguarded(size_t sz) { +@@ -149,7 +149,14 @@ void* jv_mem_alloc_unguarded(size_t sz) { return malloc(sz); } @@ -28,7 +28,7 @@ index fd7b257..9f5ced8 100644 void* p = calloc(nemb, sz); if (!p) { memory_exhausted(); -@@ -155,6 +162,8 @@ char* jv_mem_strdup_unguarded(const char *s) { +@@ -174,6 +181,8 @@ char* jv_mem_strdup_unguarded(const char *s) { } void jv_mem_free(void* p) { diff --git a/Ports/jq/patches/0002-Fallback-to-bundled-strptime-implementation.patch b/Ports/jq/patches/0002-Fallback-to-bundled-strptime-implementation.patch new file mode 100644 index 00000000000..d486ab9265e --- /dev/null +++ b/Ports/jq/patches/0002-Fallback-to-bundled-strptime-implementation.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Fabian Dellwing +Date: Tue, 16 Apr 2024 14:36:46 +0200 +Subject: [PATCH] Fallback to bundled `strptime` implementation + +--- + src/util.c | 2 +- + src/util.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/util.c b/src/util.c +index de44fa62c6402dc3e1df88cef75c0c9dadd2ee26..5a246932dd5ae6fb4b393f6bdd257fc3762cf58e 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -451,7 +451,7 @@ jv jq_util_input_next_input(jq_util_input_state *state) { + return value; + } + +-#if defined(WIN32) && !defined(HAVE_STRPTIME) ++#if defined(WIN32) || !defined(HAVE_STRPTIME) + /* http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/lib/libc/time/strptime.c?only_with_tag=HEAD + * NetBSD implementation strptime(). + * Format description: https://netbsd.gw.com/cgi-bin/man-cgi?strptime+3+NetBSD-current +diff --git a/src/util.h b/src/util.h +index 562ac19a8bf4f602d9e8d42502e44dbc0e92d70f..f668330ee1e038a6ea524d110232e6a902274853 100644 +--- a/src/util.h ++++ b/src/util.h +@@ -59,7 +59,7 @@ const void *_jq_memmem(const void *haystack, size_t haystacklen, + + #include + +-#if defined(WIN32) && !defined(HAVE_STRPTIME) ++#if defined(WIN32) || !defined(HAVE_STRPTIME) + char* strptime(const char *buf, const char *fmt, struct tm *tm); + #endif + diff --git a/Ports/jq/patches/ReadMe.md b/Ports/jq/patches/ReadMe.md index a7461842fba..739acf59906 100644 --- a/Ports/jq/patches/ReadMe.md +++ b/Ports/jq/patches/ReadMe.md @@ -1,13 +1,13 @@ # Patches for jq on SerenityOS -## `0001-Make-configure-assume-all-dependencies-are-okay.patch` - -Make configure assume all dependencies are okay - - -## `0002-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch` +## `0001-Make-jv_mem_alloc-return-a-dummy-allocation-for-zero.patch` Make jv_mem_alloc() return a dummy allocation for zero-sized allocs And make jv_mem_free() accept it. +## `0002-Fallback-to-bundled-strptime-implementation.patch` + +Fallback to bundled `strptime` implementation + +