Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] mongoose: improve patches
@ 2022-04-07 18:18 subnut
  2022-04-07 18:41 ` subnut
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: subnut @ 2022-04-07 18:18 UTC (permalink / raw)
  To: ml

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

There is a new 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: improve patches
<!-- 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: 2896 bytes --]

From 92cabc0a7cc56180141792758ee4354eb91ffa65 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Thu, 7 Apr 2022 23:43:02 +0530
Subject: [PATCH] mongoose: improve patches

---
 srcpkgs/mongoose/patches/fix-makefile.patch |  9 +++++++--
 srcpkgs/mongoose/patches/fix-tests.patch    | 21 ++++++++++++++++++---
 srcpkgs/mongoose/template                   |  2 +-
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/mongoose/patches/fix-makefile.patch b/srcpkgs/mongoose/patches/fix-makefile.patch
index d829ea8adc8c..eb3e7e2fc546 100644
--- a/srcpkgs/mongoose/patches/fix-makefile.patch
+++ b/srcpkgs/mongoose/patches/fix-makefile.patch
@@ -1,10 +1,15 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -5,5 +5,5 @@ SRCS = mongoose.c test/unit_test.c test/packed_fs.c
+@@ -1,9 +1,9 @@
+-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)
++CFLAGS := $(OPTS) $(WARN) $(INCS) $(CFLAGS)
  SSL ?= MBEDTLS
  CWD ?= $(realpath $(CURDIR))
 @@ -10,6 +10,9 @@ CWD ?= $(realpath $(CURDIR))
diff --git a/srcpkgs/mongoose/patches/fix-tests.patch b/srcpkgs/mongoose/patches/fix-tests.patch
index 8b25527492d5..4e1d4683eef0 100644
--- a/srcpkgs/mongoose/patches/fix-tests.patch
+++ b/srcpkgs/mongoose/patches/fix-tests.patch
@@ -1,8 +1,24 @@
-Skip tests that want to connect to the internet
+Skip broken tests
 
 --- 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,6 @@ int main(void) {
+   test_check_ip_acl();
+   test_udp();
+   test_pipe();
+-  test_packed();
+   test_crc32();
+   test_multipart();
+   test_http_chunked();
+@@ -1680,11 +1678,9 @@ int main(void) {
    test_ws();
    test_ws_fragmentation();
    test_http_server();
@@ -14,4 +30,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..d3cfac982a12 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

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
@ 2022-04-07 18:41 ` subnut
  2022-04-07 18:42 ` subnut
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-07 18:41 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1092081975

Comment:
@ahesford paper42 suggested my to ping you, since you're the one who reviewed it last time.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve patches
  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
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-07 18:42 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1092081975

Comment:
@ahesford paper42 suggested me to ping you, since you're the one who reviewed it last time.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: improve patches
  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 ` subnut
  2022-04-07 19:13 ` [PR PATCH] [Updated] mongoose: add missing binary subnut
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-07 18:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1239 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: improve patches
<!-- 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: 1183 bytes --]

From 87eeac65a07980123be96f6c5629db2a7b9a154a 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: add missing binary

---
 srcpkgs/mongoose/template | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/mongoose/template b/srcpkgs/mongoose/template
index a81658710d7b..6495a778c3ca 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
@@ -33,6 +33,16 @@ if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
 	make_check_args+=" IPV6=0"
 fi
 
+post_build() {
+	cd test
+	make pack
+	mv pack mongoose-pack	# since `/bin/pack` is claimed by allegro4
+}
+
+pre_install() {
+	vbin test/mongoose-pack
+}
+
 mongoose-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
@@ -40,6 +50,7 @@ mongoose-devel_package() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"
+		vmove usr/bin/mongoose-pack
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: add missing binary
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (2 preceding siblings ...)
  2022-04-07 18:56 ` [PR PATCH] [Updated] " subnut
@ 2022-04-07 19:13 ` subnut
  2022-04-07 19:16 ` [PR PATCH] [Updated] mongoose: fix missing functionality subnut
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-07 19:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1242 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: add missing binary
<!-- 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: 2729 bytes --]

