1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00

emulators/wine7: New port, cloning emulators/wine

Wine 8 has been released late last year and we have not seen
corresponding updates to wine-devel and the main wine port yet,
partly because there's unresolved breakage on FreeBSD/i386.

To unstall the situation, create emulators/wine7 as a clone of
emulators/wine for those who want/need that version. This will
allow moving the latter forward.

PR:		272710, 271201
Suggested by:	lwhsu
This commit is contained in:
Gerald Pfeifer 2023-07-30 21:57:39 +00:00
parent a30c967536
commit aa30cdd581
9 changed files with 3902 additions and 0 deletions

View File

@ -166,6 +166,7 @@
SUBDIR += vt100
SUBDIR += vxtools
SUBDIR += wine
SUBDIR += wine7
SUBDIR += wine-devel
SUBDIR += wine-gecko
SUBDIR += wine-gecko-devel

162
emulators/wine7/Makefile Normal file
View File

@ -0,0 +1,162 @@
PORTNAME= wine
DISTVERSION= 7.0.2
CATEGORIES= emulators
MASTER_SITES= https://dl.winehq.org/wine/source/7.0/
PKGNAMESUFFIX= 7
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
USES= bison cpe desktop-file-utils gmake localbase \
pkgconfig sdl shebangfix tar:xz
USE_GCC= yes
USE_SDL= sdl2
CPE_VENDOR= winehq
CONFLICTS_INSTALL= wine-devel
GNU_CONFIGURE= yes
CONFIGURE_ARGS+=--verbose \
--disable-kerberos \
--disable-tests \
--without-capi \
--without-coreaudio \
--without-dbus \
--without-gettext --without-gettextpo \
--without-gphoto \
--without-gssapi \
--without-gstreamer \
--without-inotify \
--without-krb5 \
--without-mingw \
--without-netapi \
--without-opencl \
--without-osmesa \
--with-pcap \
--with-pthread \
--without-pulse \
--without-sane \
--with-sdl \
--without-udev \
--without-unwind \
--without-usb
CONFIGURE_ENV= CPPBIN="${CPP}" FLEX="${LOCALBASE}/bin/flex"
WINELIBDIR= ${PREFIX}/lib
.if !defined(USE_LDCONFIG32)
USE_LDCONFIG= ${WINELIBDIR} ${WINELIBDIR}/wine
.endif
SHEBANG_FILES= tools/make_requests tools/winemaker/winemaker \
tools/winedump/function_grep.pl
SUB_FILES= pkg-message
PORTDATA= wine.inf
OPTIONS_DEFINE= CUPS DOCS DOSBOX GNUTLS LDAP OPENAL V4L WINEMAKER X11 GECKO MONO
OPTIONS_DEFAULT=GNUTLS OPENAL OSS X11
OPTIONS_RADIO= AUDIO
OPTIONS_RADIO_AUDIO= ALSA OSS
OPTIONS_SUB= yes
DOSBOX_DESC= Use DOSBox to run MS-DOS programs
WINEMAKER_DESC= Fully support winemaker (requires Perl)
GECKO_DESC= Bundle Gecko MSI package for Wine
MONO_DESC= Bundle Mono MSI package for Wine
PORTSCOUT= limit:^7\.0
ALSA_CONFIGURE_ON= --with-alsa --without-oss
ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib
CUPS_CONFIGURE_WITH= cups
CUPS_LIB_DEPENDS= libcups.so:print/cups
DOSBOX_RUN_DEPENDS= dosbox:emulators/dosbox
GECKO_RUN_DEPENDS= wine-gecko>0:emulators/wine-gecko
GNUTLS_CONFIGURE_WITH= gnutls
GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
LDAP_CONFIGURE_WITH= ldap
LDAP_USES= ldap
MONO_RUN_DEPENDS= wine-mono>0:emulators/wine-mono
OPENAL_CONFIGURE_WITH= openal
OPENAL_USES= openal
OSS_CONFIGURE_ON= --without-alsa --with-oss
V4L_CONFIGURE_WITH= v4l2
V4L_BUILD_DEPENDS= ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat
V4L_LIB_DEPENDS= libv4l2.so:multimedia/libv4l
WINEMAKER_RUN_DEPENDS= p5-XML-LibXML>0:textproc/p5-XML-LibXML
X11_CONFIGURE_WITH= x fontconfig freetype opengl vkd3d xinerama xinput2 xrandr xrender
X11_USES= gl xorg
X11_USE= GL=glu XORG=x11,xext,xcomposite,xcursor,xi,xinerama,xrandr,xrender
X11_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2 \
libvulkan.so:graphics/vulkan-loader \
libvkd3d.so:graphics/vkd3d
.include <bsd.port.pre.mk>
.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
PLIST_SUB+= WINE32="" WINE64="@comment " WINEARCH="i386"
.endif
pre-build:
cd ${WRKSRC} && ${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/wine64 ${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 README ANNOUNCE AUTHORS
${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 <bsd.port.post.mk>

3
emulators/wine7/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1679956898
SHA256 (wine-7.0.2.tar.xz) = e874b4a9c036f2f66b2f2c79012c7f1236afffe840aa0e7c002e7725e75961b9
SIZE (wine-7.0.2.tar.xz) = 27179980

View File

@ -0,0 +1,13 @@
[
{ type: install
message: <<EOM
Some ZFS tuning guides recommend setting KVA_PAGES=512 in your kernel
configuration. This is incompatible with Wine. The maximum possible
is KVA_PAGES=500, which should still be enough for ZFS.
The port also installs some of Wine's documentation which describes
additional programs that are not in the manual pages under
%%PREFIX%%/share/doc/wine
EOM
}
]

View File

@ -0,0 +1,20 @@
#!/bin/sh -e
if [ "$(id -u)" = 0 ]
then
echo "Don't run this script as root!"
exit 1
fi
I386_ROOT="${WINE_i386_ROOT:-$HOME/.i386-wine-pkg}"
if [ ! -d "$I386_ROOT/usr/share/keys/pkg" ]
then
mkdir -p "$I386_ROOT/usr/share/keys"
ln -s /usr/share/keys/pkg "$I386_ROOT/usr/share/keys/pkg"
fi
ABI=$(pkg config ABI | sed s/amd64/i386/)
# Show what we're going to do, then do it.
echo pkg -o ABI="$ABI" -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@"
exec pkg -o ABI="$ABI" -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@"

View File

@ -0,0 +1,58 @@
#!/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
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
$LD_32_LIBMAP_CONF
$LD_32_LIBMAP"
if [ -z "$WINE_NO_WOW64" ]
then
export WINESERVER="${TARGET}server"
fi
exec "$I386_ROOT/$PREFIX/bin/wine" "$@"

View File

@ -0,0 +1,14 @@
#!/bin/sh
TARGET="$(realpath "$0")"
if [ -z "$WINESERVER" ] && [ -f "${TARGET}server32" ]
then
export WINESERVER="${TARGET}server32"
fi
# Workaround for https://bugs.winehq.org/show_bug.cgi?id=50257
export LD_BIND_NOW=1
export LD_32_BIND_NOW=1
exec "${TARGET}.bin" "$@"

15
emulators/wine7/pkg-descr Normal file
View File

@ -0,0 +1,15 @@
Wine is a Microsoft Windows compatibility layer (or program loader)
capable of running Windows applications on i386 and compatible CPUs.
Windows programs running in Wine act as native programs would, running
without the performance or memory usage penalties of an emulator, with
a similar look and feel to other applications on your desktop.
Many applications already work, more or less, including versions of
Microsoft Office and many games.
If you receive a message of "Did you reconfigure your kernel with
"options USER_LDT"?" add the line
machdep.max_ldt_segment="2048"
to /boot/loader.conf and reboot.
Gerald Pfeifer <gerald@FreeBSD.org>

3616
emulators/wine7/pkg-plist Normal file

File diff suppressed because it is too large Load Diff