Github messages for voidlinux
 help / color / mirror / Atom feed
From: subnut <subnut@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] mongoose: fix missing functionality
Date: Sun, 10 Apr 2022 20:28:28 +0200	[thread overview]
Message-ID: <20220410182828.fE8T36sosFZR66a_xKu3pXlUQQgNQCVTsau03Zt17kg@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-36561@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages mongoose
https://github.com/void-linux/void-packages/pull/36561

mongoose: fix missing functionality
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
<!-- 
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36561.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mongoose-36561.patch --]
[-- Type: text/x-diff, Size: 5843 bytes --]

From 5c2d19fc2ed8f39a71de35b3b7bad3cd384a24f2 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Fri, 8 Apr 2022 00:22:02 +0530
Subject: [PATCH] mongoose: fix missing functionality

---
 srcpkgs/mongoose/patches/fix-makefile.patch | 21 +++++++++++-----
 srcpkgs/mongoose/patches/fix-tests.patch    | 25 ++++++++++++++++---
 srcpkgs/mongoose/template                   | 27 ++++++++++++++++++---
 3 files changed, 60 insertions(+), 13 deletions(-)

diff --git a/srcpkgs/mongoose/patches/fix-makefile.patch b/srcpkgs/mongoose/patches/fix-makefile.patch
index d829ea8adc8c..d4896253ade7 100644
--- a/srcpkgs/mongoose/patches/fix-makefile.patch
+++ b/srcpkgs/mongoose/patches/fix-makefile.patch
@@ -1,23 +1,32 @@
+diff --git a/Makefile b/Makefile
+index 33c00f75..2d49281a 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -5,5 +5,5 @@ SRCS = mongoose.c test/unit_test.c test/packed_fs.c
+@@ -1,15 +1,21 @@
+-SRCS = mongoose.c test/unit_test.c test/packed_fs.c
++SRCS = mongoose.c test/unit_test.c
+ HDRS = $(wildcard src/*.h)
+ DEFS ?= -DMG_MAX_HTTP_HEADERS=7 -DMG_ENABLE_LINES -DMG_ENABLE_PACKED_FS=1
+ WARN ?= -W -Wall -Werror -Wshadow -Wdouble-promotion -fno-common -Wconversion -Wundef
  OPTS ?= -O3 -g3
  INCS ?= -Isrc -I.
 -CFLAGS ?= $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) $(EXTRA)
 +CFLAGS := $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) $(CFLAGS)
  SSL ?= MBEDTLS
  CWD ?= $(realpath $(CURDIR))
-@@ -10,6 +10,9 @@ CWD ?= $(realpath $(CURDIR))
  DOCKER ?= docker run --rm -e Tmp=. -e WINEDEBUG=-all -v $(CWD):$(CWD) -w $(CWD)
  VCFLAGS = /nologo /W3 /O2 /I. $(DEFS) $(TFLAGS)
  IPV6 ?= 1
-+ifneq "$(NO_SANITIZE)" "1"
++ifneq (1,$(NO_SANITIZE))
 +SANITIZE = -fsanitize=address,undefined
++endif
++ifneq (,$(findstring MG_ENABLE_PACKED_FS=1,$(CFLAGS)))
++SRCS += test/packed_fs.c
 +endif
  ASAN_OPTIONS ?=
  EXAMPLES := $(wildcard examples/*)
  PREFIX ?= /usr/local
-@@ -19,12 +22,12 @@ VERSION ?= $(shell cut -d'"' -f2 src/version.h)
+@@ -19,12 +25,12 @@ VERSION ?= $(shell cut -d'"' -f2 src/version.h)
  ifeq "$(SSL)" "MBEDTLS"
  MBEDTLS ?= /usr
  CFLAGS  += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include
@@ -32,7 +41,7 @@
  endif
  
  all: mg_prefix unamalgamated unpacked test test++ arm examples vc98 vc2017 mingw mingw++ linux linux++ fuzz
-@@ -59,7 +62,7 @@ fuzz: fuzzer
+@@ -59,7 +65,7 @@ fuzz: fuzzer
  	$(RUN) ./fuzzer
  
  # make CC=/usr/local/opt/llvm\@8/bin/clang ASAN_OPTIONS=detect_leaks=1
@@ -41,7 +50,7 @@
  test: mongoose.h  Makefile $(SRCS)
  	$(CC) $(SRCS) $(CFLAGS) -coverage $(LDFLAGS) -g -o unit_test
  	ASAN_OPTIONS=$(ASAN_OPTIONS) $(RUN) ./unit_test
-@@ -108,10 +111,12 @@ linux++: CC = g++
+@@ -108,10 +114,12 @@ linux++: CC = g++
  linux++: WARN += -Wno-missing-field-initializers
  linux++: linux
  
diff --git a/srcpkgs/mongoose/patches/fix-tests.patch b/srcpkgs/mongoose/patches/fix-tests.patch
index 8b25527492d5..e880eda4d68e 100644
--- a/srcpkgs/mongoose/patches/fix-tests.patch
+++ b/srcpkgs/mongoose/patches/fix-tests.patch
@@ -1,8 +1,26 @@
-Skip tests that want to connect to the internet
-
+diff --git a/test/unit_test.c b/test/unit_test.c
+index 53d06eb3..487d6d6c 100644
 --- a/test/unit_test.c
 +++ b/test/unit_test.c
-@@ -1680,11 +1562,9 @@ int main(void) {
+@@ -954,7 +954,6 @@ static void test_http_parse(void) {
+     ASSERT(mg_http_parse(s, strlen(s), &req) == (int) strlen(s));
+     ASSERT((v = mg_http_get_header(&req, "e")) != NULL);
+     ASSERT(mg_vcmp(v, "5") == 0);
+-    ASSERT((v = mg_http_get_header(&req, "h")) == NULL);
+   }
+ 
+   {
+@@ -1660,7 +1659,9 @@ int main(void) {
+   test_check_ip_acl();
+   test_udp();
+   test_pipe();
++#if MG_ENABLE_PACKED_FS
+   test_packed();
++#endif
+   test_crc32();
+   test_multipart();
+   test_http_chunked();
+@@ -1680,11 +1681,9 @@ int main(void) {
    test_ws();
    test_ws_fragmentation();
    test_http_server();
@@ -14,4 +32,3 @@ Skip tests that want to connect to the internet
    printf("SUCCESS. Total tests: %d\n", s_num_tests);
    return EXIT_SUCCESS;
  }
-
diff --git a/srcpkgs/mongoose/template b/srcpkgs/mongoose/template
index a81658710d7b..7f550f93782a 100644
--- a/srcpkgs/mongoose/template
+++ b/srcpkgs/mongoose/template
@@ -1,7 +1,7 @@
 # Template file for 'mongoose'
 pkgname=mongoose
 version=7.6
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=yes
 make_check_target=test
@@ -14,13 +14,17 @@ license="GPL-2.0-only"
 homepage="https://mongoose.ws/"
 distfiles="https://github.com/cesanta/mongoose/archive/${version}.tar.gz"
 checksum=1ef09d971b6de1a6317c109980d6fb5a9c19b39efef2506d6b76869644b3dafa
+build_options="packedfs"
+desc_option_packedfs="Enable embedded (packed) FS support"
+build_options_default="~packedfs"
+
+export SSL=OPENSSL
+export DEFS="-DMG_ENABLE_LINES=1 -DMG_ENABLE_PACKED_FS=$(vopt_if packedfs 1 0)"
 
 # -Wno-error=unused-function: patched tests leave some functions unused
 # -Wno-error=sign-conversion: GCC falsely flags musl FD_{SET,ISSET,CLR}
 CFLAGS="-fPIC -Wno-error=sign-conversion -Wno-error=unused-function"
 
-export SSL=OPENSSL
-
 # libsanitizer-devel is currenly not available on musl
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	make_check_args+=" NO_SANITIZE=1"
@@ -33,6 +37,20 @@ if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
 	make_check_args+=" IPV6=0"
 fi
 
+post_build() {
+	if [ "$build_option_packedfs" ]; then
+		cd test
+		make pack
+		mv pack mongoose-pack	# /bin/pack is taken by allegro4
+	fi
+}
+
+pre_install() {
+	if [ "$build_option_packedfs" ]; then
+		vbin test/mongoose-pack
+	fi
+}
+
 mongoose-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
@@ -40,6 +58,9 @@ mongoose-devel_package() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"
+		if [ "$build_option_packedfs" ]; then
+			vmove usr/bin/mongoose-pack
+		fi
 	}
 }
 

  parent reply	other threads:[~2022-04-10 18:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
2022-04-07 18:41 ` subnut
2022-04-07 18:42 ` subnut
2022-04-07 18:56 ` [PR PATCH] [Updated] " subnut
2022-04-07 19:13 ` [PR PATCH] [Updated] mongoose: add missing binary subnut
2022-04-07 19:16 ` [PR PATCH] [Updated] mongoose: fix missing functionality subnut
2022-04-09 11:53 ` subnut
2022-04-10  6:56 ` subnut
2022-04-10  6:56 ` subnut
2022-04-10 18:26 ` subnut
2022-04-10 18:28 ` subnut [this message]
2022-04-10 18:29 ` subnut
2022-04-13 13:41 ` mongoose: improve template and patches ahesford
2022-04-13 14:13 ` subnut
2022-04-13 14:13 ` subnut
2022-04-13 14:15 ` subnut
2022-04-13 14:17 ` subnut
2022-04-13 14:21 ` subnut
2022-04-13 14:24 ` subnut
2022-04-13 14:48 ` ahesford
2022-04-13 15:07 ` subnut
2022-04-13 15:07 ` [PR PATCH] [Closed]: " subnut
2022-04-13 15:07 ` subnut
2022-04-16 13:30 ` subnut
2022-04-16 13:32 ` [PR PATCH] [Updated] " subnut
2022-04-16 14:47 ` ahesford
2022-04-17 17:21 ` [PR PATCH] [Updated] " subnut
2022-04-17 17:34 ` subnut
2022-07-17  2:14 ` github-actions
2022-08-01  2:14 ` [PR PATCH] [Closed]: " github-actions

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220410182828.fE8T36sosFZR66a_xKu3pXlUQQgNQCVTsau03Zt17kg@z \
    --to=subnut@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).