From a68774375737ff9109410eb5aacf7ac40d390e1b 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-tests.patch |  7 +++++--
 srcpkgs/mongoose/template                | 18 +++++++++++++++---
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/mongoose/patches/fix-tests.patch b/srcpkgs/mongoose/patches/fix-tests.patch
index 8b25527492d5..ba5cbeedf7ad 100644
--- a/srcpkgs/mongoose/patches/fix-tests.patch
+++ b/srcpkgs/mongoose/patches/fix-tests.patch
@@ -2,7 +2,11 @@ Skip tests that want to connect to the internet
 
 --- a/test/unit_test.c
 +++ b/test/unit_test.c
-@@ -1680,11 +1562,9 @@ int main(void) {
+@@ -956,3 +956,2 @@ static void test_http_parse(void) {
+     ASSERT(mg_vcmp(v, "5") == 0);
+-    ASSERT((v = mg_http_get_header(&req, "h")) == NULL);
+   }
+@@ -1680,11 +1679,9 @@ int main(void) {
    test_ws();
    test_ws_fragmentation();
    test_http_server();
@@ -14,4 +18,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..f5d14b98835c 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
@@ -15,12 +15,13 @@ homepage="https://mongoose.ws/"
 distfiles="https://github.com/cesanta/mongoose/archive/${version}.tar.gz"
 checksum=1ef09d971b6de1a6317c109980d6fb5a9c19b39efef2506d6b76869644b3dafa
 
+export SSL=OPENSSL
+export DEFS="-DMG_ENABLE_LINES -DMG_ENABLE_PACKED_FS=1"
+
 # -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 +34,16 @@ if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
 	make_check_args+=" IPV6=0"
 fi
 
+post_build() {
+	cd test
+	make pack
+	mv pack mongoose-pack	# since `/bin/pack` is claimed by allegro4
+}
+
+pre_install() {
+	vbin test/mongoose-pack
+}
+
 mongoose-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
@@ -40,6 +51,7 @@ mongoose-devel_package() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"
+		vmove usr/bin/mongoose-pack
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: fix missing functionality
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (3 preceding siblings ...)
  2022-04-07 19:13 ` [PR PATCH] [Updated] mongoose: add missing binary subnut
@ 2022-04-07 19:16 ` subnut
  2022-04-09 11:53 ` subnut
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-07 19:16 UTC (permalink / raw)
  To: ml

[-- 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: 2727 bytes --]

From 6f43349c0f54d947d5a011e0d3deabf38bf5b49f 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-tests.patch |  7 +++++--
 srcpkgs/mongoose/template                | 18 +++++++++++++++---
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/mongoose/patches/fix-tests.patch b/srcpkgs/mongoose/patches/fix-tests.patch
index 8b25527492d5..ba5cbeedf7ad 100644
--- a/srcpkgs/mongoose/patches/fix-tests.patch
+++ b/srcpkgs/mongoose/patches/fix-tests.patch
@@ -2,7 +2,11 @@ Skip tests that want to connect to the internet
 
 --- a/test/unit_test.c
 +++ b/test/unit_test.c
-@@ -1680,11 +1562,9 @@ int main(void) {
+@@ -956,3 +956,2 @@ static void test_http_parse(void) {
+     ASSERT(mg_vcmp(v, "5") == 0);
+-    ASSERT((v = mg_http_get_header(&req, "h")) == NULL);
+   }
+@@ -1680,11 +1679,9 @@ int main(void) {
    test_ws();
    test_ws_fragmentation();
    test_http_server();
@@ -14,4 +18,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..840c9c581ea4 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
@@ -15,12 +15,13 @@ homepage="https://mongoose.ws/"
 distfiles="https://github.com/cesanta/mongoose/archive/${version}.tar.gz"
 checksum=1ef09d971b6de1a6317c109980d6fb5a9c19b39efef2506d6b76869644b3dafa
 
+export SSL=OPENSSL
+export DEFS="-DMG_ENABLE_LINES -DMG_ENABLE_PACKED_FS=1"
+
 # -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 +34,16 @@ if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
 	make_check_args+=" IPV6=0"
 fi
 
+post_build() {
+	cd test
+	make pack
+	mv pack mongoose-pack	# since /bin/pack is claimed by allegro4
+}
+
+pre_install() {
+	vbin test/mongoose-pack
+}
+
 mongoose-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
@@ -40,6 +51,7 @@ mongoose-devel_package() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"
+		vmove usr/bin/mongoose-pack
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: fix missing functionality
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (4 preceding siblings ...)
  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
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-09 11:53 UTC (permalink / raw)
  To: ml

[-- 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: 2727 bytes --]

From 7251c4823bd8e6c6768f78e8ebe698fe02070327 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-tests.patch |  7 +++++--
 srcpkgs/mongoose/template                | 18 +++++++++++++++---
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/mongoose/patches/fix-tests.patch b/srcpkgs/mongoose/patches/fix-tests.patch
index 8b25527492d5..ba5cbeedf7ad 100644
--- a/srcpkgs/mongoose/patches/fix-tests.patch
+++ b/srcpkgs/mongoose/patches/fix-tests.patch
@@ -2,7 +2,11 @@ Skip tests that want to connect to the internet
 
 --- a/test/unit_test.c
 +++ b/test/unit_test.c
-@@ -1680,11 +1562,9 @@ int main(void) {
+@@ -956,3 +956,2 @@ static void test_http_parse(void) {
+     ASSERT(mg_vcmp(v, "5") == 0);
+-    ASSERT((v = mg_http_get_header(&req, "h")) == NULL);
+   }
+@@ -1680,11 +1679,9 @@ int main(void) {
    test_ws();
    test_ws_fragmentation();
    test_http_server();
@@ -14,4 +18,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..840c9c581ea4 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
@@ -15,12 +15,13 @@ homepage="https://mongoose.ws/"
 distfiles="https://github.com/cesanta/mongoose/archive/${version}.tar.gz"
 checksum=1ef09d971b6de1a6317c109980d6fb5a9c19b39efef2506d6b76869644b3dafa
 
+export SSL=OPENSSL
+export DEFS="-DMG_ENABLE_LINES -DMG_ENABLE_PACKED_FS=1"
+
 # -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 +34,16 @@ if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
 	make_check_args+=" IPV6=0"
 fi
 
+post_build() {
+	cd test
+	make pack
+	mv pack mongoose-pack	# since /bin/pack is claimed by allegro4
+}
+
+pre_install() {
+	vbin test/mongoose-pack
+}
+
 mongoose-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
@@ -40,6 +51,7 @@ mongoose-devel_package() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"
+		vmove usr/bin/mongoose-pack
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: fix missing functionality
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (5 preceding siblings ...)
  2022-04-09 11:53 ` subnut
@ 2022-04-10  6:56 ` subnut
  2022-04-10  6:56 ` subnut
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-10  6:56 UTC (permalink / raw)
  To: ml

[-- 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: 2727 bytes --]

From 15706332a92e8eab6e12c4630e7b029ab3df4450 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-tests.patch |  7 +++++--
 srcpkgs/mongoose/template                | 18 +++++++++++++++---
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/mongoose/patches/fix-tests.patch b/srcpkgs/mongoose/patches/fix-tests.patch
index 8b25527492d5..ba5cbeedf7ad 100644
--- a/srcpkgs/mongoose/patches/fix-tests.patch
+++ b/srcpkgs/mongoose/patches/fix-tests.patch
@@ -2,7 +2,11 @@ Skip tests that want to connect to the internet
 
 --- a/test/unit_test.c
 +++ b/test/unit_test.c
-@@ -1680,11 +1562,9 @@ int main(void) {
+@@ -956,3 +956,2 @@ static void test_http_parse(void) {
+     ASSERT(mg_vcmp(v, "5") == 0);
+-    ASSERT((v = mg_http_get_header(&req, "h")) == NULL);
+   }
+@@ -1680,11 +1679,9 @@ int main(void) {
    test_ws();
    test_ws_fragmentation();
    test_http_server();
@@ -14,4 +18,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..840c9c581ea4 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
@@ -15,12 +15,13 @@ homepage="https://mongoose.ws/"
 distfiles="https://github.com/cesanta/mongoose/archive/${version}.tar.gz"
 checksum=1ef09d971b6de1a6317c109980d6fb5a9c19b39efef2506d6b76869644b3dafa
 
+export SSL=OPENSSL
+export DEFS="-DMG_ENABLE_LINES -DMG_ENABLE_PACKED_FS=1"
+
 # -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 +34,16 @@ if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
 	make_check_args+=" IPV6=0"
 fi
 
+post_build() {
+	cd test
+	make pack
+	mv pack mongoose-pack	# since /bin/pack is claimed by allegro4
+}
+
+pre_install() {
+	vbin test/mongoose-pack
+}
+
 mongoose-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
@@ -40,6 +51,7 @@ mongoose-devel_package() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"
+		vmove usr/bin/mongoose-pack
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: fix missing functionality
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (6 preceding siblings ...)
  2022-04-10  6:56 ` subnut
@ 2022-04-10  6:56 ` subnut
  2022-04-10 18:26 ` subnut
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-10  6:56 UTC (permalink / raw)
  To: ml

[-- 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: 2729 bytes --]

From 712681dbdab716ddba8292c3f2c0d79046cb8d42 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-tests.patch |  7 +++++--
 srcpkgs/mongoose/template                | 18 +++++++++++++++---
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/mongoose/patches/fix-tests.patch b/srcpkgs/mongoose/patches/fix-tests.patch
index 8b25527492d5..ba5cbeedf7ad 100644
--- a/srcpkgs/mongoose/patches/fix-tests.patch
+++ b/srcpkgs/mongoose/patches/fix-tests.patch
@@ -2,7 +2,11 @@ Skip tests that want to connect to the internet
 
 --- a/test/unit_test.c
 +++ b/test/unit_test.c
-@@ -1680,11 +1562,9 @@ int main(void) {
+@@ -956,3 +956,2 @@ static void test_http_parse(void) {
+     ASSERT(mg_vcmp(v, "5") == 0);
+-    ASSERT((v = mg_http_get_header(&req, "h")) == NULL);
+   }
+@@ -1680,11 +1679,9 @@ int main(void) {
    test_ws();
    test_ws_fragmentation();
    test_http_server();
@@ -14,4 +18,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..fcd69a8ce9c3 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
@@ -15,12 +15,13 @@ homepage="https://mongoose.ws/"
 distfiles="https://github.com/cesanta/mongoose/archive/${version}.tar.gz"
 checksum=1ef09d971b6de1a6317c109980d6fb5a9c19b39efef2506d6b76869644b3dafa
 
+export SSL=OPENSSL
+export DEFS="-DMG_ENABLE_LINES=1 -DMG_ENABLE_PACKED_FS=1"
+
 # -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 +34,16 @@ if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then
 	make_check_args+=" IPV6=0"
 fi
 
+post_build() {
+	cd test
+	make pack
+	mv pack mongoose-pack	# since /bin/pack is claimed by allegro4
+}
+
+pre_install() {
+	vbin test/mongoose-pack
+}
+
 mongoose-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"
@@ -40,6 +51,7 @@ mongoose-devel_package() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"
+		vmove usr/bin/mongoose-pack
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: fix missing functionality
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (7 preceding siblings ...)
  2022-04-10  6:56 ` subnut
@ 2022-04-10 18:26 ` subnut
  2022-04-10 18:28 ` subnut
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-10 18:26 UTC (permalink / raw)
  To: ml

[-- 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: 5818 bytes --]

From cb7ba7f2341c600570dfdd550b41522e4b33653b 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 | 22 ++++++++++++-----
 srcpkgs/mongoose/patches/fix-tests.patch    | 24 +++++++++++++++---
 srcpkgs/mongoose/template                   | 27 ++++++++++++++++++---
 3 files changed, 61 insertions(+), 12 deletions(-)

diff --git a/srcpkgs/mongoose/patches/fix-makefile.patch b/srcpkgs/mongoose/patches/fix-makefile.patch
index d829ea8adc8c..8d4227ee2b2f 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
  
@@ -57,3 +66,4 @@
  
  install: linux-libs
  	install -Dm644 libmongoose.a libmongoose.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib
+
diff --git a/srcpkgs/mongoose/patches/fix-tests.patch b/srcpkgs/mongoose/patches/fix-tests.patch
index 8b25527492d5..5d748836dd30 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();
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
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: fix missing functionality
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (8 preceding siblings ...)
  2022-04-10 18:26 ` subnut
@ 2022-04-10 18:28 ` subnut
  2022-04-10 18:29 ` subnut
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-10 18:28 UTC (permalink / raw)
  To: ml

[-- 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
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: fix missing functionality
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (9 preceding siblings ...)
  2022-04-10 18:28 ` subnut
@ 2022-04-10 18:29 ` subnut
  2022-04-13 13:41 ` mongoose: improve template and patches ahesford
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-10 18:29 UTC (permalink / raw)
  To: ml

[-- 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: 5846 bytes --]

From e5139e239f4745c6dd96d86d88fe1f0b32c75f00 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: improve template and patches

---
 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
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (10 preceding siblings ...)
  2022-04-10 18:29 ` subnut
@ 2022-04-13 13:41 ` ahesford
  2022-04-13 14:13 ` subnut
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: ahesford @ 2022-04-13 13:41 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098066355

Comment:
What is the purpose of these changes? You are patching the build system to ship a utility upstream uses for testing. If they mean for this to be a user-visible tool, then it should have an associated installation target.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (11 preceding siblings ...)
  2022-04-13 13:41 ` mongoose: improve template and patches ahesford
@ 2022-04-13 14:13 ` subnut
  2022-04-13 14:13 ` subnut
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-13 14:13 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098102528

Comment:
> if they mean for this to be a user-visible tool [...]

They do. See https://mongoose.ws/documentation/#packed-filesystem.

Basically, the `pack` (renamed to `mongoose-pack` due to reasons mentioned in the template) command takes a file hierarchy and _"packs"_ it into source code, which can then be used while building a server so that the server uses the _packed_ files instead of the actual filesystem.

It is useful development only, so I have put it under `mongoose-devel`

> [...] then it should have an associated installation target.

You mean, a target in the Makefile?

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (12 preceding siblings ...)
  2022-04-13 14:13 ` subnut
@ 2022-04-13 14:13 ` subnut
  2022-04-13 14:15 ` subnut
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-13 14:13 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098102528

Comment:
> if they mean for this to be a user-visible tool [...]

They do. See https://mongoose.ws/documentation/#packed-filesystem.

Basically, the `pack` (renamed to `mongoose-pack` due to reasons mentioned in the template) command takes a file hierarchy and _"packs"_ it into source code, which can then be used while building a server so that the server uses the _packed_ files instead of the actual filesystem.

It is useful for development only, so I have put it under `mongoose-devel`

> [...] then it should have an associated installation target.

You mean, a target in the Makefile?

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (13 preceding siblings ...)
  2022-04-13 14:13 ` subnut
@ 2022-04-13 14:15 ` subnut
  2022-04-13 14:17 ` subnut
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-13 14:15 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098105045

Comment:
Also, the package that is currently in the repository was built using the default options of the aforementioned Makefile, and the resulting library doesn't work without this `pack` program (symbol not found errors).

So yeah, the Makefile wasn't meant for package maintainers.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (14 preceding siblings ...)
  2022-04-13 14:15 ` subnut
@ 2022-04-13 14:17 ` subnut
  2022-04-13 14:21 ` subnut
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-13 14:17 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098107271

Comment:
In fact, now that I've started looking deeper, it seems like the whole repo is meant to be integrated _into_ the software that uses it, and the Makefile is oriented for that purpose.

See smplayer, for example -
https://github.com/smplayer-dev/smplayer/tree/master/webserver

It uses a nearly two year old version of `mongoose.c` instead of using libraries installed on the system. :thinking: 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (15 preceding siblings ...)
  2022-04-13 14:17 ` subnut
@ 2022-04-13 14:21 ` subnut
  2022-04-13 14:24 ` subnut
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-13 14:21 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098107271

Comment:
In fact, now that I've started looking deeper, it seems like the whole repo is meant to be integrated _into_ the software that uses it, and the Makefile is oriented for that purpose.

See smplayer, for example -
https://github.com/smplayer-dev/smplayer/tree/master/webserver

It uses a 2014 version of `mongoose.c` instead of using libraries installed on the system. :thinking: 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (16 preceding siblings ...)
  2022-04-13 14:21 ` subnut
@ 2022-04-13 14:24 ` subnut
  2022-04-13 14:48 ` ahesford
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-13 14:24 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098115373

Comment:
We ship that same 2014 version of mongoose in our repos! :fearful: 

```
$ xbps-query -Rf smplayer | grep bin
/usr/bin/simple_web_server
/usr/bin/smplayer
```

There have been many CVEs since then -  
https://www.cvedetails.com/vulnerability-list/vendor_id-16334/product_id-41402/Cesanta-Mongoose.html

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (17 preceding siblings ...)
  2022-04-13 14:24 ` subnut
@ 2022-04-13 14:48 ` ahesford
  2022-04-13 15:07 ` subnut
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: ahesford @ 2022-04-13 14:48 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098145229

Comment:
The place for the Makefile patch to do the right thing when packing is disabled is upstream, not here. They should also fix the Makefile to build everything required to make the library work in the default build configuration. It would also help if they move the `pack` source out of a `test` directory so it's more obvious that it's intended as a key component of the library.

That the "packed" version of the library *requires* the client application to expose symbols that are defined by the `pack` executable is a terrible design decision that very tightly couples the library to the design of the application. As you note, this screams for direct integration of the library source code into the client source tree.

Why are we even packaging this?

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Closed]: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (19 preceding siblings ...)
  2022-04-13 15:07 ` subnut
@ 2022-04-13 15:07 ` subnut
  2022-04-13 15:07 ` subnut
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-13 15:07 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

mongoose: improve template and patches
https://github.com/void-linux/void-packages/pull/36561

Description:
<!-- 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
-->


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (18 preceding siblings ...)
  2022-04-13 14:48 ` ahesford
@ 2022-04-13 15:07 ` subnut
  2022-04-13 15:07 ` [PR PATCH] [Closed]: " subnut
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-13 15:07 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098167438

Comment:
> Why are we even packaging this?

I was also wondering the same.

I just picked it up and adopted it since it was present orphaned and outdated in the repo, and I was thinking of creating a simple web server that used this as a library. I wasn't too accustomed to the build system, etc.

Looks like we should remove this from the repo, then.  

I am closing this PR.  
@ahesford would you please just directly commit to the repo deleting the `srcpkgs/mongoose{,-devel}` directories and add `mongoose{,-devel}` to `removed-packages`?  
I don't want to create a PR.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (20 preceding siblings ...)
  2022-04-13 15:07 ` [PR PATCH] [Closed]: " subnut
@ 2022-04-13 15:07 ` subnut
  2022-04-16 13:30 ` subnut
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-13 15:07 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1098167438

Comment:
> Why are we even packaging this?

I was also wondering the same.

I just picked it up and adopted it since it was present orphaned and outdated in the repo, and I was thinking of creating a simple web server that used this as a library. I wasn't too accustomed to the build system, etc.

Looks like we should remove this from the repo, then.  

I am closing this PR.  
@ahesford would you please just directly commit to the repo deleting the `srcpkgs/mongoose{,-devel}` directories and add `mongoose{,-devel}` to `removed-packages`?  I don't want to create a PR.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (21 preceding siblings ...)
  2022-04-13 15:07 ` subnut
@ 2022-04-16 13:30 ` subnut
  2022-04-16 13:32 ` [PR PATCH] [Updated] " subnut
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-16 13:30 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1100663511

Comment:
> That the "packed" version of the library requires the client application to expose symbols that are defined by the pack executable is a terrible design decision that very tightly couples the library to the design of the application. As you note, this screams for direct integration of the library source code into the client source tree.

@ahesford That problem doesn't arise by default, with the `packedfs` option disabled.

I've designed the template & patches in such a way, that by default it creates a simple shared library, and it's corresponding `devel` files. The _"packing"_ functionality can be enabled if some user wants to, by building it with the packedfs option enabled.

Also, I think we should include this in the repo, and then use this library for other applications instead of using their outdated versions, like in the case of `smplayer`.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (22 preceding siblings ...)
  2022-04-16 13:30 ` subnut
@ 2022-04-16 13:32 ` subnut
  2022-04-16 14:47 ` ahesford
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-16 13:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1252 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: improve template and patches
<!-- 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: 5846 bytes --]

From ecca815276a0079ae52b5f26e6402f1d05a74833 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: improve template and patches

---
 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
 	}
 }
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (23 preceding siblings ...)
  2022-04-16 13:32 ` [PR PATCH] [Updated] " subnut
@ 2022-04-16 14:47 ` ahesford
  2022-04-17 17:21 ` [PR PATCH] [Updated] " subnut
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: ahesford @ 2022-04-16 14:47 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1100679676

Comment:
Just kill the build option and patch out the packed stuff. There's no need to complicate the makefile patch and borrow trouble with a build option nobody is going to use. If somebody intends to use the packed option and believes it belongs in the template instead of vendoring two files, let that person make the case when needed.

Also, if the justification is to use this library for other templates, you might as well include those adjustments in this PR to demonstrate the viability.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (24 preceding siblings ...)
  2022-04-16 14:47 ` ahesford
@ 2022-04-17 17:21 ` subnut
  2022-04-17 17:34 ` subnut
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-17 17:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1252 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: improve template and patches
<!-- 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: 3939 bytes --]

From 1b97fb9fe2850a2c571bce8e80940ddc64e31858 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: improve template and patches

---
 srcpkgs/mongoose/patches/fix-makefile.patch | 12 +++++++---
 srcpkgs/mongoose/patches/fix-tests.patch    | 25 +++++++++++++++++----
 srcpkgs/mongoose/template                   |  7 +++---
 3 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/mongoose/patches/fix-makefile.patch b/srcpkgs/mongoose/patches/fix-makefile.patch
index d829ea8adc8c..3544a52e47ea 100644
--- a/srcpkgs/mongoose/patches/fix-makefile.patch
+++ b/srcpkgs/mongoose/patches/fix-makefile.patch
@@ -1,17 +1,23 @@
+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,18 @@
+-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
  ASAN_OPTIONS ?=
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..ee3c4ae312d1 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
@@ -15,12 +15,13 @@ homepage="https://mongoose.ws/"
 distfiles="https://github.com/cesanta/mongoose/archive/${version}.tar.gz"
 checksum=1ef09d971b6de1a6317c109980d6fb5a9c19b39efef2506d6b76869644b3dafa
 
+export SSL=OPENSSL
+export DEFS="-DMG_ENABLE_LINES=1"
+
 # -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"

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (25 preceding siblings ...)
  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
  28 siblings, 0 replies; 30+ messages in thread
From: subnut @ 2022-04-17 17:34 UTC (permalink / raw)
  To: ml

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

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1100920952

Comment:
> Also, if the justification is to use this library for other templates, you might as well include those adjustments in this PR to demonstrate the viability.

I'll do that in a future PR. Because currently, the library itself is broken (undefined references) so if somebody wants to use it to build anything, it won't work. So, I think it's better if we fix the library issue as soon as possible, and then later focus on patching other packages.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (26 preceding siblings ...)
  2022-04-17 17:34 ` subnut
@ 2022-07-17  2:14 ` github-actions
  2022-08-01  2:14 ` [PR PATCH] [Closed]: " github-actions
  28 siblings, 0 replies; 30+ messages in thread
From: github-actions @ 2022-07-17  2:14 UTC (permalink / raw)
  To: ml

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

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/36561#issuecomment-1186375536

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Closed]: mongoose: improve template and patches
  2022-04-07 18:18 [PR PATCH] mongoose: improve patches subnut
                   ` (27 preceding siblings ...)
  2022-07-17  2:14 ` github-actions
@ 2022-08-01  2:14 ` github-actions
  28 siblings, 0 replies; 30+ messages in thread
From: github-actions @ 2022-08-01  2:14 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

mongoose: improve template and patches
https://github.com/void-linux/void-packages/pull/36561

Description:
<!-- 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
-->


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-08-01  2:14 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).