* Re: [PR PATCH] [Updated] mongoose: fixed undefined reference error
2022-04-07 15:19 [PR PATCH] mongoose: fixed undefined reference error subnut
@ 2022-04-07 16:11 ` subnut
2022-04-07 17:16 ` subnut
2022-04-07 17:16 ` [PR PATCH] [Closed]: " subnut
2 siblings, 0 replies; 4+ messages in thread
From: subnut @ 2022-04-07 16:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1272 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/36556
mongoose: fixed undefined reference error
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES** (**thoroughly**)
<!--
#### 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/36556.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mongoose-36556.patch --]
[-- Type: text/x-diff, Size: 4235 bytes --]
From e1728781c1b07454ed6d049063feeb6fff100c20 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Thu, 7 Apr 2022 20:48:33 +0530
Subject: [PATCH] mongoose: fixed undefined reference error
---
srcpkgs/mongoose/patches/fix-makefile.patch | 35 ++++++++++++---------
srcpkgs/mongoose/template | 13 ++++++--
2 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/srcpkgs/mongoose/patches/fix-makefile.patch b/srcpkgs/mongoose/patches/fix-makefile.patch
index d829ea8adc8c..bf9f0f415e11 100644
--- a/srcpkgs/mongoose/patches/fix-makefile.patch
+++ b/srcpkgs/mongoose/patches/fix-makefile.patch
@@ -1,23 +1,21 @@
+diff --git a/Makefile b/Makefile
+index 33c00f75..13d361b6 100644
--- a/Makefile
+++ b/Makefile
-@@ -5,5 +5,5 @@ SRCS = mongoose.c test/unit_test.c test/packed_fs.c
+@@ -1,10 +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))
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"
-+SANITIZE = -fsanitize=address,undefined
-+endif
- ASAN_OPTIONS ?=
- EXAMPLES := $(wildcard examples/*)
- PREFIX ?= /usr/local
-@@ -19,12 +22,12 @@ VERSION ?= $(shell cut -d'"' -f2 src/version.h)
+@@ -19,12 +18,20 @@ VERSION ?= $(shell cut -d'"' -f2 src/version.h)
ifeq "$(SSL)" "MBEDTLS"
MBEDTLS ?= /usr
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include
@@ -29,10 +27,18 @@
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include
-LDFLAGS ?= -L$(OPENSSL)/lib -lssl -lcrypto
+LDFLAGS += -L$(OPENSSL)/lib -lssl -lcrypto
++endif
++
++ifneq "$(NO_SANITIZE)" "1"
++SANITIZE = -fsanitize=address,undefined
++endif
++ifeq "$(ENABLE_PACKED_FS)" "1"
++SRCS += test/packed_fs.c
++CFLAGS += -DMG_ENABLE_PACKED_FS=1
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 +66,7 @@ fuzz: fuzzer
$(RUN) ./fuzzer
# make CC=/usr/local/opt/llvm\@8/bin/clang ASAN_OPTIONS=detect_leaks=1
@@ -41,7 +47,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 +115,12 @@ linux++: CC = g++
linux++: WARN += -Wno-missing-field-initializers
linux++: linux
@@ -57,3 +63,4 @@
install: linux-libs
install -Dm644 libmongoose.a libmongoose.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib
+
diff --git a/srcpkgs/mongoose/template b/srcpkgs/mongoose/template
index a81658710d7b..b567f486adf5 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,20 @@ license="GPL-2.0-only"
homepage="https://mongoose.ws/"
distfiles="https://github.com/cesanta/mongoose/archive/${version}.tar.gz"
checksum=1ef09d971b6de1a6317c109980d6fb5a9c19b39efef2506d6b76869644b3dafa
+build_options="fs"
+desc_option_fs="Enable embedded FS support through mg_unpack and mg_unlist"
+build_options_default="~fs"
+
+export SSL=OPENSSL
+
+if [ "$build_option_fs" ]; then
+ export ENABLE_PACKED_FS=1
+fi
# -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] 4+ messages in thread