Skip to content

Commit

Permalink
emulators/wine: Update to Wine 9.0
Browse files Browse the repository at this point in the history
Move from Wine 8.0.2 and the Wine 8.0 release series to Wine 9.0 which
represents another year of upstream development and over 7000 individual
changes.

Touted highlights include the new WoW64 architecture and an experimental
Wayland driver - neither of which upstream nor us have enabled yet.

Other areas of major changes include:

 - The PostScript driver is reimplemented to work from Windows-format
   spool files and avoid any direct calls from the Unix side.
 - The Vulkan driver supports up to version 1.3.272 of the Vulkan spec.
 - A number of GdiPlus functions are optimized for better graphics
   performance and quite some work on Direct3D.
 - The Windows Media Video (WMV) decoder DirectX Media Object (DMO),
   DirectShow Audio Capture filter, and DirectShow MPEG‑1 Video Decoder
   filter are implemented.
 - DirectInput action maps are implemented, improving compatibility
   with many old games that use this to map controller inputs to
   in-game actions.
 - URL/URI protocol associations are exported as URL handlers to the
   FreeBSD desktop.
 - Monitor information like name and model id are retrieved from the
   physical monitor's Extended Display Identification Data (EDID).
 - Internationalization work, new timezone database (2023c), 15.1.0
   of the Unicode Standard.
 - The default Windows version for new prefixes is set to Windows 10.
 - Address space layout randomization (ASLR) is supported for modern
   PE binaries, to avoid issues with address space conflicts.

FluidSynth (2.3.3), Musl (1.2.3), and Zydis (4.0.0) are now bundled
and several bundled libraries have been updated: Vkd3d (1.10),
Faudio (23.12), LDAP (2.5.16), LCMS2 (2.15), LibMPG123 (1.32.2),
LibPng (1.6.40), LibTiff (4.6.0), LibXml2 (2.11.5), LibXslt (1.1.38),
Zlib (1.3).

Extensive release notes are at https://www.winehq.org/announce/9.0 .

We now explicitly build --without-pcap, --without-pcsclite, and
--without-wayland and enable gstreamer support only when ALSA or
OSS are enabled.

And we include files/extra-patch-tools-winebuild-res32 to work
around intermittent build problems on i386 and have to drop
files/patch-dlls_ntdll_unix_loader.c which no longer applies.

emulators/wine8 is available for anyone needing that previous version.
  • Loading branch information
Gerald Pfeifer authored and Gerald Pfeifer committed Apr 7, 2024
1 parent 65c26fb commit 4c1cbff
Show file tree
Hide file tree
Showing 5 changed files with 1,055 additions and 303 deletions.
27 changes: 20 additions & 7 deletions emulators/wine/Makefile
@@ -1,9 +1,8 @@
PORTNAME= wine
DISTVERSION= 8.0.2
PORTREVISION= 2
DISTVERSION= 9.0
PORTEPOCH= 1
CATEGORIES= emulators
MASTER_SITES= https://dl.winehq.org/wine/source/8.0/
MASTER_SITES= https://dl.winehq.org/wine/source/9.0/

MAINTAINER= gerald@FreeBSD.org
COMMENT= Microsoft Windows compatibility environment
Expand Down Expand Up @@ -37,21 +36,22 @@ CONFIGURE_ARGS+=--verbose \
--without-gettext --without-gettextpo \
--without-gphoto \
--without-gssapi \
--without-gstreamer \
--without-inotify \
--without-krb5 \
--with-mingw CROSSCC="clang" CROSSCFLAGS="-isystem ${FILESDIR}/clang" \
--without-netapi \
--without-opencl \
--without-osmesa \
--with-pcap \
--without-pcap \
--without-pcsclite \
--with-pthread \
--without-pulse \
--without-sane \
--with-sdl \
--without-udev \
--without-unwind \
--without-usb
--without-usb \
--without-wayland
CONFIGURE_ENV= CPPBIN="${CPP}" FLEX="${LOCALBASE}/bin/flex"
WINELIBDIR= ${PREFIX}/lib
.if !defined(USE_LDCONFIG32)
Expand Down Expand Up @@ -81,6 +81,8 @@ MONO_DESC= Bundle Mono MSI package for Wine
PORTSCOUT= limit:^8\.0

ALSA_CONFIGURE_WITH= alsa
ALSA_USES= gnome gstreamer
ALSA_USE= GNOME=glib20
ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib
ALSA_RUN_DEPENDS= alsa-plugins>0:audio/alsa-plugins

Expand All @@ -97,6 +99,8 @@ GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
MONO_RUN_DEPENDS= wine-mono>0:emulators/wine-mono

OSS_CONFIGURE_WITH= oss
OSS_USES= gnome gstreamer
OSS_USE= GNOME=glib20

V4L_CONFIGURE_WITH= v4l2
V4L_BUILD_DEPENDS= ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat
Expand All @@ -113,6 +117,14 @@ X11_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MALSA} || ${PORT_OPTIONS:MOSS}
CONFIGURE_ARGS+= --with-gstreamer
PLIST_SUB+= GSTREAMER=""
.else
CONFIGURE_ARGS+= --without-gstreamer
PLIST_SUB+= GSTREAMER="@comment "
.endif

