On 2021/10/25 17:22, aisha wrote:
> another ping
> 
> usockets - 0.8.1
> uwebsockets - 20.6.0
> purritobin - 0.6.7
>  Additions to www/purritobin
>  - auto cleaning of pastes
>  - web portal for pasting
>  - in-built http server, good for tiny pastes and testing setups
>  - http header manipulation
> 
> depends on a new port databases/lmdbxx, which is attached in the
> patch as well.

Please send new ports as a tar. Diff is harder to work with, and diff
mixing a new port (which many of us put in ports/mystuff/category/name)
with existing ports even harder.

> Cheers,
> Aisha
> 
> 
> diff --git a/databases/lmdbxx/Makefile b/databases/lmdbxx/Makefile
> new file mode 100644
> index 00000000000..b676b039ba3
> --- /dev/null
> +++ b/databases/lmdbxx/Makefile
> @@ -0,0 +1,41 @@
> +# $OpenBSD: $
> +
> +COMMENT =    C++17 wrapper for Lightning Memory-Mapped Database
> +
> +VERSION =    1.0.0
> +DISTNAME =   lmdbxx-${VERSION}
> +
> +CATEGORIES = databases
> +
> +GH_ACCOUNT = hoytech
> +GH_PROJECT = lmdbxx
> +#GH_TAGNAME =        1.0.0
> +GH_COMMIT =  f1f00acf5f5045b43d7189c2b23ae5ca103a6faa
> +
> +HOMEPAGE =   https://github.com/hoytech/lmdbxx
> +
> +MAINTAINER = Aisha Tammy <open...@aisha.cc>
> +
> +# Unlicense
> +PERMIT_PACKAGE =     Yes
> +
> +COMPILER =   base-clang ports-gcc
> +
> +NO_BUILD =   Yes
> +
> +RUN_DEPENDS =        databases/lmdb
> +
> +do-install:
> +     cd ${WRKSRC} && \
> +     mkdir -p ${PREFIX}/include && \
> +     ${INSTALL_DATA} lmdb++.h ${PREFIX}/include 

That dir is already created by ports infrastructure. Only one command so
the cd isn't needed, I'd go with

        ${INSTALL_DATA} ${WRKSRC}/lmdb++.h ${PREFIX}/include

>  --- Makefile.orig
>  +++ Makefile
> -@@ -1,60 +1,40 @@
> +@@ -1,72 +1,46 @@
>  -# WITH_OPENSSL=1 enables OpenSSL 1.1+ support or BoringSSL
>  -# For now we need to link with C++ for OpenSSL support, but should be 
> removed with time
>  -ifeq ($(WITH_OPENSSL),1)
> @@ -30,69 +30,85 @@ Index: Makefile
>  -    override CFLAGS += -DLIBUS_USE_LIBUV
>  -    override LDFLAGS += -luv
>  -endif
> -+PREFIX ?=   "/usr/local"
> ++PREFIX ?=   /usr/local
>  +LIBDIR ?=   "$(PREFIX)/lib"
>  +INCLUDEDIR ?=       "$(PREFIX)/include"
>   
> +-# WITH_ASIO builds with boot asio event-loop
> +-ifeq ($(WITH_ASIO),1)
> +-    override CFLAGS += -DLIBUS_USE_ASIO
> +-    override LDFLAGS += -lstdc++ -lpthread
> +-    override CXXFLAGS += -pthread -DLIBUS_USE_ASIO
> +-endif
> ++PKG_CONFIG ?=       pkg-config
> + 
>  -# WITH_GCD=1 builds with libdispatch as event-loop
>  -ifeq ($(WITH_GCD),1)
>  -    override CFLAGS += -DLIBUS_USE_GCD
>  -    override LDFLAGS += -framework CoreFoundation
>  -endif
> -+# OpenBSD specific library version
> -+LIBTARGET ?=        libusockets.so.$(LIBusockets_VERSION)
> ++LIBTARGET = libusockets.so.$(LIBusockets_VERSION)
>   
>  -# WITH_ASAN builds with sanitizers
>  -ifeq ($(WITH_ASAN),1)
>  -    override CFLAGS += -fsanitize=address -g
> --    override LDFLAGS += -lasan
> +-    override LDFLAGS += -fsanitize=address
>  -endif

