emulators/wine-proton: Add a new port.

This is a special version of Wine developed by Valve.

PR:		250264
Submitted by:	Alex S <iwtcex@gmail.com>
Reviewed by:	Damjan Jovanovic <damjan.jov@gmail.com>
This commit is contained in:
Gleb Popov 2020-11-30 16:10:46 +00:00
parent 56067401b4
commit 01bf406fbd
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=556653
14 changed files with 2721 additions and 0 deletions

View File

@ -166,6 +166,7 @@
SUBDIR += wine-gecko-devel
SUBDIR += wine-mono
SUBDIR += wine-mono-devel
SUBDIR += wine-proton
SUBDIR += winetricks
SUBDIR += x16-emulator
SUBDIR += x16-rom

View File

@ -0,0 +1,124 @@
# $FreeBSD$
PORTNAME= wine-proton
DISTVERSION= 5.13-2
CATEGORIES= emulators
MAINTAINER= iwtcex@gmail.com
COMMENT= Wine with a bit of extra spice
LICENSE= LGPL21 LGPL3
LICENSE_COMB= dual
LICENSE_FILE= ${WRKSRC}/LICENSE
ONLY_FOR_ARCHS= amd64 i386
BUILD_DEPENDS= ${LOCALBASE}/bin/flex:textproc/flex \
prelink:sysutils/prelink
LIB_DEPENDS= libFAudio.so:audio/faudio \
libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2 \
libgnutls.so:security/gnutls \
libjpegxr.so:graphics/libjxr \
liblcms2.so:graphics/lcms2 \
libpng.so:graphics/png \
libvulkan.so:graphics/vulkan-loader \
libxml2.so:textproc/libxml2
USES= bison desktop-file-utils gettext-runtime gl gmake jpeg localbase openal pkgconfig sdl shebangfix tar:xz xorg
USE_GITHUB= yes
GH_ACCOUNT= ValveSoftware
GH_PROJECT= wine
GH_TAGNAME= d6646652a2f5f85d51fab5df3383f04bef713a18
USE_GCC= yes
USE_GL= glu
USE_GNOME= glib20
USE_GSTREAMER1= good
USE_SDL= sdl2
USE_XORG= x11 xext xcomposite xcursor xi xinerama xrandr xrender
GNU_CONFIGURE= yes
GNU_CONFIGURE_PREFIX= ${PREFIX}/${PORTNAME}
CONFIGURE_ARGS= --verbose \
--libdir=${PREFIX}/${PORTNAME}/lib \
--disable-kerberos \
--disable-tests \
--with-cms \
--with-fontconfig \
--with-freetype \
--with-glu \
--with-gnutls \
--with-gstreamer \
--with-jpeg \
--with-jxrlib \
--with-openal \
--with-opengl \
--with-oss \
--with-png \
--with-sdl \
--with-vulkan \
--with-x \
--with-xinerama \
--with-xinput2 \
--with-xrandr \
--with-xrender \
--without-alsa \
--without-capi \
--without-cups \
--without-dbus \
--without-gettext \
--without-gettextpo \
--without-gphoto \
--without-gsm \
--without-hal \
--without-inotify \
--without-krb5 \
--without-ldap \
--without-mingw \
--without-mpg123 \
--without-opencl \
--without-osmesa \
--without-pulse \
--without-sane \
--without-tiff \
--without-udev \
--without-unwind \
--without-usb \
--without-v4l2 \
--without-vkd3d \
--without-xslt
CONFIGURE_ENV= CPPBIN="${CPP}" FLEX="${LOCALBASE}/bin/flex" JXRLIB_CFLAGS="-I${LOCALBASE}/include/jxrlib"
SHEBANG_FILES= tools/make_requests tools/winemaker/winemaker \
tools/winedump/function_grep.pl
.include <bsd.port.pre.mk>
.if ${ARCH} == amd64
PLIST_SUB+= WINE32="@comment " WINE64=""
CONFIGURE_ARGS+=--enable-win64
.else
PLIST_SUB+= WINE32="" WINE64="@comment "
.endif
pre-build:
cd ${WRKSRC} && ${MAKE_CMD} depend
post-install:
.if ${ARCH} == i386
${MV} ${STAGEDIR}${PREFIX}/${PORTNAME}/bin/wineserver ${STAGEDIR}${PREFIX}/${PORTNAME}/bin/wineserver32
${MV} ${STAGEDIR}${PREFIX}/${PORTNAME}/bin/wine ${STAGEDIR}${PREFIX}/${PORTNAME}/bin/wine32
${INSTALL_SCRIPT} ${FILESDIR}/wine.sh ${STAGEDIR}${PREFIX}/${PORTNAME}/bin/wine
.endif
${RM} -r ${STAGEDIR}${PREFIX}/${PORTNAME}/include
${RM} -r ${STAGEDIR}${MANPREFIX}/man
${MKDIR} ${STAGEDIR}${DOCSDIR}
.for i in README ANNOUNCE AUTHORS
${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}
.endfor
.include <bsd.port.post.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1605331527
SHA256 (ValveSoftware-wine-5.13-2-d6646652a2f5f85d51fab5df3383f04bef713a18_GH0.tar.gz) = 5b2478f3329c9fcb00f4d60502fb30b80da2da7e280fd6f20731aaf8befdc143
SIZE (ValveSoftware-wine-5.13-2-d6646652a2f5f85d51fab5df3383f04bef713a18_GH0.tar.gz) = 40177301

