From 821dad3eb3bb81deba7e4c04c317c9b131a863b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 16 Jan 2016 03:25:01 +0100 Subject: [PATCH] xproto: convert patch to patchset and fix struct passwd ops add special case of struct passwd copy helper for Haiku, which only has the POSIX-mandated fields. --- x11-proto/xproto/patches/xproto-7.0.26.patch | 48 ------- .../xproto/patches/xproto-7.0.26.patchset | 126 ++++++++++++++++++ x11-proto/xproto/xproto-7.0.26.recipe | 4 +- 3 files changed, 128 insertions(+), 50 deletions(-) delete mode 100644 x11-proto/xproto/patches/xproto-7.0.26.patch create mode 100644 x11-proto/xproto/patches/xproto-7.0.26.patchset diff --git a/x11-proto/xproto/patches/xproto-7.0.26.patch b/x11-proto/xproto/patches/xproto-7.0.26.patch deleted file mode 100644 index 04ba8ad82..000000000 --- a/x11-proto/xproto/patches/xproto-7.0.26.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/Xos_r.h xproto-7.0.23-git/Xos_r.h -index f963b64..f8b727b 100644 ---- a/Xos_r.h -+++ xproto-7.0.23-git/Xos_r.h -@@ -88,6 +88,10 @@ in this Software without prior written authorization from The Open Group. - # endif - #endif /* _XOS_R_H */ - -+#ifdef __HAIKU__ -+#define _POSIX_THREAD_SAFE_FUNCTIONS -+#endif -+ - #ifndef WIN32 - - #ifdef __cplusplus -diff --git a/configure.ac xproto-7.0.23-git/configure.ac -index c4acf24..b3c82aa 100644 ---- a/configure.ac -+++ xproto-7.0.23-git/configure.ac -@@ -99,6 +99,28 @@ if test "x$fds_bits_found" = xfalse ; then - fi - - if test "x$fds_bits_found" = xfalse ; then -+AC_CHECK_MEMBER(fd_set.bits, -+ [ -+ fds_bits_found=plain_simple -+ USE_FDS_BITS="bits" -+ ],, -+ [ -+ #ifdef HAVE_SYS_PARAM_H -+ #include -+ #endif -+ #ifdef HAVE_SYS_TYPES_H -+ #include -+ #endif -+ #ifdef HAVE_SYS_TIME_H -+ #include -+ #endif -+ #ifdef HAVE_SYS_SELECT_H -+ #include -+ #endif -+ ]) -+fi -+ -+if test "x$fds_bits_found" = xfalse ; then - AC_MSG_ERROR([Could not determine how to access the fds_bits or equivalent - structure in fd_set on your platform.]) - fi diff --git a/x11-proto/xproto/patches/xproto-7.0.26.patchset b/x11-proto/xproto/patches/xproto-7.0.26.patchset new file mode 100644 index 000000000..e41f4c3c5 --- /dev/null +++ b/x11-proto/xproto/patches/xproto-7.0.26.patchset @@ -0,0 +1,126 @@ +From 8d3782f681ba065c74e863d09c34c5f09079761f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= +Date: Sat, 16 Jan 2016 03:19:58 +0100 +Subject: [PATCH 1/3] configure: add proper check for fd_set.bits + +--- + configure.ac | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 355fd0b..a405f15 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -98,6 +98,28 @@ if test "x$fds_bits_found" = xfalse ; then + fi + + if test "x$fds_bits_found" = xfalse ; then ++AC_CHECK_MEMBER(fd_set.bits, ++ [ ++ fds_bits_found=plain_simple ++ USE_FDS_BITS="bits" ++ ],, ++ [ ++ #ifdef HAVE_SYS_PARAM_H ++ #include ++ #endif ++ #ifdef HAVE_SYS_TYPES_H ++ #include ++ #endif ++ #ifdef HAVE_SYS_TIME_H ++ #include ++ #endif ++ #ifdef HAVE_SYS_SELECT_H ++ #include ++ #endif ++ ]) ++fi ++ ++if test "x$fds_bits_found" = xfalse ; then + AC_MSG_ERROR([Could not determine how to access the fds_bits or equivalent + structure in fd_set on your platform.]) + fi +-- +2.7.0 + + +From 841916ca1eddd85d810199b1d45124557bbc729d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= +Date: Sat, 16 Jan 2016 03:20:41 +0100 +Subject: [PATCH 2/3] Assume Haiku uses POSIX thread safe functions + +--- + Xos_r.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Xos_r.h b/Xos_r.h +index f963b64..f8b727b 100644 +--- a/Xos_r.h ++++ b/Xos_r.h +@@ -88,6 +88,10 @@ in this Software without prior written authorization from The Open Group. + # endif + #endif /* _XOS_R_H */ + ++#ifdef __HAIKU__ ++#define _POSIX_THREAD_SAFE_FUNCTIONS ++#endif ++ + #ifndef WIN32 + + #ifdef __cplusplus +-- +2.7.0 + + +From 7b9129e4552dd9c4720d466b13a955214becd1be Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= +Date: Sat, 16 Jan 2016 03:15:19 +0100 +Subject: [PATCH 3/3] Haiku only has POSIX-mandated passwd fields + +--- + Xos_r.h | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/Xos_r.h b/Xos_r.h +index f8b727b..b4a35ef 100644 +--- a/Xos_r.h ++++ b/Xos_r.h +@@ -284,6 +284,35 @@ static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) + (p).pwp = &(p).pws; + } + ++#elif defined(__HAIKU__) ++/* Haiku just has what POSIX mandates, who needs more??? */ ++static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) ++{ ++ memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)); ++ ++ (p).pws.pw_name = (p).pwbuf; ++ (p).len = strlen((p).pwp->pw_name); ++ strcpy((p).pws.pw_name, (p).pwp->pw_name); ++ ++ (p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1; ++ (p).len = strlen((p).pwp->pw_passwd); ++ strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd); ++ ++ (p).pws.pw_gecos = (p).pws.pw_passwd + (p).len + 1; ++ (p).len = strlen((p).pwp->pw_gecos); ++ strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos); ++ ++ (p).pws.pw_dir = (p).pws.pw_gecos + (p).len + 1; ++ (p).len = strlen((p).pwp->pw_dir); ++ strcpy((p).pws.pw_dir, (p).pwp->pw_dir); ++ ++ (p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1; ++ (p).len = strlen((p).pwp->pw_shell); ++ strcpy((p).pws.pw_shell, (p).pwp->pw_shell); ++ ++ (p).pwp = &(p).pws; ++} ++ + #else + # define _Xpw_copyPasswd(p) \ + (memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)), \ +-- +2.7.0 + diff --git a/x11-proto/xproto/xproto-7.0.26.recipe b/x11-proto/xproto/xproto-7.0.26.recipe index db7138da5..41d227a2c 100644 --- a/x11-proto/xproto/xproto-7.0.26.recipe +++ b/x11-proto/xproto/xproto-7.0.26.recipe @@ -8,10 +8,10 @@ COPYRIGHT="1991, Oracle and/or its affiliates. All rights reserved. 1989 by Hewlett-Packard Company. 1999 The XFree86 Project Inc." LICENSE="MIT (no promotion)" -REVISION="2" +REVISION="3" SOURCE_URI="http://cgit.freedesktop.org/xorg/proto/xproto/snapshot/xproto-7.0.26.tar.gz" CHECKSUM_SHA256="8c9667873a446f34c440d06e37c83144979d1abe6fa3dcd52727e7c6fecb290f" -PATCHES="xproto-7.0.26.patch" +PATCHES="xproto-7.0.26.patchset" ARCHITECTURES="x86_gcc2 x86 x86_64" SECONDARY_ARCHITECTURES="x86_gcc2 x86"