From e90f60030774bde403797ffed58d97a4b220da65 Mon Sep 17 00:00:00 2001 From: Helmut Pozimski Date: Tue, 28 Apr 2020 22:00:49 +0200 Subject: [PATCH] wine: enable 64 bit build along with the restructuring of the sub-packages this will allow installing both a wine and wine-32bit package on x86_64 hosts to be able to execute both 32 bit and 64 bit Windows binaries [skip ci] --- srcpkgs/wine-common | 1 + srcpkgs/wine-tools | 1 + srcpkgs/wine/files/wine | 41 ++++++++++++++++++++++++ srcpkgs/wine/files/wineserver | 18 +++++++++++ srcpkgs/wine/template | 59 ++++++++++++++++++++++++++++++----- 5 files changed, 113 insertions(+), 7 deletions(-) create mode 120000 srcpkgs/wine-common create mode 120000 srcpkgs/wine-tools create mode 100644 srcpkgs/wine/files/wine create mode 100755 srcpkgs/wine/files/wineserver diff --git a/srcpkgs/wine-common b/srcpkgs/wine-common new file mode 120000 index 00000000000..bd42d64fa10 --- /dev/null +++ b/srcpkgs/wine-common @@ -0,0 +1 @@ +wine \ No newline at end of file diff --git a/srcpkgs/wine-tools b/srcpkgs/wine-tools new file mode 120000 index 00000000000..bd42d64fa10 --- /dev/null +++ b/srcpkgs/wine-tools @@ -0,0 +1 @@ +wine \ No newline at end of file diff --git a/srcpkgs/wine/files/wine b/srcpkgs/wine/files/wine new file mode 100644 index 00000000000..bdcbbc00e98 --- /dev/null +++ b/srcpkgs/wine/files/wine @@ -0,0 +1,41 @@ +#!/bin/sh -e +# Based on the Debian wrapper script written by Jens Reyer and Michael Gilbert +# SPDX-License-Identifier: LGPL-2.1-or-later + +wine32=/usr/libexec/wine/wine +wine64=/usr/libexec/wine/wine64 + +wine32_hint () { + echo "it looks like wine-32bit is missing, you should install it." + if uname -a | grep "x86_64" > /dev/null && xbps-query -l | grep void-repo-multilib > /dev/null; then + echo "the multilib repository needs to be enabled first. as root, please" + echo "execute \"xbps-install -S void-repo-multilib && xbps-install -S wine-32bit\"" + else + echo "as root, please execute \"xbps-install -S wine-32bit\"" + fi +} + +if test -x $wine32; then + wine=$wine32 +elif test -x $wine64; then + wine=$wine64 + if test -z "$WINELOADER"; then + export WINELOADER=$wine64 + fi + case "x$WINEDEBUG" in + x-all*|x*,-all*|x*err-all*) + ;; + *) + wine32_hint >&2 + ;; + esac +else + echo "error: unable to find wine executable. this shouldn't happen." >&2 + exit 1 +fi + +if test -z "$WINEDEBUG"; then + export WINEDEBUG=fixme-all +fi + +exec $wine "$@" diff --git a/srcpkgs/wine/files/wineserver b/srcpkgs/wine/files/wineserver new file mode 100755 index 00000000000..0d99fc3d4f0 --- /dev/null +++ b/srcpkgs/wine/files/wineserver @@ -0,0 +1,18 @@ +#!/bin/sh -e +# Based on the Debian wrapper script written by Jens Reyer and Michael Gilbert +# SPDX-License-Identifier: LGPL-2.1-or-later + +wineserver32=/usr/libexec/wine/wineserver32 +wineserver64=/usr/libexec/wine/wineserver64 + +if test -x "$wineserver64"; then + wineserver=$wineserver64 +elif test -x "$wineserver32"; then + wineserver=$wineserver32 +else + echo "error: unable to find wineserver executable." >&2 + echo "wine and/or wine-32bit must be installed." >&2 + exit 1 +fi + +exec $wineserver -p0 "$@" diff --git a/srcpkgs/wine/template b/srcpkgs/wine/template index a1e133eb281..711ca6ee71e 100644 --- a/srcpkgs/wine/template +++ b/srcpkgs/wine/template @@ -1,9 +1,9 @@ # Template file for 'wine' pkgname=wine version=5.7 -revision=1 +revision=2 build_style=gnu-configure -configure_args="--without-gstreamer" +configure_args="--without-gstreamer --bindir=/usr/libexec/wine" short_desc="Run Microsoft Windows applications" maintainer="Helmut Pozimski " license="LGPL-2.1-or-later" @@ -11,12 +11,10 @@ homepage="http://www.winehq.org/" distfiles="https://dl.winehq.org/wine/source/${version%%.*}.x/wine-${version}.tar.xz" checksum=16c99b9c6db56f75fcc2c6b3cbae400db1da1f750edba0249fd0fc288a9b4712 -nopie_files="/usr/bin/wine" - lib32mode=full -archs=i686 +archs="i686 x86_64" -hostmakedepends="pkg-config flex prelink" +hostmakedepends="pkg-config flex prelink gettext" makedepends="gettext-devel lcms2-devel zlib-devel ncurses-devel glu-devel libSM-devel libXext-devel libX11-devel libXpm-devel libXinerama-devel libXcomposite-devel libXmu-devel libXxf86vm-devel @@ -30,14 +28,35 @@ makedepends="gettext-devel lcms2-devel zlib-devel ncurses-devel depends="libXi libXinerama libXcomposite libXcursor libOSMesa desktop-file-utils hicolor-icon-theme liberation-fonts-ttf gnutls" +depends="wine-common" + +case $XBPS_TARGET_MACHINE in + x86_64*) configure_args+=" --enable-win64 --libdir=/usr/lib" + _wine_suffix="64" + _wineserver_suffix=${_wine_suffix} + ;; + *) + _wineserver_suffix="32" + ;; +esac -binfmts="/usr/bin/wine --magic MZ" +_wine_libexec="/usr/libexec/wine" +nopie_files="${_wine_libexec}/wine${_wine_suffix}" post_install() { # Font aliasing settings for Win32 applications install -d ${DESTDIR}/etc/fonts/conf.{avail,d} install -m644 ${FILESDIR}/30-win32-aliases.conf ${DESTDIR}/etc/fonts/conf.avail ln -s ../conf.avail/30-win32-aliases.conf ${DESTDIR}/etc/fonts/conf.d/30-win32-aliases.conf + mv ${DESTDIR}${_wine_libexec}/wineserver ${DESTDIR}${_wine_libexec}/wineserver${_wineserver_suffix} + vbin ${FILESDIR}/wine + vbin ${FILESDIR}/wineserver + for file in msiexec regedit regsvr32 wineboot winecfg winepath winemine winefile \ + winedbg wineconsole notepad msidb widl winebuild winecpp winedump wineg++ \ + winegcc winemaker wmc wrc function_grep.pl + do + mv ${DESTDIR}/usr/libexec/wine/${file} ${DESTDIR}/usr/bin/ + done } libwine_package() { @@ -49,6 +68,7 @@ libwine_package() { vmove usr/lib/wine } } + wine-devel_package() { depends="libwine-${version}_${revision}" short_desc+=" - development files" @@ -58,3 +78,28 @@ wine-devel_package() { vmove "usr/lib/*.so" } } + +wine-common_package() { + archs="noarch" + short_desc+=" - common files" + binfmts="/usr/bin/wine --magic MZ" + pkg_install() { + vmove usr/share + vmove etc + for file in wine wineserver msiexec regedit regsvr32 wineboot winecfg winepath winemine winefile winedbg wineconsole notepad msidb + do + vmove usr/bin/${file} + done + } +} + +wine-tools_package() { + depends="wine-${version}_${revision}" + short_desc+=" - development tools" + pkg_install() { + for file in widl winebuild winecpp winedump wineg++ winegcc winemaker wmc wrc function_grep.pl + do + vmove usr/bin/${file} + done + } +}