View File

@ -0,0 +1,42 @@
From: Gerald Pfeifer <gerald@pfeifer.com>
To: wine-devel@winehq.org
Date: Sat, 18 Jul 2020 12:02:58 +0300 (EEST)
Subject: [PATCH] ntdll: Include <signal.h> for sigset_t
commit 7053b7c615b44e7112ab8fb4c056206d32b6f1c9
Author: Alexandre Julliard <julliard@winehq.org>
Date: Fri Jul 17 11:46:15 2020 +0200
ntdll: Move the registry system calls to the Unix library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
broke non-Linux platforms since sigset_t isn't necessarily defined
based on the #include statements in the new dlls/ntdll/unix/registry.c.
This fixes it.
Observed and tested on FreeBSD 11.4/i386.
Gerald
Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
---
dlls/ntdll/unix/registry.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/ntdll/unix/registry.c b/dlls/ntdll/unix/registry.c
index f94c8ff98e..6d58361818 100644
--- dlls/ntdll/unix/registry.c
+++ dlls/ntdll/unix/registry.c
@@ -25,6 +25,7 @@
#pragma makedep unix
#endif
+#include <signal.h>
#include <stdarg.h>
#include <string.h>
--
2.27.0

View File

@ -0,0 +1,32 @@
--- dlls/ntdll/unix/fsync.c.orig
+++ dlls/ntdll/unix/fsync.c
@@ -76,17 +76,29 @@
static inline int futex_wait_multiple( const struct futex_wait_block *futexes,
int count, const struct timespec *timeout )
{
+#ifdef __linux__
return syscall( __NR_futex, futexes, 31, count, timeout, 0, 0 );
+#else
+ assert(0);
+#endif
}
static inline int futex_wake( int *addr, int val )
{
+#ifdef __linux__
return syscall( __NR_futex, addr, 1, val, NULL, 0, 0 );
+#else
+ assert(0);
+#endif
}
static inline int futex_wait( int *addr, int val, struct timespec *timeout )
{
+#ifdef __linux__
return syscall( __NR_futex, addr, 0, val, timeout, 0, 0 );
+#else
+ assert(0);
+#endif
}
static unsigned int spincount;

View File

@ -0,0 +1,11 @@
--- dlls/ntdll/unix/loader.c.orig
+++ dlls/ntdll/unix/loader.c
@@ -1306,7 +1306,7 @@
#ifdef __FreeBSD__
/* On older FreeBSD versions, l_addr was the absolute load address, now it's the relocation offset. */
- if (!dlsym(RTLD_DEFAULT, "_rtld_version_laddr_offset"))
+ if (offsetof(struct link_map, l_addr) == 0)
if (!get_relocbase(map->l_addr, &relocbase)) return;
#endif
switch (dyn->d_tag)

