summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emulators/wine-devel/Makefile30
-rw-r--r--emulators/wine-devel/distinfo18
-rw-r--r--emulators/wine-devel/options.mk11
-rw-r--r--emulators/wine-devel/patches/patch-configure64
-rw-r--r--emulators/wine-devel/patches/patch-configure.ac28
-rw-r--r--emulators/wine-devel/patches/patch-dlls_ntdll_signal__x86__64.c46
-rw-r--r--emulators/wine-devel/patches/patch-dlls_ntdll_string.c620
-rw-r--r--emulators/wine-devel/patches/patch-dlls_winepulse.drv_mmdevdrv.c16
-rw-r--r--emulators/wine-devel/patches/patch-dlls_wininet_http.c22
-rw-r--r--emulators/wine-devel/patches/patch-dlls_ws2__32_socket.c17
-rw-r--r--emulators/wine-devel/patches/patch-include_config.h.in16
11 files changed, 116 insertions, 772 deletions
diff --git a/emulators/wine-devel/Makefile b/emulators/wine-devel/Makefile
index 616117a9f2c..d861e32a686 100644
--- a/emulators/wine-devel/Makefile
+++ b/emulators/wine-devel/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.57 2016/08/27 20:56:29 joerg Exp $
+# $NetBSD: Makefile,v 1.58 2016/09/15 09:25:53 maya Exp $
-DISTNAME= wine-1.7.36
-PKGREVISION= 8
+DISTNAME= wine-1.9.18
CATEGORIES= emulators
MASTER_SITES= http://ibiblio.org/pub/linux/system/emulators/wine/ \
${MASTER_SITE_SOURCEFORGE:=wine/}
@@ -18,16 +17,17 @@ ONLY_FOR_PLATFORM+= *-*-i386 *-*-x86_64
PKG_DESTDIR_SUPPORT= user-destdir
+
USE_LANGUAGES= c
USE_LIBTOOL= yes
USE_NCURSES= yes
-USE_TOOLS+= bison flex gmake mktemp msgfmt
+USE_TOOLS+= bison flex gmake mktemp msgfmt autoconf
FLEX_REQD= 2.5.33
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --disable-tests
UNLIMIT_RESOURCES= datasize
-REPLACE_PERL+= tools/winemaker tools/winedump/function_grep.pl
+REPLACE_PERL+= tools/winemaker/winemaker tools/winedump/function_grep.pl
# The Wine configure script has problems locating the libraries in the
# buildlink directory, so prepend all of the LDFLAGS necessary to link
@@ -48,18 +48,17 @@ PLIST_VARS+= oss wine16 wine32 wine64
#CONFIGURE_ENV+= ac_cv_prog_CXX=${CXX:Q}\ -m32
#CONFIGURE_ENV+= ac_cv_prog_AS=${AS:Q}\ --32
#CONFIGURE_ENV+= ac_cv_prog_LD=${LD:Q}\ -m\ elf_i386
-PLIST.wine16= yes
-PLIST.wine32= yes
+#PLIST.wine16= yes
+PLIST_SRC= PLIST.wine32
+NOT_PAX_MPROTECT_SAFE+= bin/wine
+#PLIST.wine32= yes
.endif
# Needs GCC >= 4.4; Experimental
.if !empty(MACHINE_ARCH:Mx86_64)
-CONFIGURE_ARGS+= --enable-win64
-PLIST.wine64= yes
-.endif
-
-.if ${OPSYS} == "NetBSD"
-# gethostbyname_r is in libc, but has a different calling convention
-CONFIGURE_ARGS+= wine_cv_linux_gethostbyname_r_6=no
+CONFIGURE_ARGS+= --enable-win64 --libdir=${PREFIX}/lib
+NOT_PAX_MPROTECT_SAFE+= bin/wine64
+PLIST_SRC= PLIST.wine64
+#PLIST.wine64= yes
.endif
.if ${OPSYS} != "Darwin"
@@ -68,6 +67,9 @@ PLIST.oss= yes
.include "../../mk/oss.buildlink3.mk"
.endif
+pre-configure:
+ cd ${WRKSRC} && autoconf
+
.include "options.mk"
.include "../../devel/ncurses/buildlink3.mk"
diff --git a/emulators/wine-devel/distinfo b/emulators/wine-devel/distinfo
index f89c09c155f..adf184c8142 100644
--- a/emulators/wine-devel/distinfo
+++ b/emulators/wine-devel/distinfo
@@ -1,12 +1,12 @@
-$NetBSD: distinfo,v 1.26 2016/01/11 22:53:48 joerg Exp $
+$NetBSD: distinfo,v 1.27 2016/09/15 09:25:53 maya Exp $
-SHA1 (wine-1.7.36.tar.bz2) = 69c8bf7116572a4c1e5b1113612f461d88489663
-RMD160 (wine-1.7.36.tar.bz2) = 2cde7505154c656eb58145b4ad7df55251362931
-SHA512 (wine-1.7.36.tar.bz2) = c2d9687e1ab0a53ebff6973fdd83e4b54c397e2b51c172b7c58297776228a8bbb3d5321de27aac4b61f756575b60c6534d5e0a9bb4b830d429496b3e8b95b39f
-Size (wine-1.7.36.tar.bz2) = 22010371 bytes
-SHA1 (patch-configure) = 77b5259dfe3644ca17bb9af8aa1be045b5f88c7f
-SHA1 (patch-dlls_ntdll_signal__x86__64.c) = 92ad434b5d8de9d4dcca5004d2fadede58cfeea8
-SHA1 (patch-dlls_ntdll_string.c) = 5da7614b1ad59ac29d8582ef3104dc79a1a045e6
+SHA1 (wine-1.9.18.tar.bz2) = 738ef272b3faf898c47dfb64b93b80fcde7a0c24
+RMD160 (wine-1.9.18.tar.bz2) = c555406acaa0debd5c91276f734534717e0fbf36
+SHA512 (wine-1.9.18.tar.bz2) = fc8ccf844c5913bb9e351f244cf6ec610caabc9513761b140b129e70a56265133a0cbc7b585bf83b028421f29c5ddc0885abfc98cd9a2dc2b0863d6dbb9b59ee
+Size (wine-1.9.18.tar.bz2) = 23473716 bytes
+SHA1 (patch-configure.ac) = 304ab35b7a99c9da4782a5d527ce6c1a5813fc3e
SHA1 (patch-dlls_wineoss.drv_mmdevdrv.c) = 89f9d1c08dbfbed3eac971ee534944f7403246a4
-SHA1 (patch-dlls_ws2__32_socket.c) = 98ebaa7b0831e558f49a484ffb3a1b28adb9bcf2
+SHA1 (patch-dlls_winepulse.drv_mmdevdrv.c) = c9aad42d1fbfcc309dcc6ddc3dd9aefb9a556075
+SHA1 (patch-dlls_wininet_http.c) = 0021568efb075711f20b23e40515dc76868959c6
+SHA1 (patch-include_config.h.in) = 20d14d65ebaaca2dc9ba3f9dfbd644c5819de713
SHA1 (patch-include_wine_test.h) = af33ec675c67e2fc56cf52e9c6634cab3e6fdfd2
diff --git a/emulators/wine-devel/options.mk b/emulators/wine-devel/options.mk
index 591e2a178a5..621ed3dc65a 100644
--- a/emulators/wine-devel/options.mk
+++ b/emulators/wine-devel/options.mk
@@ -1,7 +1,7 @@
-# $NetBSD: options.mk,v 1.7 2015/02/09 13:30:44 adam Exp $
+# $NetBSD: options.mk,v 1.8 2016/09/15 09:25:53 maya Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.wine
-PKG_SUPPORTED_OPTIONS= cups dbus esound hal ldap opengl sane ssl x11
+PKG_SUPPORTED_OPTIONS= cups dbus esound hal ldap opengl sane ssl x11 pulseaudio
PKG_SUGGESTED_OPTIONS= opengl ssl x11
.include "../../mk/bsd.options.mk"
@@ -60,6 +60,13 @@ PLIST.x11= yes
CONFIGURE_ARGS+= --without-x
.endif
+.if !empty(PKG_OPTIONS:Mpulseaudio)
+CONFIGURE_ARGS+= --with-pulse
+.include "../../audio/pulseaudio/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --without-pulse
+.endif
+
.if !empty(PKG_OPTIONS:Mopengl) && !empty(PKG_OPTIONS:Mx11)
PLIST.opengl= yes
.include "../../graphics/glu/buildlink3.mk"
diff --git a/emulators/wine-devel/patches/patch-configure b/emulators/wine-devel/patches/patch-configure
deleted file mode 100644
index 426d281fc0f..00000000000
--- a/emulators/wine-devel/patches/patch-configure
+++ /dev/null
@@ -1,64 +0,0 @@
-$NetBSD: patch-configure,v 1.2 2015/02/09 13:30:44 adam Exp $
-
-Clang does not support __builtin_ms_va_list; make a work-around.
-Do not install 64-bit libraries into ${PREFIX}/lib64.
-Use correct -install_name on Darwin.
-Configure for OSS v3 support for NetBSD.
-
---- configure.orig 2015-02-07 08:14:10.000000000 +0000
-+++ configure
-@@ -4895,6 +4894,9 @@ $as_echo_n "checking whether $CC support
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <stdarg.h>
-+#ifdef __clang__
-+#define __builtin_ms_va_list va_list
-+#endif
- int
- main ()
- {
-@@ -4968,9 +4970,6 @@ then
- fi
- enable_fonts=${enable_fonts:-no}
- enable_server=${enable_server:-no}
--elif test "x$enable_win64" = "xyes"
--then
-- test "x$libdir" != "x\${exec_prefix}/lib" || libdir="\${exec_prefix}/lib64"
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the directory containing the Wine tools" >&5
-@@ -8048,7 +8047,7 @@ OBJS = \$(C_SRCS:.c=.o) \$(EXTRA_OBJS)
- all: libwine.dylib
-
- libwine.$libwine_version.dylib: \$(OBJS)
-- \$(CC) -dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@
-+ \$(CC) -dynamiclib -install_name \$(PREFIX)/lib/libwine.$libwine_soversion.dylib -compatibility_version $libwine_soversion -current_version $libwine_version \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@
-
- libwine.$libwine_soversion.dylib: libwine.$libwine_version.dylib
- \$(RM) \$@ && \$(LN_S) libwine.$libwine_version.dylib \$@
-@@ -12593,14 +12592,25 @@ then
- if test "x$ac_cv_header_sys_soundcard_h" = xyes; then :
- ac_fn_c_check_member "$LINENO" "oss_sysinfo" "numaudioengines" "ac_cv_member_oss_sysinfo_numaudioengines" "#include <sys/soundcard.h>
- "
-+if test x`echo "$host_alias" | grep -iv netbsd` = x; then :
- if test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_OSS_SYSINFO_NUMAUDIOENGINES 1
-+#define HAVE_OSSv4 1
- _ACEOF
-
- OSS4_CFLAGS="$ac_oss_incl"
-
-+else
-+ac_cv_member_oss_sysinfo_numaudioengines=yes
-+cat >>confdefs.h <<_ACEOF
-+#define HAVE_OSS_SYSINFO_NUMAUDIOENGINES 1
-+_ACEOF
-+
-+OSS4INCL="$ac_oss_incl"
-+
-+fi
- fi
-
- fi
diff --git a/emulators/wine-devel/patches/patch-configure.ac b/emulators/wine-devel/patches/patch-configure.ac
new file mode 100644
index 00000000000..bc9db72e4f4
--- /dev/null
+++ b/emulators/wine-devel/patches/patch-configure.ac
@@ -0,0 +1,28 @@
+$NetBSD: patch-configure.ac,v 1.1 2016/09/15 09:25:53 maya Exp $
+
+Add check for pthread_mutexattr_setprotocol.
+
+Don't try to enable dtags in the wildcard case (i.e. non-linux),
+netbsd passes the compile test, but fails at runtime (PR pkg/51324)
+
+--- configure.ac.orig 2016-06-10 14:04:01.000000000 +0000
++++ configure.ac
+@@ -891,9 +891,6 @@ case $host_os in
+ [LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
+ LDRPATH_LOCAL="-Wl,-R,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"])])
+
+- WINE_TRY_CFLAGS([-Wl,--enable-new-dtags],
+- [LDRPATH_INSTALL="$LDRPATH_INSTALL -Wl,--enable-new-dtags"])
+-
+ case $host_cpu in
+ *i[[3456789]]86* | x86_64)
+ WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000],
+@@ -1452,6 +1449,8 @@ then
+ [AC_CHECK_HEADERS(pulse/pulseaudio.h,
+ [AC_CHECK_LIB(pulse, pa_stream_is_corked,[:],[PULSE_LIBS=""],[$PULSE_LIBS])],
+ [PULSE_LIBS=""])])
++ AC_CHECK_FUNCS(pthread_mutexattr_setprotocol, [HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL=1],
++ [HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL=0])
+ fi
+ WINE_NOTICE_WITH(pulse, [test -z "$PULSE_LIBS"],
+ [libpulse ${notice_platform}development files not found or too old, Pulse won't be supported.],
diff --git a/emulators/wine-devel/patches/patch-dlls_ntdll_signal__x86__64.c b/emulators/wine-devel/patches/patch-dlls_ntdll_signal__x86__64.c
deleted file mode 100644
index be26e829f03..00000000000
--- a/emulators/wine-devel/patches/patch-dlls_ntdll_signal__x86__64.c
+++ /dev/null
@@ -1,46 +0,0 @@
-$NetBSD: patch-dlls_ntdll_signal__x86__64.c,v 1.3 2015/02/09 13:30:44 adam Exp $
-
---- dlls/ntdll/signal_x86_64.c.orig 2015-01-20 11:56:36.000000000 +0000
-+++ dlls/ntdll/signal_x86_64.c
-@@ -694,7 +694,9 @@ struct dwarf_fde
- unsigned int cie_offset;
- };
-
-+#ifdef __linux__
- extern const struct dwarf_fde *_Unwind_Find_FDE (void *, struct dwarf_eh_bases *);
-+#endif
-
- static unsigned char dwarf_get_u1( const unsigned char **p )
- {
-@@ -2108,6 +2110,7 @@ static NTSTATUS call_stack_handlers( EXC
-
- if (!module || (module->Flags & LDR_WINE_INTERNAL))
- {
-+#ifdef __linux__
- struct dwarf_eh_bases bases;
- const struct dwarf_fde *fde = _Unwind_Find_FDE( (void *)(context.Rip - 1), &bases );
-
-@@ -2124,6 +2127,7 @@ static NTSTATUS call_stack_handlers( EXC
- }
- goto unwind_done;
- }
-+#endif
- }
- else WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) );
-
-@@ -3108,6 +3112,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame
-
- if (!module || (module->Flags & LDR_WINE_INTERNAL))
- {
-+#ifdef __linux__
- struct dwarf_eh_bases bases;
- const struct dwarf_fde *fde = _Unwind_Find_FDE( (void *)(context->Rip - 1), &bases );
-
-@@ -3124,6 +3129,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame
- }
- goto unwind_done;
- }
-+#endif
- }
- else WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) );
-
diff --git a/emulators/wine-devel/patches/patch-dlls_ntdll_string.c b/emulators/wine-devel/patches/patch-dlls_ntdll_string.c
deleted file mode 100644
index 14a169cb13f..00000000000
--- a/emulators/wine-devel/patches/patch-dlls_ntdll_string.c
+++ /dev/null
@@ -1,620 +0,0 @@
-$NetBSD: patch-dlls_ntdll_string.c,v 1.1 2016/01/11 22:53:48 joerg Exp $
-
-From https://github.com/wine-mirror/wine/commit/476d97b0eea4ad231e4341add5fcc4b419
-
---- dlls/ntdll/string.c.orig 2015-02-07 08:14:10.000000000 +0000
-+++ dlls/ntdll/string.c
-@@ -24,6 +24,7 @@
- #include "wine/port.h"
-
- #include <ctype.h>
-+#include <limits.h>
- #include <stdarg.h>
- #include <stdlib.h>
- #include <stdio.h>
-@@ -774,16 +775,601 @@ LONG __cdecl NTDLL_atol( const char *npt
- }
-
-
-+/* helper function for *scanf. Returns the value of character c in the
-+ * given base, or -1 if the given character is not a digit of the base.
-+ */
-+static int char2digit( char c, int base )
-+{
-+ if ((c >= '0' && c <= '9') && (c <= '0'+base-1)) return (c-'0');
-+ if (base <= 10) return -1;
-+ if ((c >= 'A') && (c <= 'Z') && (c <= 'A'+base-11)) return (c-'A'+10);
-+ if ((c >= 'a') && (c <= 'z') && (c <= 'a'+base-11)) return (c-'a'+10);
-+ return -1;
-+}
-+
-+
-+static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
-+{
-+ int rd = 0, consumed = 0;
-+ int nch;
-+ if (!*format) return 0;
-+
-+ nch = (consumed++, *str++);
-+ if (nch == '\0')
-+ return EOF;
-+
-+ while (*format)
-+ {
-+ if (isspace( *format ))
-+ {
-+ /* skip whitespace */
-+ while ((nch != '\0') && isspace( nch ))
-+ nch = (consumed++, *str++);
-+ }
-+ else if (*format == '%')
-+ {
-+ int st = 0;
-+ BOOLEAN suppress = 0;
-+ int width = 0;
-+ int base;
-+ int h_prefix = 0;
-+ BOOLEAN l_prefix = FALSE;
-+ BOOLEAN L_prefix = FALSE;
-+ BOOLEAN w_prefix = FALSE;
-+ BOOLEAN I64_prefix = FALSE;
-+ BOOLEAN prefix_finished = FALSE;
-+ format++;
-+ /* a leading asterisk means 'suppress assignment of this field' */
-+ if (*format == '*')
-+ {
-+ format++;
-+ suppress = TRUE;
-+ }
-+ /* look for width specification */
-+ while (isdigit( *format ))
-+ {
-+ width *= 10;
-+ width += *format++ - '0';
-+ }
-+ if (width == 0) width = -1; /* no width spec seen */
-+ /* read prefix (if any) */
-+ while (!prefix_finished)
-+ {
-+ switch (*format)
-+ {
-+ case 'h': h_prefix++; break;
-+ case 'l':
-+ if (*(format+1) == 'l')
-+ {
-+ I64_prefix = TRUE;
-+ format++;
-+ }
-+ l_prefix = TRUE;
-+ break;
-+ case 'w': w_prefix = TRUE; break;
-+ case 'L': L_prefix = TRUE; break;
-+ case 'I':
-+ if (*(format + 1) == '6' &&
-+ *(format + 2) == '4')
-+ {
-+ I64_prefix = TRUE;
-+ format += 2;
-+ }
-+ break;
-+ default:
-+ prefix_finished = TRUE;
-+ }
-+ if (!prefix_finished) format++;
-+ }
-+ /* read type */
-+ switch (*format)
-+ {
-+ case 'p':
-+ case 'P': /* pointer. */
-+ if (sizeof(void *) == sizeof(LONGLONG)) I64_prefix = TRUE;
-+ /* fall through */
-+ case 'x':
-+ case 'X': /* hexadecimal integer. */
-+ base = 16;
-+ goto number;
-+ case 'o': /* octal integer */
-+ base = 8;
-+ goto number;
-+ case 'u': /* unsigned decimal integer */
-+ base = 10;
-+ goto number;
-+ case 'd': /* signed decimal integer */
-+ base = 10;
-+ goto number;
-+ case 'i': /* generic integer */
-+ base = 0;
-+ number:
-+ {
-+ /* read an integer */
-+ ULONGLONG cur = 0;
-+ BOOLEAN negative = FALSE;
-+ BOOLEAN seendigit = FALSE;
-+ /* skip initial whitespace */
-+ while ((nch != '\0') && isspace( nch ))
-+ nch = (consumed++, *str++);
-+ /* get sign */
-+ if (nch == '-' || nch == '+')
-+ {
-+ negative = (nch == '-');
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ }
-+ /* look for leading indication of base */
-+ if (width != 0 && nch == '0' && *format != 'p' && *format != 'P')
-+ {
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ seendigit = TRUE;
-+ if (width != 0 && (nch == 'x' || nch == 'X'))
-+ {
-+ if (base == 0)
-+ base = 16;
-+ if (base == 16)
-+ {
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ seendigit = FALSE;
-+ }
-+ } else if (base == 0)
-+ base = 8;
-+ }
-+ /* format %i without indication of base */
-+ if (base == 0)
-+ base = 10;
-+ /* throw away leading zeros */
-+ while (width != 0 && nch == '0')
-+ {
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ seendigit = TRUE;
-+ }
-+ if (width != 0 && char2digit( nch, base ) != -1)
-+ {
-+ cur = char2digit( nch, base );
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ seendigit = TRUE;
-+ }
-+ /* read until no more digits */
-+ while (width != 0 && nch != '\0' && char2digit( nch, base ) != -1)
-+ {
-+ cur = cur*base + char2digit( nch, base );
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ seendigit = TRUE;
-+ }
-+ /* okay, done! */
-+ if (!seendigit) break; /* not a valid number */
-+ st = 1;
-+ if (!suppress)
-+ {
-+#define _SET_NUMBER_( type ) *va_arg( ap, type* ) = negative ? -cur : cur
-+ if (I64_prefix) _SET_NUMBER_( LONGLONG );
-+ else if (l_prefix) _SET_NUMBER_( LONG );
-+ else if (h_prefix == 1) _SET_NUMBER_( short int );
-+ else _SET_NUMBER_( int );
-+ }
-+ }
-+ break;
-+ case 'e':
-+ case 'E':
-+ case 'f':
-+ case 'g':
-+ case 'G':
-+ { /* read a float */
-+ long double cur = 1, expcnt = 10;
-+ ULONGLONG d, hlp;
-+ int exp = 0;
-+ BOOLEAN negative = FALSE;
-+ /*unsigned fpcontrol;*/
-+ BOOLEAN negexp;
-+
-+ /* skip initial whitespace */
-+ while (nch != '\0' && isspace( nch ))
-+ nch = (consumed++, *str++);
-+
-+ /* get sign */
-+ if (nch == '-' || nch == '+')
-+ {
-+ negative = (nch == '-');
-+ if (width > 0) width--;
-+ if (width == 0) break;
-+ nch = (consumed++, *str++);
-+ }
-+
-+ /* get first digit */
-+ if ('.' != nch)
-+ {
-+ if (!isdigit( nch )) break;
-+ d = nch - '0';
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ /* read until no more digits */
-+ while (width != 0 && nch != '\0' && isdigit( nch ))
-+ {
-+ hlp = d * 10 + nch - '0';
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ if(d > (ULONGLONG)-1/10 || hlp < d)
-+ {
-+ exp++;
-+ break;
-+ }
-+ else
-+ d = hlp;
-+ }
-+ while (width != 0 && nch != '\0' && isdigit( nch ))
-+ {
-+ exp++;
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ }
-+ }
-+ else
-+ d = 0; /* Fix: .8 -> 0.8 */
-+
-+ /* handle decimals */
-+ if (width != 0 && nch == '.')
-+ {
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+
-+ while (width != 0 && nch != '\0' && isdigit( nch ))
-+ {
-+ hlp = d * 10 + nch - '0';
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ if(d > (ULONGLONG)-1/10 || hlp < d)
-+ break;
-+
-+ d = hlp;
-+ exp--;
-+ }
-+ while (width != 0 && nch != '\0' && isdigit( nch ))
-+ {
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ }
-+ }
-+
-+ /* handle exponent */
-+ if (width != 0 && (nch == 'e' || nch == 'E'))
-+ {
-+ int sign = 1, e = 0;
-+
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ if (width != 0 && (nch == '+' || nch == '-'))
-+ {
-+ if(nch == '-')
-+ sign = -1;
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ }
-+
-+ /* exponent digits */
-+ while (width != 0 && nch != '\0' && isdigit( nch ))
-+ {
-+ if (e > INT_MAX/10 || (e = e * 10 + nch - '0') < 0)
-+ e = INT_MAX;
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ }
-+ e *= sign;
-+
-+ if(exp < 0 && e < 0 && e+exp > 0) exp = INT_MIN;
-+ else if(exp > 0 && e > 0 && e+exp < 0) exp = INT_MAX;
-+ else exp += e;
-+ }
-+
-+ /*fpcontrol = _control87(0, 0);
-+ _control87(MSVCRT__EM_DENORMAL|MSVCRT__EM_INVALID|MSVCRT__EM_ZERODIVIDE
-+ |MSVCRT__EM_OVERFLOW|MSVCRT__EM_UNDERFLOW|MSVCRT__EM_INEXACT, 0xffffffff);*/
-+
-+ negexp = (exp < 0);
-+ if (negexp)
-+ exp = -exp;
-+ /* update 'cur' with this exponent. */
-+ while (exp)
-+ {
-+ if(exp & 1)
-+ cur *= expcnt;
-+ exp /= 2;
-+ expcnt = expcnt*expcnt;
-+ }
-+ cur = (negexp ? d/cur : d*cur);
-+
-+ /*_control87(fpcontrol, 0xffffffff);*/
-+
-+ st = 1;
-+ if (!suppress)
-+ {
-+ if (L_prefix || l_prefix) _SET_NUMBER_( double );
-+ else _SET_NUMBER_( float );
-+ }
-+ }
-+ break;
-+ /* According to msdn,
-+ * 's' reads a character string in a call to fscanf
-+ * and 'S' a wide character string and vice versa in a
-+ * call to fwscanf. The 'h', 'w' and 'l' prefixes override
-+ * this behaviour. 'h' forces reading char * but 'l' and 'w'
-+ * force reading WCHAR. */
-+ case 's':
-+ if (w_prefix || l_prefix) goto widecharstring;
-+ else if (h_prefix) goto charstring;
-+ else goto charstring;
-+ case 'S':
-+ if (w_prefix || l_prefix) goto widecharstring;
-+ else if (h_prefix) goto charstring;
-+ else goto widecharstring;
-+ charstring:
-+ { /* read a word into a char */
-+ char *sptr = suppress ? NULL : va_arg( ap, char * );
-+ char *sptr_beg = sptr;
-+ unsigned size = UINT_MAX;
-+ /* skip initial whitespace */
-+ while (nch != '\0' && isspace( nch ))
-+ nch = (consumed++, *str++);
-+ /* read until whitespace */
-+ while (width != 0 && nch != '\0' && !isspace( nch ))
-+ {
-+ if (!suppress)
-+ {
-+ *sptr++ = nch;
-+ if(size > 1) size--;
-+ else
-+ {
-+ *sptr_beg = 0;
-+ return rd;
-+ }
-+ }
-+ st++;
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ }
-+ /* terminate */
-+ if (st && !suppress) *sptr = 0;
-+ }
-+ break;
-+ widecharstring:
-+ { /* read a word into a WCHAR * */
-+ WCHAR *sptr = suppress ? NULL : va_arg( ap, WCHAR * );
-+ WCHAR *sptr_beg = sptr;
-+ unsigned size = UINT_MAX;
-+ /* skip initial whitespace */
-+ while (nch != '\0' && isspace( nch ))
-+ nch = (consumed++, *str++);
-+ /* read until whitespace */
-+ while (width != 0 && nch != '\0' && !isspace( nch ))
-+ {
-+ if (!suppress)
-+ {
-+ *sptr++ = nch;
-+ if (size > 1) size--;
-+ else
-+ {
-+ *sptr_beg = 0;
-+ return rd;
-+ }
-+ }
-+ st++;
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ }
-+ /* terminate */
-+ if (st && !suppress) *sptr = 0;
-+ }
-+ break;
-+ /* 'c' and 'C work analogously to 's' and 'S' as described
-+ * above */
-+ case 'c':
-+ if (w_prefix || l_prefix) goto widecharacter;
-+ else if (h_prefix) goto character;
-+ else goto character;
-+ case 'C':
-+ if (w_prefix || l_prefix) goto widecharacter;
-+ else if (h_prefix) goto character;
-+ else goto widecharacter;
-+ character:
-+ { /* read single character into char */
-+ char *str = suppress ? NULL : va_arg( ap, char * );
-+ char *pstr = str;
-+ unsigned size = UINT_MAX;
-+ if (width == -1) width = 1;
-+ while (width && nch != '\0')
-+ {
-+ if (!suppress)
-+ {
-+ *str++ = nch;
-+ if(size) size--;
-+ else
-+ {
-+ *pstr = 0;
-+ return rd;
-+ }
-+ }
-+ st++;
-+ width--;
-+ nch = (consumed++, *str++);
-+ }
-+ }
-+ break;
-+ widecharacter:
-+ { /* read single character into a WCHAR */
-+ WCHAR *str = suppress ? NULL : va_arg( ap, WCHAR * );
-+ WCHAR *pstr = str;
-+ unsigned size = UINT_MAX;
-+ if (width == -1) width = 1;
-+ while (width && nch != '\0')
-+ {
-+ if (!suppress)
-+ {
-+ *str++ = nch;
-+ if (size) size--;
-+ else
-+ {
-+ *pstr = 0;
-+ return rd;
-+ }
-+ }
-+ st++;
-+ width--;
-+ nch = (consumed++, *str++);
-+ }
-+ }
-+ break;
-+ case 'n':
-+ {
-+ if (!suppress)
-+ {
-+ int *n = va_arg( ap, int * );
-+ *n = consumed - 1;
-+ }
-+ /* This is an odd one: according to the standard,
-+ * "Execution of a %n directive does not increment the
-+ * assignment count returned at the completion of
-+ * execution" even if it wasn't suppressed with the
-+ * '*' flag. The Corrigendum to the standard seems
-+ * to contradict this (comment out the assignment to
-+ * suppress below if you want to implement these
-+ * alternate semantics) but the windows program I'm
-+ * looking at expects the behavior I've coded here
-+ * (which happens to be what glibc does as well).
-+ */
-+ suppress = TRUE;
-+ st = 1;
-+ }
-+ break;
-+ case '[':
-+ {
-+ char *str = suppress ? NULL : va_arg( ap, char * );
-+ char *sptr = str;
-+ RTL_BITMAP bitMask;
-+ ULONG Mask[8];
-+ BOOLEAN invert = FALSE; /* Set if we are NOT to find the chars */
-+ unsigned size = UINT_MAX;
-+
-+ RtlInitializeBitMap( &bitMask, Mask, sizeof(Mask) * 8 );
-+
-+ /* Read the format */
-+ format++;
-+ if (*format == '^')
-+ {
-+ invert = TRUE;
-+ format++;
-+ }
-+ if (*format == ']')
-+ {
-+ RtlSetBits( &bitMask, ']', 1 );
-+ format++;
-+ }
-+ while (*format && (*format != ']'))
-+ {
-+ /* According to msdn:
-+ * "Note that %[a-z] and %[z-a] are interpreted as equivalent to %[abcde...z]." */
-+ if ((*format == '-') && (*(format + 1) != ']'))
-+ {
-+ if ((*(format - 1)) < *(format + 1))
-+ RtlSetBits( &bitMask, *(format - 1) +1 , *(format + 1) - *(format - 1) );
-+ else
-+ RtlSetBits( &bitMask, *(format + 1) , *(format - 1) - *(format + 1) );
-+ format++;
-+ }
-+ else
-+ RtlSetBits( &bitMask, *format, 1 );
-+ format++;
-+ }
-+ /* read until char is not suitable */
-+ while (width != 0 && nch != '\0')
-+ {
-+ if (!invert)
-+ {
-+ if(RtlAreBitsSet( &bitMask, nch, 1 ))
-+ {
-+ if (!suppress) *sptr++ = nch;
-+ }
-+ else
-+ break;
-+ }
-+ else
-+ {
-+ if (RtlAreBitsClear( &bitMask, nch, 1 ))
-+ {
-+ if (!suppress) *sptr++ = nch;
-+ }
-+ else
-+ break;
-+ }
-+ st++;
-+ nch = (consumed++, *str++);
-+ if (width > 0) width--;
-+ if(size > 1) size--;
-+ else
-+ {
-+ *str = 0;
-+ return rd;
-+ }
-+ }
-+ /* terminate */
-+ if (!suppress) *sptr = 0;
-+ }
-+ break;
-+ default:
-+ /* From spec: "if a percent sign is followed by a character
-+ * that has no meaning as a format-control character, that
-+ * character and the following characters are treated as
-+ * an ordinary sequence of characters, that is, a sequence
-+ * of characters that must match the input. For example,
-+ * to specify that a percent-sign character is to be input,
-+ * use %%." */
-+ while (nch != '\0' && isspace( nch ))
-+ nch = (consumed++, *str++);
-+ if (nch == *format)
-+ {
-+ suppress = TRUE; /* whoops no field to be read */
-+ st = 1; /* but we got what we expected */
-+ nch = (consumed++, *str++);
-+ }
-+ break;
-+ }
-+ if (st && !suppress) rd++;
-+ else if (!st) break;
-+ }
-+ /* A non-white-space character causes scanf to read, but not store,
-+ * a matching non-white-space character. */
-+ else
-+ {
-+ if (nch == *format)
-+ nch = (consumed++, *str++);
-+ else break;
-+ }
-+ format++;
-+ }
-+ if (nch != '\0')
-+ {
-+ consumed--, str--;
-+ }
-+
-+ return rd;
-+}
-+
-+
- /*********************************************************************
- * sscanf (NTDLL.@)
- */
- int __cdecl NTDLL_sscanf( const char *str, const char *format, ... )
- {
- int ret;
-- va_list valist;
-- va_start( valist, format );
-- ret = vsscanf( str, format, valist );
-- va_end( valist );
-+ __ms_va_list valist;
-+ __ms_va_start( valist, format );
-+ ret = NTDLL_vsscanf( str, format, valist );
-+ __ms_va_end( valist );
- return ret;
- }
-
diff --git a/emulators/wine-devel/patches/patch-dlls_winepulse.drv_mmdevdrv.c b/emulators/wine-devel/patches/patch-dlls_winepulse.drv_mmdevdrv.c
new file mode 100644
index 00000000000..bc7556d81c3
--- /dev/null
+++ b/emulators/wine-devel/patches/patch-dlls_winepulse.drv_mmdevdrv.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-dlls_winepulse.drv_mmdevdrv.c,v 1.1 2016/09/15 09:25:53 maya Exp $
+
+Check for pthread_mutexattr_setprotocol.
+
+--- dlls/winepulse.drv/mmdevdrv.c.orig 2016-06-10 14:04:01.000000000 +0000
++++ dlls/winepulse.drv/mmdevdrv.c
+@@ -98,7 +98,9 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD
+ DisableThreadLibraryCalls(dll);
+
+ pthread_mutexattr_init(&attr);
++#ifdef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
+ pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
++#endif
+
+ if (pthread_mutex_init(&pulse_lock, &attr) != 0)
+ pthread_mutex_init(&pulse_lock, NULL);
diff --git a/emulators/wine-devel/patches/patch-dlls_wininet_http.c b/emulators/wine-devel/patches/patch-dlls_wininet_http.c
new file mode 100644
index 00000000000..387d0182176
--- /dev/null
+++ b/emulators/wine-devel/patches/patch-dlls_wininet_http.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-dlls_wininet_http.c,v 1.1 2016/09/15 09:25:53 maya Exp $
+
+--- dlls/wininet/http.c.orig 2016-09-02 16:39:28.000000000 +0000
++++ dlls/wininet/http.c
+@@ -35,14 +35,14 @@
+ # include <zlib.h>
+ #endif
+
+-#include "winsock2.h"
+-#include "ws2ipdef.h"
+-
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <assert.h>
+
++#include "winsock2.h"
++#include "ws2ipdef.h"
++
+ #include "windef.h"
+ #include "winbase.h"
+ #include "wininet.h"
diff --git a/emulators/wine-devel/patches/patch-dlls_ws2__32_socket.c b/emulators/wine-devel/patches/patch-dlls_ws2__32_socket.c
deleted file mode 100644
index d78fcba847d..00000000000
--- a/emulators/wine-devel/patches/patch-dlls_ws2__32_socket.c
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-dlls_ws2__32_socket.c,v 1.1 2014/01/19 10:58:23 adam Exp $
-
-Fix AI_V4MAPPED confusion on NetBSD.
-
---- dlls/ws2_32/socket.c.orig 2014-01-03 19:00:47.000000000 +0000
-+++ dlls/ws2_32/socket.c
-@@ -173,6 +173,10 @@
- #define INADDR_NONE ~0UL
- #endif
-
-+#ifdef USE_WS_PREFIX
-+#define AI_V4MAPPED WS_AI_V4MAPPED
-+#endif
-+
- WINE_DEFAULT_DEBUG_CHANNEL(winsock);
- WINE_DECLARE_DEBUG_CHANNEL(winediag);
-
diff --git a/emulators/wine-devel/patches/patch-include_config.h.in b/emulators/wine-devel/patches/patch-include_config.h.in
new file mode 100644
index 00000000000..17ec4eb9304
--- /dev/null
+++ b/emulators/wine-devel/patches/patch-include_config.h.in
@@ -0,0 +1,16 @@
+$NetBSD: patch-include_config.h.in,v 1.1 2016/09/15 09:25:53 maya Exp $
+
+Check for pthread_mutexattr_setprotocol.
+
+--- include/config.h.in.orig 2016-06-10 14:04:01.000000000 +0000
++++ include/config.h.in
+@@ -708,6 +708,9 @@
+ /* Define to 1 if you have the <pulse/pulseaudio.h> header file. */
+ #undef HAVE_PULSE_PULSEAUDIO_H
+
++/* Define to 1 if you have the `pthread_mutexattr_setprotocol' function. */
++#undef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
++
+ /* Define to 1 if you have the <pwd.h> header file. */
+ #undef HAVE_PWD_H
+