Why remove all these WITH_XXX blocks? Having anything unnecessary in the
patch makes the patch harder to read, harder to merge with updates, and
makes it harder to review diffs to the port

>  -# By default we build the uSockets.a static library
>  -default:
>  -    rm -f *.o
>  -    $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
> +-# Also link in Boost Asio support
> +-ifeq ($(WITH_ASIO),1)
> +-    $(CXX) $(CXXFLAGS) -Isrc -std=c++14 -flto -O3 -c src/eventing/asio.cpp
> +-endif
> ++all:
> ++    $(CC) $(CFLAGS) -c src/*.c src/eventing/*.c src/crypto/*.c
> ++    $(CXX) $(CXXFLAGS) -c src/crypto/*.cpp
> ++    $(AR) rvs libusockets.a *.o
> ++    $(CXX) $(CXXFLAGS) -shared -o $(LIBTARGET) *.o -Wl,-soname,$(LIBTARGET) 
> $(LDFLAGS)
> ++    sed -e "s:@PREFIX@:$(PREFIX):" -e "s:@VERSION@:$(LIBusockets_VERSION):" 
> libusockets.pc.in > libusockets.pc
> + 
>  -# For now we do rely on C++17 for OpenSSL support but we will be porting 
> this work to C11
>  -ifeq ($(WITH_OPENSSL),1)
>  -    $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp
>  -endif
>  -    $(AR) rvs uSockets.a *.o

lots of shuffling here that doesn't seem necessary, basically you just
want to remove -flto -O3 from the compiler lines don't you?

> -+COMMON_FLAGS =      -DLIBUS_USE_OPENSSL -DLIBUS_USE_LIBUV -Isrc 
> `$(PKG_CONFIG) --cflags libuv`
> -+override CFLAGS +=  $(COMMON_FLAGS)
> -+override CXXFLAGS +=        $(COMMON_FLAGS)
> ++install:
> ++    install -d "$(DESTDIR)$(LIBDIR)/pkgconfig" "$(DESTDIR)$(INCLUDEDIR)"
> ++    install -m 644 src/libusockets.h "$(DESTDIR)$(INCLUDEDIR)/"
> ++    install -m 644 $(LIBTARGET) "$(DESTDIR)$(LIBDIR)"
> ++    install -m 644 libusockets.a "$(DESTDIR)$(LIBDIR)/"
> ++    install -m 644 libusockets.pc "$(DESTDIR)$(LIBDIR)/pkgconfig/"
.....
> -+install:
> -+    install -d "$(LIBDIR)/pkgconfig" "$(INCLUDEDIR)"
> -+    install -m 644 src/libusockets.h "$(INCLUDEDIR)"
> -+    install -m 755 $(LIBTARGET) "$(LIBDIR)"
> -+    install -m 755 libusockets.a "$(LIBDIR)"
> -+    install -m 644 libusockets.pc "$(LIBDIR)/pkgconfig"
> - 

patch block to add DESTDIR to these, can you avoid patching by simply
setting variables in FAKE_FLAGS? probably just setting PREFIX would cover
all of them

>   clean:
>       rm -f *.o
>       rm -f *.a
> --    rm -rf .certs
>  +    rm -f *.so
> -+    rm -f libusockets.pc
> -+
> -+.PHONY: all install clean
> +     rm -rf .certs
> ++    rm -f usockets.pc
> ++    rm -f hammer_test

but the file created *is* libusockets.pc? anyway ports doesn't call this
"make clean" there's no point patching it.

> --- a/net/usockets/patches/patch-Makefile
> +++ b/net/usockets/patches/patch-Makefile
> @@ -1,4 +1,4 @@
> -$OpenBSD: patch-Makefile,v 1.3 2020/12/11 22:33:22 sthen Exp $
> +: patch-Makefile,v 1.3 2020/12/11 22:33:22 sthen Exp $

broken rcsid line

Reply via email to