View File

@ -0,0 +1,49 @@
--- dlls/ntdll/unix/signal_x86_64.c.orig
+++ dlls/ntdll/unix/signal_x86_64.c
@@ -156,6 +156,8 @@
#elif defined(__FreeBSD__) || defined (__FreeBSD_kernel__)
+#include <machine/trap.h>
+
#define RAX_sig(context) ((context)->uc_mcontext.mc_rax)
#define RBX_sig(context) ((context)->uc_mcontext.mc_rbx)
#define RCX_sig(context) ((context)->uc_mcontext.mc_rcx)
@@ -260,5 +262,26 @@
enum i386_trap_code
{
+#if defined(__FreeBSD__) || defined (__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+ TRAP_x86_DIVIDE = T_DIVIDE, /* Division by zero exception */
+ TRAP_x86_TRCTRAP = T_TRCTRAP, /* Single-step exception */
+ TRAP_x86_NMI = T_NMI, /* NMI interrupt */
+ TRAP_x86_BPTFLT = T_BPTFLT, /* Breakpoint exception */
+ TRAP_x86_OFLOW = T_OFLOW, /* Overflow exception */
+ TRAP_x86_BOUND = T_BOUND, /* Bound range exception */
+ TRAP_x86_PRIVINFLT = T_PRIVINFLT, /* Invalid opcode exception */
+ TRAP_x86_DNA = T_DNA, /* Device not available exception */
+ TRAP_x86_DOUBLEFLT = T_DOUBLEFLT, /* Double fault exception */
+ TRAP_x86_FPOPFLT = T_FPOPFLT, /* Coprocessor segment overrun */
+ TRAP_x86_TSSFLT = T_TSSFLT, /* Invalid TSS exception */
+ TRAP_x86_SEGNPFLT = T_SEGNPFLT, /* Segment not present exception */
+ TRAP_x86_STKFLT = T_STKFLT, /* Stack fault */
+ TRAP_x86_PROTFLT = T_PROTFLT, /* General protection fault */
+ TRAP_x86_PAGEFLT = T_PAGEFLT, /* Page fault */
+ TRAP_x86_ARITHTRAP = T_ARITHTRAP, /* Floating point exception */
+ TRAP_x86_ALIGNFLT = T_ALIGNFLT, /* Alignment check exception */
+ TRAP_x86_MCHK = T_MCHK, /* Machine check exception */
+ TRAP_x86_CACHEFLT = T_XMMFLT /* Cache flush exception */
+#else
TRAP_x86_DIVIDE = 0, /* Division by zero exception */
TRAP_x86_TRCTRAP = 1, /* Single-step exception */
TRAP_x86_NMI = 2, /* NMI interrupt */
@@ -278,7 +301,9 @@
TRAP_x86_ARITHTRAP = 16, /* Floating point exception */
TRAP_x86_ALIGNFLT = 17, /* Alignment check exception */
TRAP_x86_MCHK = 18, /* Machine check exception */
- TRAP_x86_CACHEFLT = 19 /* Cache flush exception */
+ TRAP_x86_CACHEFLT = 19 /* SIMD exception (via SIGFPE) if CPU is SSE capable
+ otherwise Cache flush exception (via SIGSEV) */
+#endif
};
static const size_t teb_size = 0x2000; /* we reserve two pages for the TEB */

View File

