From owner-dev-commits-ports-main@freebsd.org Mon Aug 2 21:43:06 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F33DB67B12A; Mon, 2 Aug 2021 21:43:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gds1j651lz3NcR; Mon, 2 Aug 2021 21:43:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B902C26F3B; Mon, 2 Aug 2021 21:43:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172Lh59N005431; Mon, 2 Aug 2021 21:43:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172Lh5V1005430; Mon, 2 Aug 2021 21:43:05 GMT (envelope-from git) Date: Mon, 2 Aug 2021 21:43:05 GMT Message-Id: <202108022143.172Lh5V1005430@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gerald Pfeifer Subject: git: 27ae28dd240c - main - emulators/wine-devel: Invoke with LD_BIND_NOW and revampe WoW MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gerald X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27ae28dd240c63c37a2fe17d2a2440d1beda5870 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 21:43:06 -0000 The branch main has been updated by gerald: URL: https://cgit.FreeBSD.org/ports/commit/?id=27ae28dd240c63c37a2fe17d2a2440d1beda5870 commit 27ae28dd240c63c37a2fe17d2a2440d1beda5870 Author: Gerald Pfeifer AuthorDate: 2021-08-02 21:40:18 +0000 Commit: Gerald Pfeifer CommitDate: 2021-08-02 21:40:19 +0000 emulators/wine-devel: Invoke with LD_BIND_NOW and revampe WoW Forward port 1d2af6e08958ac78de9fae727283ac8cdaf8705f and its two follow-up fixes ad15b0e748b6bd93ef1e36b1c605c1da29d10565 and 1b5885c463320a2af0e7fe2ed0fdca93d760ad19 from emulators/wine: Wine 6.0 and later need LD_BIND_NOW / LD_32_BIND_NOW on FreeBSD, cf. https://bugs.winehq.org/show_bug.cgi?id=50257 and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252307 so move the actual binaries to wine64.bin / wine.bin and invoke them via a script that does those settings. [1] Also revamp the WoW handling/packging which combines 32-bit/i386 Wine into 64-bit/amd64 Wine. [1] Submitted by: Alex S [1] PR: 257284 [1], 252307 [1], 255336, 257020 --- emulators/wine-devel/Makefile | 12 +++++++++ emulators/wine-devel/files/pkg32.sh | 15 ++++++++++++ emulators/wine-devel/files/wine-wow64.sh | 42 ++++++++++++++++++++++++++++++++ emulators/wine-devel/files/wine.sh | 14 +++++++++++ emulators/wine-devel/pkg-plist | 8 ++++-- 5 files changed, 89 insertions(+), 2 deletions(-) diff --git a/emulators/wine-devel/Makefile b/emulators/wine-devel/Makefile index 184b526a4df8..f57eaef042f5 100644 --- a/emulators/wine-devel/Makefile +++ b/emulators/wine-devel/Makefile @@ -2,6 +2,7 @@ PORTNAME= wine DISTVERSION= 6.14 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= emulators MASTER_SITES= SF/${PORTNAME}/Source \ @@ -167,6 +168,17 @@ 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 + ${INSTALL_SCRIPT} ${FILESDIR}/wine.sh ${STAGEDIR}${PREFIX}/bin/wine +.else + ${MV} ${STAGEDIR}${PREFIX}/bin/wine64 ${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} diff --git a/emulators/wine-devel/files/pkg32.sh b/emulators/wine-devel/files/pkg32.sh new file mode 100644 index 000000000000..267fb8b38ca4 --- /dev/null +++ b/emulators/wine-devel/files/pkg32.sh @@ -0,0 +1,15 @@ +#!/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}" + +mkdir -p "$I386_ROOT" +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" "$@" diff --git a/emulators/wine-devel/files/wine-wow64.sh b/emulators/wine-devel/files/wine-wow64.sh new file mode 100644 index 000000000000..e24bc30e1b78 --- /dev/null +++ b/emulators/wine-devel/files/wine-wow64.sh @@ -0,0 +1,42 @@ +#!/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" + 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:$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 + +if [ -z "$WINE_NO_WOW64" ] +then + export WINESERVER="${TARGET}server" +fi + +exec "$I386_ROOT/$PREFIX/bin/wine" "$@" diff --git a/emulators/wine-devel/files/wine.sh b/emulators/wine-devel/files/wine.sh new file mode 100644 index 000000000000..96a350fce615 --- /dev/null +++ b/emulators/wine-devel/files/wine.sh @@ -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" "$@" diff --git a/emulators/wine-devel/pkg-plist b/emulators/wine-devel/pkg-plist index 70ff3a84ec28..8f604c2d265a 100644 --- a/emulators/wine-devel/pkg-plist +++ b/emulators/wine-devel/pkg-plist @@ -5,8 +5,10 @@ bin/notepad bin/regedit bin/regsvr32 bin/widl -%%WINE32%%bin/wine +bin/wine +%%WINE32%%bin/wine.bin %%WINE64%%bin/wine64 +%%WINE64%%bin/wine64.bin bin/wineboot bin/winebuild bin/winecfg @@ -20,7 +22,8 @@ bin/winegcc bin/winemaker bin/winemine bin/winepath -bin/wineserver +%%WINE32%%bin/wineserver32 +%%WINE64%%bin/wineserver bin/wmc bin/wrc include/wine/debug.h @@ -3505,6 +3508,7 @@ share/applications/wine.desktop %%DATADIR%%/nls/normnfkc.nls %%DATADIR%%/nls/normnfkd.nls %%DATADIR%%/nls/sortdefault.nls +%%WINE64%%%%DATADIR%%/pkg32.sh %%PORTDOCS%%%%DOCSDIR%%/ANNOUNCE %%PORTDOCS%%%%DOCSDIR%%/AUTHORS %%PORTDOCS%%%%DOCSDIR%%/README