As of 2018-10-06, Wine 3.17 was released one week ago. It's time to build it from sources including

  • Patches from Wine-Staging
  • Patches from PBA
  • Patches from Gallium-Nine
  • Patches from wine-gaming-nine

1. Download sources + patches. Apply patches

_major_version=3
_minor_version=17
_version="${_major_version}.${_minor_version}"

_srcdir=/opt/Builds/Wine-Staging-${_version}_PBA_Gallium-Nine

_error() { echo "Met some issue. Will stop now!"; exit 1; }

[ ! -d ${_srcdir} ] && { mkdir -pv ${_srcdir}; } || { rm -rf ${_srcdir}/*; }

cd ${_srcdir}

echo "Current directory is ${PWD}";

echo "** Sources and patches **";

echo "- Downloading Gallium-Nine Patches...";
( wget -q https://github.com/sarnex/wine-d3d9-patches/archive/wine-d3d9-${_version}.tar.gz -O - | tar xzf - ) || { _error; }

echo "- Downloading Wine-Staging + PBA Patches...";
( wget -q https://github.com/Firerat/wine-staging/archive/wine-staging-pba-v${_version}.tar.gz -O - | tar xzf - ) || { _error; }

echo "- Downloading Wine sources..."
( wget -q https://dl.winehq.org/wine/source/3.x/wine-${_version}.tar.xz -O - | tar xJf -) || { _error; }

echo "- Cloning wine-gaming-nine repository"
git clone https://aur.archlinux.org/wine-gaming-nine.git || { _error; }

echo "** Patching Wine**";

echo "- Applying patches from Wine-Gaming-Nine (Log = wine-gaming-nine.log )";
for file in $(ls wine-gaming-nine/*patch|grep -v keybinding);do patch -d wine-${_version} -Np1 -i ../$file >> wine-gaming-nine.log 2>&1 || { _error; } ;done 
patch -d wine-${_version} -R -Np1 -i ../wine-gaming-nine/keybindings.patch >> wine-gaming-nine.log 2>&1 || { _error; }

echo "- Applying patches for Wine-Staging and PBA ( Log = wine-staging-pba.log )";
./wine-staging-wine-staging-pba-v${_version}/patches/patchinstall.sh DESTDIR="${_srcdir}/wine-${_version}" --all >> wine-staging-pba.log 2>&1 || { _error; }

echo "- Applying Gallium-Nine patches ( Log = gallium-nine.log )"
patch -d wine-${_version} -Np1 -i ../wine-d3d9-patches-wine-d3d9-${_version}/wine-d3d9.patch >> gallium-nine.log 2>&1 || { _error; }
patch -d wine-${_version} -Np1 -i ../wine-d3d9-patches-wine-d3d9-${_version}/staging-helper.patch >> gallium-nine.log 2>&1 || { _error; }

2. Build wine 3.17

cd wine-${_version}
autoreconf -fiv

./configure --prefix=/opt/wine/apps/mpv/ --with-alsa --with-capi --with-cms --with-coreaudio --with-cups --with-curses \
 --with-d3d9-nine --with-d3d9-nine-module=auto --with-d3d9-nine-headers-path=auto --with-dbus --with-ffmpeg \
 --with-float-abi=abi --with-fontconfig --with-freetype --with-gettext --with-gettextpo --with-glu --with-gnutls \
 --with-gphoto --with-gsm --with-gssapi --with-gstreamer --with-gtk3 --with-jpeg --with-krb5 --with-ldap --with-mpg123 \
 --with-netapi --with-openal --with-opencl --with-opengl --with-osmesa --with-oss --without-hal --with-pcap --with-png \
 --with-pthread --with-pulse --with-sane --with-sdl --with-tiff --with-udev --with-v4l --with-va --without-vkd3d --with-vulkan \
 --with-x --with-xattr --with-xcomposite --with-xcursor --with-xfixes --with-xinerama --with-xinput --with-xinput2 --with-xml \
 --with-xrandr --with-xrender --with-xshape --with-xshm --with-xslt --with-xxf86vm --with-zlib

make -j$(nproc) && make install