diff options
author | obache <obache@pkgsrc.org> | 2013-11-02 07:32:28 +0000 |
---|---|---|
committer | obache <obache@pkgsrc.org> | 2013-11-02 07:32:28 +0000 |
commit | 2ac823fd3dd15564f1d0cabf2801621438d5a6c7 (patch) | |
tree | d85e8da52528398cca6bec16b46da35c38b06592 /x11/x11vnc | |
parent | d306b3316025290ff364401701ccc1499b640ba9 (diff) | |
download | pkgsrc-2ac823fd3dd15564f1d0cabf2801621438d5a6c7.tar.gz |
Use openpty(3) if available for NetBSD using ptyfs.
PR pkg/48313.
Bump PKGREVISION.
Diffstat (limited to 'x11/x11vnc')
-rw-r--r-- | x11/x11vnc/Makefile | 4 | ||||
-rw-r--r-- | x11/x11vnc/distinfo | 8 | ||||
-rw-r--r-- | x11/x11vnc/patches/patch-configure | 163 | ||||
-rw-r--r-- | x11/x11vnc/patches/patch-configure.ac | 25 | ||||
-rw-r--r-- | x11/x11vnc/patches/patch-enc.h | 10 | ||||
-rw-r--r-- | x11/x11vnc/patches/patch-rfbconfig.h.in | 39 | ||||
-rw-r--r-- | x11/x11vnc/patches/patch-x11vnc_unixpw.c | 67 |
7 files changed, 307 insertions, 9 deletions
diff --git a/x11/x11vnc/Makefile b/x11/x11vnc/Makefile index 7f5d251ae0b..4f4cba3a494 100644 --- a/x11/x11vnc/Makefile +++ b/x11/x11vnc/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.54 2013/10/10 14:42:39 ryoon Exp $ +# $NetBSD: Makefile,v 1.55 2013/11/02 07:32:28 obache Exp $ # DISTNAME= x11vnc-0.9.13 -PKGREVISION= 18 +PKGREVISION= 19 CATEGORIES= x11 net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=libvncserver/} diff --git a/x11/x11vnc/distinfo b/x11/x11vnc/distinfo index 44c89aa3880..44ac533a78e 100644 --- a/x11/x11vnc/distinfo +++ b/x11/x11vnc/distinfo @@ -1,6 +1,10 @@ -$NetBSD: distinfo,v 1.19 2012/11/08 12:56:21 sborrill Exp $ +$NetBSD: distinfo,v 1.20 2013/11/02 07:32:28 obache Exp $ SHA1 (x11vnc-0.9.13.tar.gz) = f011d81488ac94dc8dce2d88739c23bd85a976fa RMD160 (x11vnc-0.9.13.tar.gz) = 5819a4ae85b25b41fb747ccafd27e228c3ee888e Size (x11vnc-0.9.13.tar.gz) = 2853769 bytes -SHA1 (patch-enc.h) = 5de28d00f5025357a41d3909a554f7dd67d70e0b +SHA1 (patch-configure) = 784f76c158745da985a210f2035957e7135dd4e6 +SHA1 (patch-configure.ac) = 7d31042b1e1d44b98394614ba80cdc3ac0eaf198 +SHA1 (patch-enc.h) = 82b004715cb2e7aa1e81e0aaebc2161cab20973b +SHA1 (patch-rfbconfig.h.in) = 77e025890e868ce7c62c6609b5386ebbe54491c8 +SHA1 (patch-x11vnc_unixpw.c) = 108529f9d53f887e48e2ede07d85e6b2ff326341 diff --git a/x11/x11vnc/patches/patch-configure b/x11/x11vnc/patches/patch-configure new file mode 100644 index 00000000000..1f0d446193b --- /dev/null +++ b/x11/x11vnc/patches/patch-configure @@ -0,0 +1,163 @@ +$NetBSD: patch-configure,v 1.1 2013/11/02 07:32:28 obache Exp $ + +* check openpty(3) + +--- configure.orig 2011-08-10 22:35:10.000000000 +0000 ++++ configure +@@ -9866,7 +9866,10 @@ if test "$build_x11vnc" = "yes"; then + + + +-for ac_header in pwd.h sys/wait.h utmpx.h termios.h sys/ioctl.h sys/stropts.h ++ ++ ++ ++for ac_header in pwd.h sys/wait.h utmpx.h termios.h sys/ioctl.h sys/stropts.h pty.h libutil.h util.h + do + as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` + if eval "test \"\${$as_ac_Header+set}\" = set"; then +@@ -13523,6 +13526,8 @@ if test "$build_x11vnc" = "yes"; then + + + ++ ++ + for ac_func in setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid initgroups waitpid setutxent grantpt shmat + do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +@@ -13624,6 +13629,135 @@ _ACEOF + fi + done + ++ echo "$as_me:$LINENO: checking for library containing openpty" >&5 ++echo $ECHO_N "checking for library containing openpty... $ECHO_C" >&6 ++if test "${ac_cv_search_openpty+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++ac_cv_search_openpty=no ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char openpty (); ++int ++main () ++{ ++openpty (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_search_openpty="none required" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++if test "$ac_cv_search_openpty" = no; then ++ for ac_lib in util bsd; do ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char openpty (); ++int ++main () ++{ ++openpty (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_search_openpty="-l$ac_lib" ++break ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ done ++fi ++LIBS=$ac_func_search_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_search_openpty" >&5 ++echo "${ECHO_T}$ac_cv_search_openpty" >&6 ++if test "$ac_cv_search_openpty" != no; then ++ test "$ac_cv_search_openpty" = "none required" || LIBS="$ac_cv_search_openpty $LIBS" ++ cat >>confdefs.h <<\_ACEOF ++#define HAVE_OPENPTY 1 ++_ACEOF ++ ++fi ++ + fi + + # check, if shmget is in cygipc.a diff --git a/x11/x11vnc/patches/patch-configure.ac b/x11/x11vnc/patches/patch-configure.ac new file mode 100644 index 00000000000..2c8b2e0ceca --- /dev/null +++ b/x11/x11vnc/patches/patch-configure.ac @@ -0,0 +1,25 @@ +$NetBSD: patch-configure.ac,v 1.1 2013/11/02 07:32:28 obache Exp $ + +* check openpty(3) + +--- configure.ac.orig 2011-08-10 22:34:57.000000000 +0000 ++++ configure.ac +@@ -730,7 +730,7 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h ne + + # x11vnc only: + if test "$build_x11vnc" = "yes"; then +- AC_CHECK_HEADERS([pwd.h sys/wait.h utmpx.h termios.h sys/ioctl.h sys/stropts.h]) ++ AC_CHECK_HEADERS([pwd.h sys/wait.h utmpx.h termios.h sys/ioctl.h sys/stropts.h pty.h libutil.h util.h]) + fi + + # Checks for typedefs, structures, and compiler characteristics. +@@ -777,7 +777,9 @@ fi + AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mmap mkfifo select socket strchr strcspn strdup strerror strstr]) + # x11vnc only: + if test "$build_x11vnc" = "yes"; then ++ AH_TEMPLATE(HAVE_OPENPTY, [Define to `1' if you have the `openpty' function.]) + AC_CHECK_FUNCS([setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid initgroups waitpid setutxent grantpt shmat]) ++ AC_SEARCH_LIBS(openpty, util bsd, [AC_DEFINE(HAVE_OPENPTY)]) + fi + + # check, if shmget is in cygipc.a diff --git a/x11/x11vnc/patches/patch-enc.h b/x11/x11vnc/patches/patch-enc.h index f7213385072..6065cc591ea 100644 --- a/x11/x11vnc/patches/patch-enc.h +++ b/x11/x11vnc/patches/patch-enc.h @@ -1,10 +1,10 @@ -$NetBSD: patch-enc.h,v 1.1 2012/11/08 12:56:21 sborrill Exp $ +$NetBSD: patch-enc.h,v 1.2 2013/11/02 07:32:28 obache Exp $ Respect IPv6 build option used throughout rest of x11vnc ---- x11vnc/enc.h.orig 2011-08-10 23:31:32.000000000 +0100 -+++ x11vnc/enc.h 2012-11-08 12:36:25.000000000 +0000 -@@ -1733,7 +1733,7 @@ +--- x11vnc/enc.h.orig 2011-08-10 22:31:32.000000000 +0000 ++++ x11vnc/enc.h +@@ -1733,7 +1733,7 @@ static void enc_connections(int listen_p } try6: @@ -13,7 +13,7 @@ Respect IPv6 build option used throughout rest of x11vnc if (!getenv("ULTRAVNC_DSM_HELPER_NOIPV6")) { struct sockaddr_in6 sin; int one = 1, sock = -1; -@@ -1826,7 +1826,7 @@ +@@ -1826,7 +1826,7 @@ static void enc_connections(int listen_p exit(1); } } else if (FD_ISSET(listen_fd6, &fds)) { diff --git a/x11/x11vnc/patches/patch-rfbconfig.h.in b/x11/x11vnc/patches/patch-rfbconfig.h.in new file mode 100644 index 00000000000..5e2547eb0f0 --- /dev/null +++ b/x11/x11vnc/patches/patch-rfbconfig.h.in @@ -0,0 +1,39 @@ +$NetBSD: patch-rfbconfig.h.in,v 1.1 2013/11/02 07:32:28 obache Exp $ + +* check openpty(3) + +--- rfbconfig.h.in.orig 2011-08-10 22:35:32.000000000 +0000 ++++ rfbconfig.h.in +@@ -99,6 +99,9 @@ + /* openssl libssl library present */ + #undef HAVE_LIBSSL + ++/* Define to 1 if you have the <libutil.h> header file. */ ++#undef HAVE_LIBUTIL_H ++ + /* XDAMAGE extension build environment present */ + #undef HAVE_LIBXDAMAGE + +@@ -156,6 +159,12 @@ + /* Define to 1 if you have the <netinet/in.h> header file. */ + #undef HAVE_NETINET_IN_H + ++/* Define to `1' if you have the `openpty' function. */ ++#undef HAVE_OPENPTY ++ ++/* Define to 1 if you have the <pty.h> header file. */ ++#undef HAVE_PTY_H ++ + /* Define to 1 if you have the <pwd.h> header file. */ + #undef HAVE_PWD_H + +@@ -271,6 +280,9 @@ + /* Define to 1 if you have the <unistd.h> header file. */ + #undef HAVE_UNISTD_H + ++/* Define to 1 if you have the <util.h> header file. */ ++#undef HAVE_UTIL_H ++ + /* Define to 1 if you have the <utmpx.h> header file. */ + #undef HAVE_UTMPX_H + diff --git a/x11/x11vnc/patches/patch-x11vnc_unixpw.c b/x11/x11vnc/patches/patch-x11vnc_unixpw.c new file mode 100644 index 00000000000..52ec58c506c --- /dev/null +++ b/x11/x11vnc/patches/patch-x11vnc_unixpw.c @@ -0,0 +1,67 @@ +$NetBSD: patch-x11vnc_unixpw.c,v 1.1 2013/11/02 07:32:28 obache Exp $ + +* Use openpty(3) if available + +--- x11vnc/unixpw.c.orig 2011-08-10 22:31:32.000000000 +0000 ++++ x11vnc/unixpw.c +@@ -92,6 +92,18 @@ extern char *crypt(const char*, const ch + #define IS_BSD + #endif + ++#if LIBVNCSERVER_HAVE_OPENPTY ++#if LIBVNCSERVER_HAVE_UTIL_H ++#include <util.h> ++#endif ++#if LIBVNCSERVER_HAVE_LIBUTIL_H ++#include <libutil.h> ++#endif ++#if LIBVNCSERVER_HAVE_PTY_H ++#include <pty.h> ++#endif ++#endif ++ + int white_pixel(void); + void unixpw_screen(int init); + void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init); +@@ -581,6 +593,23 @@ char *get_pty_ptmx(int *fd_p) { + #endif /* GRANTPT */ + } + ++#if LIBVNCSERVER_HAVE_OPENPTY ++char *get_pty_openpty(int *fd_p) { ++ int fd, sfd; ++ ++ *fd_p = -1; ++ ++ if (openpty(&fd, &sfd, slave_str, NULL, NULL) < 0) { ++ return NULL; ++ } ++ ++#if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCFLUSH) ++ ioctl(fd, TIOCFLUSH, (char *) 0); ++#endif ++ *fd_p = fd; ++ return slave_str; ++} ++#endif + + char *get_pty_loop(int *fd_p) { + char master_str[16]; +@@ -625,6 +654,9 @@ char *get_pty(int *fd_p) { + if (getenv("BSD_PTY")) { + return get_pty_loop(fd_p); + } ++#if LIBVNCSERVER_HAVE_OPENPTY ++ return get_pty_openpty(fd_p); ++#else + #ifdef IS_BSD + return get_pty_loop(fd_p); + #else +@@ -635,6 +667,7 @@ char *get_pty(int *fd_p) { + return get_pty_loop(fd_p); + #endif + #endif ++#endif + } + + void try_to_be_nobody(void) { |