pkgsrc-WIP-changes archive

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

unit: Fix build on SmartOS



Module Name:	pkgsrc-wip
Committed By:	Juraj Lutter <otis%NetBSD.org@localhost>
Pushed By:	otis
Date:		Sun Nov 22 18:21:41 2020 +0000
Changeset:	214192ef4f50d190a211d15fa6030e066176f408

Modified Files:
	unit/distinfo
Added Files:
	unit/patches/patch-auto_os_conf
	unit/patches/patch-src_nxt__file.c
	unit/patches/patch-src_nxt__unit.c
	unit/patches/patch-src_nxt__unix.h

Log Message:
unit: Fix build on SmartOS

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

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

diffstat:
 unit/distinfo                      |  4 ++++
 unit/patches/patch-auto_os_conf    | 16 ++++++++++++++++
 unit/patches/patch-src_nxt__file.c | 15 +++++++++++++++
 unit/patches/patch-src_nxt__unit.c | 17 +++++++++++++++++
 unit/patches/patch-src_nxt__unix.h | 30 ++++++++++++++++++++++++++++++
 5 files changed, 82 insertions(+)

diffs:
diff --git a/unit/distinfo b/unit/distinfo
index 0227a70107..d396900a5e 100644
--- a/unit/distinfo
+++ b/unit/distinfo
@@ -4,7 +4,11 @@ SHA1 (unit-1.21.0.tar.gz) = 19278761d3104ff8509422f55207b1daa45a4d14
 RMD160 (unit-1.21.0.tar.gz) = 91c24ed9e8eac402a170c8b02b5633cd892fb017
 SHA512 (unit-1.21.0.tar.gz) = 12e9e8b221ffe8014931fe46c7faa9398de6ad08bbc07e5f8e50f086e4a22419960522d33bece493e17ae544b499acb4ba29cb6cb731c0bb7fbdc6cdc44bf210
 Size (unit-1.21.0.tar.gz) = 802826 bytes
+SHA1 (patch-auto_os_conf) = 6d1cd7aef662a60d4288014eb6fadbe8c1268e55
 SHA1 (patch-src_nxt__cert.c) = c91e45f148a079b543a0d3cb277388bffb3e2854
 SHA1 (patch-src_nxt__conf__validation.c) = 99662fc0d975604fea0708a810e916991d0bf578
+SHA1 (patch-src_nxt__file.c) = 4321feeb6724378009cefacfe23470932faf35ef
 SHA1 (patch-src_nxt__router.c) = 366241f155bccf6a3291e37fef5993eb1c364b99
+SHA1 (patch-src_nxt__unit.c) = d76768c55cd1176b83fefa2a0ccf7e7027d66331
+SHA1 (patch-src_nxt__unix.h) = c0db5bc4d9c45a3ead48627567284d8b3041b0a0
 SHA1 (patch-src_nxt__websocket__header.h) = 1b50405b187cc8a662372a1c20ab7737278135ae
diff --git a/unit/patches/patch-auto_os_conf b/unit/patches/patch-auto_os_conf
new file mode 100644
index 0000000000..af0e124127
--- /dev/null
+++ b/unit/patches/patch-auto_os_conf
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Move _XOPEN_SOURCE to CFLAGS
+
+--- auto/os/conf.orig	2020-11-19 18:12:30.000000000 +0000
++++ auto/os/conf
+@@ -98,6 +98,9 @@ case "$NXT_SYSTEM" in
+         NXT_LIBM="-lm"
+         NXT_LIBS="-lsocket $NXT_LIBSENDFILE"
+         NXT_LIBS="$NXT_LIBS $NXT_LIBRT $NXT_LIBDL $NXT_PTHREAD"
++
++	NXT_CFLAGS="$NXT_CFLAGS -D_XOPEN_SOURCE"
++	NXT_CFLAGS="$NXT_CFLAGS -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__"
+     ;;
+ 
+     Darwin)
diff --git a/unit/patches/patch-src_nxt__file.c b/unit/patches/patch-src_nxt__file.c
new file mode 100644
index 0000000000..aaef6b7df2
--- /dev/null
+++ b/unit/patches/patch-src_nxt__file.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Use fcntl on Solaris
+
+--- src/nxt_file.c.orig	2020-11-19 18:12:30.000000000 +0000
++++ src/nxt_file.c
+@@ -312,7 +312,7 @@ nxt_file_rename(nxt_file_name_t *old_nam
+  * Linux 2.6 does not use BKL.
+  */
+ 
+-#if (NXT_HAVE_FIONBIO)
++#if (NXT_HAVE_FIONBIO) && !(NXT_SOLARIS)
+ 
+ nxt_int_t
+ nxt_fd_nonblocking(nxt_task_t *task, nxt_fd_t fd)
diff --git a/unit/patches/patch-src_nxt__unit.c b/unit/patches/patch-src_nxt__unit.c
new file mode 100644
index 0000000000..b3e2e04158
--- /dev/null
+++ b/unit/patches/patch-src_nxt__unit.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Use more apropriate format specifier for shm preix
+
+--- src/nxt_unit.c.orig	2020-11-19 18:12:30.000000000 +0000
++++ src/nxt_unit.c
+@@ -3762,8 +3762,8 @@ nxt_unit_shm_open(nxt_unit_ctx_t *ctx, s
+ #if (NXT_HAVE_MEMFD_CREATE || NXT_HAVE_SHM_OPEN)
+     char             name[64];
+ 
+-    snprintf(name, sizeof(name), NXT_SHM_PREFIX "unit.%d.%p",
+-             lib->pid, (void *) pthread_self());
++    snprintf(name, sizeof(name), NXT_SHM_PREFIX "unit.%d.%x",
++             lib->pid, pthread_self());
+ #endif
+ 
+ #if (NXT_HAVE_MEMFD_CREATE)
diff --git a/unit/patches/patch-src_nxt__unix.h b/unit/patches/patch-src_nxt__unix.h
new file mode 100644
index 0000000000..3542331be0
--- /dev/null
+++ b/unit/patches/patch-src_nxt__unix.h
@@ -0,0 +1,30 @@
+$NetBSD$
+
+Move _XOPEN_SOURCE to CFLAGS
+
+--- src/nxt_unix.h.orig	2020-11-19 18:12:30.000000000 +0000
++++ src/nxt_unix.h
+@@ -71,23 +71,6 @@
+ #define _POSIX_PTHREAD_SEMANTICS    /* 2 arguments in sigwait(). */
+ #endif
+ 
+-/*
+- * Solaris provides two sockets API:
+- *
+- * 1) 4.3BSD sockets (int instead of socklen_t in accept(), etc.;
+- *    struct msghdr.msg_accrights) in libsocket;
+- * 2) X/Open sockets (socklen_t, struct msghdr.msg_control) with __xnet_
+- *    function name prefix in libxnet and libsocket.
+- */
+-
+-/* Enable X/Open sockets API. */
+-#define _XOPEN_SOURCE
+-#define _XOPEN_SOURCE_EXTENDED  1
+-/* Enable Solaris extensions disabled by _XOPEN_SOURCE. */
+-#ifndef __EXTENSIONS__
+-#define __EXTENSIONS__
+-#endif
+-
+ #endif /* NXT_SOLARIS */
+ 
+ 


Home | Main Index | Thread Index | Old Index