diff --git a/emulators/wine/Makefile b/emulators/wine/Makefile index ff82696fbac7..9a06507e3b38 100644 --- a/emulators/wine/Makefile +++ b/emulators/wine/Makefile @@ -1,181 +1,182 @@ PORTNAME= wine DISTVERSION= 11.0 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= emulators MASTER_SITES= https://dl.winehq.org/wine/source/11.0/ MAINTAINER= gerald@FreeBSD.org COMMENT= Microsoft Windows compatibility environment WWW= https://www.winehq.org LICENSE= LGPL21 LGPL3 LICENSE_COMB= dual LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= amd64 i386 BUILD_DEPENDS= ${LOCALBASE}/bin/flex:textproc/flex LIB_DEPENDS= libhwloc.so:devel/hwloc2 # Only devel/llvm17 and later come with necessary include files - PR274542 USES= bison cpe desktop-file-utils gmake \ llvm:min=17,build,noexport localbase \ pkgconfig sdl shebangfix tar:xz CPE_VENDOR= winehq USE_GCC= yes USE_LDCONFIG= ${PREFIX}/lib ${PREFIX}/lib/wine USE_SDL= sdl2 SHEBANG_FILES= tools/make_requests tools/winemaker/winemaker \ tools/winedump/function_grep.pl GNU_CONFIGURE= yes CONFIGURE_ARGS= --verbose \ --disable-kerberos \ --disable-tests \ --without-capi \ --without-coreaudio \ --without-dbus \ --without-gettext --without-gettextpo \ --without-gphoto \ --without-gssapi \ --with-hwloc \ --without-inotify \ --without-krb5 \ --with-mingw CROSSCC="clang" \ --without-netapi \ --without-opencl \ --without-pcap \ --without-pcsclite \ --with-pthread \ --without-pulse \ --without-sane \ --with-sdl \ --without-udev \ --without-unwind \ --without-usb CONFIGURE_ENV= CPPBIN="${CPP}" FLEX="${LOCALBASE}/bin/flex" PIE_UNSAFE= yes CONFLICTS_INSTALL= wine-devel BINARY_ALIAS= clang=${LOCALBASE}/bin/clang${LLVM_VERSION} \ lld-link=${LOCALBASE}/bin/lld-link${LLVM_VERSION} PORTSCOUT= limit:^11\.0 SUB_FILES= pkg-message PORTDATA= wine.inf # GECKO and MONO are intentionally kept at the end; they just pull in # run-time dependencies on wine-gecko and wine-mono. OPTIONS_DEFINE= CUPS DOCS DOSBOX FFMPEG GNUTLS V4L WAYLAND X11 GECKO MONO OPTIONS_DEFAULT= ALSA GNUTLS WAYLAND X11 OPTIONS_RADIO= AUDIO OPTIONS_RADIO_AUDIO= ALSA OSS OPTIONS_SUB= yes DOSBOX_DESC= Use DOSBox to run MS-DOS programs GECKO_DESC= Bundle Gecko MSI package for Wine MONO_DESC= Bundle Mono MSI package for Wine WAYLAND_DESC= Wayland Support ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_RUN_DEPENDS= alsa-plugins>0:audio/alsa-plugins ALSA_USES= gnome gstreamer ALSA_USE= GNOME=glib20 ALSA_CONFIGURE_WITH= alsa CUPS_LIB_DEPENDS= libcups.so:print/cups CUPS_CONFIGURE_WITH= cups DOSBOX_RUN_DEPENDS= dosbox:emulators/dosbox FFMPEG_LIB_DEPENDS= libavutil.so:multimedia/ffmpeg FFMPEG_CONFIGURE_WITH= ffmpeg GECKO_RUN_DEPENDS= wine-gecko>0:emulators/wine-gecko GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls GNUTLS_CONFIGURE_WITH= gnutls MONO_RUN_DEPENDS= wine-mono>0:emulators/wine-mono OSS_USES= gnome gstreamer OSS_USE= GNOME=glib20 OSS_CONFIGURE_WITH= oss V4L_BUILD_DEPENDS= ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat V4L_LIB_DEPENDS= libv4l2.so:multimedia/libv4l V4L_CONFIGURE_WITH= v4l2 WAYLAND_BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland \ libxkbcommon.so:x11/libxkbcommon WAYLAND_CONFIGURE_WITH= wayland X11_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ libvulkan.so:graphics/vulkan-loader X11_USES= gl xorg X11_USE= GL=glu XORG=x11,xcomposite,xcursor,xext,xi,xinerama,xrandr,xrender X11_CONFIGURE_WITH= fontconfig freetype opengl x xinerama xinput2 xrandr xrender .include .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 ${ARCH} == amd64 # Wine is composed of three parts: # - wine (aka this port on FreeBSD/i386) is the 32-bit component # and runs 32-bit programs. # - wine64 (aka this part of this port on FreeBSD/amd64) is the # 64-bit component and runs 64-bit programs. # - wow64 (aka this port built on FreeBSD/i386) is a part of the # 64-bit component [wine64] that runs 32-bit programs on FreeBSD/amd64. # --libdir is required since Wine defaults to "${PREFIX}/lib64" on amd64. CONFIGURE_ARGS+= --enable-win64 --libdir=${PREFIX}/lib PLIST_SUB+= WINE32="@comment " WINE64="" WINEARCH="x86_64" # Wine assumes a WoW64 package is available, which is not the case on # FreeBSD yet. post-patch: ${REINPLACE_CMD} '/Exec/s|wine|wine64|g' ${WRKSRC}/loader/wine.desktop .else EXTRA_PATCHES= ${PATCHDIR}/extra-patch-tools-winebuild-res32 PLIST_SUB+= WINE32="" WINE64="@comment " WINEARCH="i386" .endif pre-build: cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_CMD} depend post-install: .if ${ARCH} == i386 ${MV} ${STAGEDIR}${PREFIX}/bin/wineserver ${STAGEDIR}${PREFIX}/bin/wineserver32 ${MV} ${STAGEDIR}${PREFIX}/bin/wine ${STAGEDIR}${PREFIX}/bin/wine.bin -${ELFCTL} -e +noaslr ${STAGEDIR}${PREFIX}/bin/wine.bin ${INSTALL_SCRIPT} ${FILESDIR}/wine.sh ${STAGEDIR}${PREFIX}/bin/wine .else ${MV} ${STAGEDIR}${PREFIX}/bin/wine ${STAGEDIR}${PREFIX}/bin/wine64.bin -${ELFCTL} -e +noaslr ${STAGEDIR}${PREFIX}/bin/wine64.bin ${INSTALL_SCRIPT} ${FILESDIR}/wine.sh ${STAGEDIR}${PREFIX}/bin/wine64 ${INSTALL_SCRIPT} ${FILESDIR}/wine-wow64.sh ${STAGEDIR}${PREFIX}/bin/wine ${INSTALL_SCRIPT} ${FILESDIR}/pkg32.sh ${STAGEDIR}${DATADIR}/pkg32.sh .endif @${MKDIR} ${STAGEDIR}${DOCSDIR} .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 ${INSTALL_DATA} ${WRKSRC}/tools/winedump/README ${STAGEDIR}${DOCSDIR}/README.winedump .include diff --git a/emulators/wine/files/wine-wow64.sh b/emulators/wine/files/wine-wow64.sh index ac44113990c6..9d3b99d8c6b2 100644 --- a/emulators/wine/files/wine-wow64.sh +++ b/emulators/wine/files/wine-wow64.sh @@ -1,59 +1,62 @@ #!/bin/sh -e TARGET="$(realpath "$0")" PREFIX="${TARGET%/*/*}" LOCALBASE="${PREFIX}" I386_ROOT="${WINE_i386_ROOT:-$HOME/.i386-wine-pkg}" if [ ! -f "$I386_ROOT/$PREFIX/bin/wine" ] then printf "%s doesn't exist!\n\n" "$I386_ROOT/$PREFIX/bin/wine" printf "Try installing 32-bit Wine with\n\t%s\n" "$PREFIX/share/wine/pkg32.sh install wine mesa-dri" ABI=$(pkg config ABI | sed s/amd64/i386/) FREEBSD_VERSION_MAJOR=`uname -r | sed "s/\..*//"` cat <<- HERE If using Poudriere, please make sure your repo is setup to use ${ABI} and create symlinks for FreeBSD:$FREEBSD_VERSION_MAJOR:amd64 and FreeBSD:$FREEBSD_VERSION_MAJOR:i386 to the relevant output directories. See pkg.conf(5) for more info. HERE exit 1 fi +# Export early so that external 32-bit libs are found. +export LD_32_LIBRARY_PATH="${LD_32_LIBRARY_PATH:+$LD_32_LIBRARY_PATH:}$I386_ROOT/$LOCALBASE/lib" + WINE32_VERSION=$(env -u WINELOADERNOEXEC "$I386_ROOT/$PREFIX/bin/wine" --version) WINE64_VERSION=$(env -u WINELOADERNOEXEC "${TARGET}64" --version) if [ "$WINE32_VERSION" != "$WINE64_VERSION" ] then printf "wine [%s] and wine64 [%s] versions do not match!\n\n" "$WINE32_VERSION" "$WINE64_VERSION" printf "Try updating 32-bit wine with\n\t%s\n" "$PREFIX/share/wine/pkg32.sh upgrade" exit 1 fi export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH:+$LIBGL_DRIVERS_PATH:}$LOCALBASE/lib/dri-devel:$LOCALBASE/lib32/dri-devel:$I386_ROOT/$LOCALBASE/lib/dri-devel:$LOCALBASE/lib/dri:$LOCALBASE/lib32/dri:$I386_ROOT/$LOCALBASE/lib/dri" export LD_32_LIBRARY_PATH="${LD_32_LIBRARY_PATH:+$LD_32_LIBRARY_PATH:}$I386_ROOT/$PREFIX/lib/wine:$LOCALBASE/lib32:$I386_ROOT/$LOCALBASE/lib" for d in "$I386_ROOT/$LOCALBASE"/llvm*/lib do if [ -d "$d" ] then export LD_32_LIBRARY_PATH="$LD_32_LIBRARY_PATH:$d" fi done export LD_32_LIBRARY_PATH_RPATH=y LD_32_LIBMAP_CONF=$(sed "s,$LOCALBASE,$I386_ROOT&,2" "$I386_ROOT/$LOCALBASE"/etc/libmap.d/*.conf 2>/dev/null || true) export LD_32_LIBMAP=" libgcc_s.so.1 /usr/lib32/libgcc_s.so.1 $LOCALBASE/lib/libvulkan_intel.so $I386_ROOT/$LOCALBASE/lib/libvulkan_intel.so $LOCALBASE/lib/libvulkan_radeon.so $I386_ROOT/$LOCALBASE/lib/libvulkan_radeon.so $LOCALBASE/lib/alsa-lib/libasound_module_pcm_oss.so $I386_ROOT/$LOCALBASE/lib/alsa-lib/libasound_module_pcm_oss.so $LD_32_LIBMAP_CONF $LD_32_LIBMAP" if [ -z "$WINE_NO_WOW64" ] then export WINESERVER="${TARGET}server" fi exec "$I386_ROOT/$PREFIX/bin/wine" "$@"