@ -0,0 +1,15 @@
--- dlls/winebus.sys/bus_sdl.c.orig
+++ dlls/winebus.sys/bus_sdl.c
@@ -1070,12 +1070,6 @@
version = 0;
}
- if(is_already_opened_by_hidraw(vid, pid))
- {
- /* we use SDL only for controllers which hidraw couldn't open */
- TRACE("device %04x/%04x already opened by hidraw, skipping\n", vid, pid);
- return;
- }
if(is_in_sdl_blacklist(vid, pid))
{

View File

@ -0,0 +1,31 @@
--- server/fsync.c.orig
+++ server/fsync.c
@@ -58,12 +58,16 @@
};
#include "poppack.h"
+#ifdef __linux__
+
static inline int futex_wait_multiple( const struct futex_wait_block *futexes,
int count, const struct timespec *timeout )
{
return syscall( __NR_futex, futexes, 31, count, timeout, 0, 0 );
}
+#endif
+
int do_fsync(void)
{
#ifdef __linux__
@@ -320,7 +324,11 @@
static inline int futex_wake( int *addr, int val )
{
+#ifdef __linux__
return syscall( __NR_futex, addr, 1, val, NULL, 0, 0 );
+#else
+ assert(0);
+#endif
}
/* shm layout for events or event-like objects. */

View File

@ -0,0 +1,61 @@
--- server/ptrace.c.orig
+++ server/ptrace.c
@@ -291,12 +291,40 @@
/* read a long from a thread address space */
static int read_thread_long( struct thread *thread, void *addr, unsigned long *data )
{
+#if defined(__FreeBSD__) && defined(__x86_64__)
+
+ int lo, hi;
+
+ errno = 0;
+
+ lo = ptrace(PTRACE_PEEKDATA, get_ptrace_pid(thread), (caddr_t)addr, 0);
+ if (lo == -1 && errno)
+ {
+ *data = -1;
+ file_set_error();
+ return -1;
+ }
+
+ hi = ptrace(PTRACE_PEEKDATA, get_ptrace_pid(thread), (caddr_t)addr + 4, 0);
+ if (hi == -1 && errno)
+ {
+ *data = -1;
+ file_set_error();
+ return -1;
+ }
+
+ *data = hi;
+ *data = (*data << 32) + lo;
+
+ return 0;
+#else
errno = 0;
*data = ptrace( PTRACE_PEEKDATA, get_ptrace_pid(thread), (caddr_t)addr, 0 );
if ( *data == -1 && errno)
{
file_set_error();
return -1;
}
return 0;
+#endif
}
@@ -322,8 +350,18 @@
if (read_thread_long( thread, addr, &old_data ) == -1) return -1;
data = (data & mask) | (old_data & ~mask);
}
+
+#if defined(__FreeBSD__) && defined(__x86_64__)
+ if ((res = ptrace(PTRACE_POKEDATA, get_ptrace_pid(thread), (caddr_t)addr, data)) == -1 ||
+ (res = ptrace(PTRACE_POKEDATA, get_ptrace_pid(thread), (caddr_t)addr + 4, data >> 32)) == -1)
+ {
+ file_set_error();
+ }
+#else
if ((res = ptrace( PTRACE_POKEDATA, get_ptrace_pid(thread), (caddr_t)addr, data )) == -1)
file_set_error();
+#endif
+
return res;
}

View File

@ -0,0 +1,16 @@
-L../libs/wine goes before -L/usr/local/lib.
--- tools/makedep.c.orig
+++ tools/makedep.c
@@ -3635,7 +3635,10 @@
if (strarray_exists( &all_libs, "-lwine" ))
{
+ struct strarray old_libs = all_libs;
+ all_libs = empty_strarray;
strarray_add( &all_libs, strmake( "-L%s", top_obj_dir_path( make, "libs/wine" )));
+ strarray_addall(&all_libs, old_libs);
if (ldrpath_local && ldrpath_install)
{
program_installed = strmake( "%s-installed%s", make->programs.str[i], exe_ext );

View File

@ -0,0 +1,4 @@
#!/bin/sh
TARGET="`realpath $0`"
export WINESERVER=${WINESERVER-${TARGET}server32}
exec "${TARGET}32" "$@"

View File

@ -0,0 +1,4 @@
The Wine (http://www.winehq.org/) fork used by Proton, a Windows compatibility
tool for the Linux Steam client.
WWW: https://github.com/ValveSoftware/wine

File diff suppressed because it is too large Load Diff