.if ${LLVM_DEFAULT} == 11
_LLVM_VERSION= 15
.else
Expand All @@ -138,6 +150,7 @@ post-patch:
${REINPLACE_CMD} '/Exec/s|wine|wine64|g' ${WRKSRC}/loader/wine.desktop

.else
EXTRA_PATCHES+= files/extra-patch-tools-winebuild-res32
PLIST_SUB+= WINE32="" WINE64="@comment " WINEARCH="i386"
.endif

Expand All @@ -159,7 +172,7 @@ post-install:
.endif

@${MKDIR} ${STAGEDIR}${DOCSDIR}
.for i in README ANNOUNCE AUTHORS
.for i in ANNOUNCE.md AUTHORS README.md
${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}
.endfor
${INSTALL_DATA} ${WRKSRC}/programs/winedbg/README ${STAGEDIR}${DOCSDIR}/README.winedbg
Expand Down
6 changes: 3 additions & 3 deletions emulators/wine/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1691940152
SHA256 (wine-8.0.2.tar.xz) = 6ec8fb6f2c72d576cb11f52b2f8d59af64404802154651d122b98466d91dc847
SIZE (wine-8.0.2.tar.xz) = 29060452
TIMESTAMP = 1707695469
SHA256 (wine-9.0.tar.xz) = 7cfd090a5395f5b76d95bb5defac8a312c8de4c070c1163b8b58da38330ca6ee
SIZE (wine-9.0.tar.xz) = 30007216
95 changes: 95 additions & 0 deletions emulators/wine/files/extra-patch-tools-winebuild-res32
@@ -0,0 +1,95 @@
The upstream change

commit 0b3f90ab1485d5bd32bd72d41c7fd8213b3b95b9
Author: Rémi Bernon <rbernon@codeweavers.com>
Date: Sat Feb 11 11:05:22 2023 +0100

winebuild: Use .incbin instead of printf for resource data.

apparently causes some (not completely reproducible) build
issues on i386 due to resource exhaustion by the compiler,
cf. https://bugs.winehq.org/show_bug.cgi?id=54889 .

https://github.com/llvm/llvm-project/issues/62339 tracks this on
the LLVM side, alas has not really seen progress since April 2003.
So for now this reverts the upstream commit (alas on i386 only as
to minimize divergence and risk on 64-bit x86).


--- tools/winebuild/res32.c
+++ tools/winebuild/res32.c
@@ -44,8 +44,6 @@ struct resource
{
struct string_id type;
struct string_id name;
- const char *input_name;
- unsigned int input_offset;
const void *data;
unsigned int data_size;
unsigned int data_offset;
@@ -158,6 +156,28 @@ static void put_string( const struct string_id *str )
}
}

+static void dump_res_data( const struct resource *res )
+{
+ unsigned int i = 0;
+ unsigned int size = (res->data_size + 3) & ~3;
+
+ if (!size) return;
+
+ input_buffer = res->data;
+ input_buffer_pos = 0;
+ input_buffer_size = size;
+
+ output( "\t.long " );
+ while (size > 4)
+ {
+ if ((i++ % 16) == 15) output( "0x%08x\n\t.long ", get_dword() );
+ else output( "0x%08x,", get_dword() );
+ size -= 4;
+ }
+ output( "0x%08x\n", get_dword() );
+ assert( input_buffer_pos == input_buffer_size );
+}
+
/* check the file header */
/* all values must be zero except header size */
static int check_header(void)
@@ -179,7 +199,7 @@ static int check_header(void)
}

/* load the next resource from the current file */
-static void load_next_resource( DLLSPEC *spec, const char *name )
+static void load_next_resource( DLLSPEC *spec )
{
unsigned int hdr_size;
struct resource *res = add_resource( spec );
@@ -189,9 +209,6 @@ static void load_next_resource( DLLSPEC *spec, const char *name )
if (hdr_size & 3) fatal_error( "%s header size not aligned\n", input_buffer_filename );
if (hdr_size < 32) fatal_error( "%s invalid header size %u\n", input_buffer_filename, hdr_size );

- res->input_name = xstrdup( name );
- res->input_offset = input_buffer_pos - 2*sizeof(unsigned int) + hdr_size;
-
res->data = input_buffer + input_buffer_pos - 2*sizeof(unsigned int) + hdr_size;
if ((const unsigned char *)res->data < input_buffer ||
(const unsigned char *)res->data >= input_buffer + input_buffer_size)
@@ -220,7 +237,7 @@ int load_res32_file( const char *name, DLLSPEC *spec )

if ((ret = check_header()))
{
- while (input_buffer_pos < input_buffer_size) load_next_resource( spec, name );
+ while (input_buffer_pos < input_buffer_size) load_next_resource( spec );
}
return ret;
}
@@ -473,7 +490,7 @@ void output_resources( DLLSPEC *spec )
{
output( "\n\t.balign 4\n" );
output( ".L__wine_spec_res_%d:\n", i );
- output( "\t.incbin \"%s\",%d,%d\n", res->input_name, res->input_offset, res->data_size );
+ dump_res_data( res );
}

if (!is_pe())
24 changes: 0 additions & 24 deletions emulators/wine/files/patch-dlls_ntdll_unix_loader.c

This file was deleted.

0 comments on commit 4c1cbff

Please sign in to comment.