pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

unit: Fix portability (SmartOS)



Module Name:	pkgsrc-wip
Committed By:	Juraj Lutter <otis%NetBSD.org@localhost>
Pushed By:	otis
Date:		Fri Nov 20 10:30:06 2020 +0000
Changeset:	bce43f8dce97da9fb48d2bd65c970029453f0147

Modified Files:
	unit/Makefile.common
	unit/PLIST
	unit/distinfo
Added Files:
	unit/patches/patch-src_nxt__cert.c
	unit/patches/patch-src_nxt__router.c
	unit/patches/patch-src_nxt__websocket__header.h

Log Message:
unit: Fix portability (SmartOS)

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=bce43f8dce97da9fb48d2bd65c970029453f0147

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 unit/Makefile.common                            |  4 +--
 unit/PLIST                                      |  1 -
 unit/distinfo                                   |  3 +++
 unit/patches/patch-src_nxt__cert.c              | 34 +++++++++++++++++++++++++
 unit/patches/patch-src_nxt__router.c            | 15 +++++++++++
 unit/patches/patch-src_nxt__websocket__header.h | 14 ++++++++++
 6 files changed, 67 insertions(+), 4 deletions(-)

diffs:
diff --git a/unit/Makefile.common b/unit/Makefile.common
index da47682b51..1bf1ef7cf2 100644
--- a/unit/Makefile.common
+++ b/unit/Makefile.common
@@ -50,11 +50,9 @@ CONFIGURE_ARGS+=	--tmp=${UNIT_TMPDIR}
 CONFIGURE_ARGS+=	--user=${UNIT_USER}
 CONFIGURE_ARGS+=	--group=${UNIT_GROUP}
 
-PLIST_SUBST+=		UNITEXTDIR="${UNIT_EXTENSION_DIR}"
-
 .include "../../www/unit/options.mk"
 
-INSTALLATION_DIRS+=	sbin
+INSTALLATION_DIRS+=	sbin ${UNIT_EXTENSION_DIR}
 MAKE_DIRS+=		${UNIT_PIDDIR} ${UNIT_DATADIR} ${UNIT_RUNDIR}
 OWN_DIRS=		${UNIT_LOGDIR} ${UNIT_RUNDIR}
 OWN_DIRS_PERMS+=	${UNIT_DATADIR} ${UNIT_USER} ${UNIT_GROUP} 0700
diff --git a/unit/PLIST b/unit/PLIST
index 14a6add275..80dfcef2ce 100644
--- a/unit/PLIST
+++ b/unit/PLIST
@@ -10,4 +10,3 @@ ${PLIST.devkit}include/nxt_version.h
 ${PLIST.devkit}include/nxt_websocket_header.h
 ${PLIST.devkit}lib/libunit.a
 sbin/unitd
-@pkgdir ${UNITEXTDIR}
diff --git a/unit/distinfo b/unit/distinfo
index 5df7885035..f67eeb21e0 100644
--- a/unit/distinfo
+++ b/unit/distinfo
@@ -5,3 +5,6 @@ RMD160 (unit-1.20.0.tar.gz) = 8964e056dbe19e659b157a89d1cf39f213ffd952
 SHA512 (unit-1.20.0.tar.gz) = dd68103795acbdcd87a951c92c72f3cb74b5e622eca4e687194508b55a592ac4312de3a8ff7ddb9a5df9750363b24dca9e1b48c7ef42c78aca3a18aca6a51f42
 Size (unit-1.20.0.tar.gz) = 787607 bytes
 SHA1 (patch-auto-modules-php) = 900cc3381050874e194741ce31554f100ed870a7
+SHA1 (patch-src_nxt__cert.c) = c91e45f148a079b543a0d3cb277388bffb3e2854
+SHA1 (patch-src_nxt__router.c) = 366241f155bccf6a3291e37fef5993eb1c364b99
+SHA1 (patch-src_nxt__websocket__header.h) = 1b50405b187cc8a662372a1c20ab7737278135ae
diff --git a/unit/patches/patch-src_nxt__cert.c b/unit/patches/patch-src_nxt__cert.c
new file mode 100644
index 0000000000..ace7d55913
--- /dev/null
+++ b/unit/patches/patch-src_nxt__cert.c
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Use more portable way to find regular files.
+
+--- src/nxt_cert.c.orig	2020-10-08 16:04:40.000000000 +0000
++++ src/nxt_cert.c
+@@ -9,6 +9,9 @@
+ #include <nxt_cert.h>
+ 
+ #include <dirent.h>
++#include <fcntl.h>
++#include <sys/types.h>
++#include <sys/stat.h>
+ 
+ #include <openssl/bio.h>
+ #include <openssl/pem.h>
+@@ -809,6 +812,7 @@ nxt_cert_store_load(nxt_task_t *task, nx
+     nxt_runtime_t    *rt;
+     struct dirent    *de;
+     nxt_cert_item_t  *item;
++    struct stat      cert_statbuf;
+ 
+     rt = task->thread->runtime;
+ 
+@@ -838,7 +842,8 @@ nxt_cert_store_load(nxt_task_t *task, nx
+             break;
+         }
+ 
+-        if (de->d_type != DT_REG) {
++        if (stat(de->d_name, &cert_statbuf) == -1 ||
++            (cert_statbuf.st_mode & S_IFREG) == 0) {
+             continue;
+         }
+ 
diff --git a/unit/patches/patch-src_nxt__router.c b/unit/patches/patch-src_nxt__router.c
new file mode 100644
index 0000000000..5aa6d4ba13
--- /dev/null
+++ b/unit/patches/patch-src_nxt__router.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Silence warning.
+
+--- src/nxt_router.c.orig	2020-10-08 16:04:40.000000000 +0000
++++ src/nxt_router.c
+@@ -3692,7 +3692,7 @@ nxt_router_thread_exit_handler(nxt_task_
+     nxt_event_engine_t   *engine;
+     nxt_thread_handle_t  handle;
+ 
+-    handle = (nxt_thread_handle_t) obj;
++    handle = *(nxt_thread_handle_t*) obj;
+     link = data;
+ 
+     nxt_thread_wait(handle);
diff --git a/unit/patches/patch-src_nxt__websocket__header.h b/unit/patches/patch-src_nxt__websocket__header.h
new file mode 100644
index 0000000000..03386575a1
--- /dev/null
+++ b/unit/patches/patch-src_nxt__websocket__header.h
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Include endian.h for endianness test to work.
+
+--- src/nxt_websocket_header.h.orig	2020-10-08 16:04:40.000000000 +0000
++++ src/nxt_websocket_header.h
+@@ -6,6 +6,7 @@
+ #ifndef _NXT_WEBSOCKET_HEADER_H_INCLUDED_
+ #define _NXT_WEBSOCKET_HEADER_H_INCLUDED_
+ 
++#include <endian.h>
+ #include <netinet/in.h>
+ 
+ 


Home | Main Index | Thread Index | Old Index