Skip to content
Witold Baryluk edited this page Jul 23, 2020 · 14 revisions

To build from source, clone the repository and follow the official instructions for wine:

https://wiki.winehq.org/Building_Wine#Shared_WoW64

Make certain that you have both 32-bit and 64-bit MinGW toolchains installed before trying to build.

This page will be expanded with more detailed instructions in the future.

Patches

It might be useful to apply patches to the tree to improve things. Useful pages are documented below.

Improved EAC performance

The following patches are known to improve EAC performance:

https://github.com/openglfreak/wine/commit/d4c4cb4705ecd71a4265a750fcc57dfe81370e99

https://dpaste.com/6VK5FTWCX

Debian / Ubuntu / Mint instructions

The instructions assume using Debian testing or unstable. It might work on Ubuntu, but probably will not (libfreetype-dev:i386 will not install properly, this got fixed in libbrotli-dev 1.0.7-7). These instructions will probably work on other Debian-based distros, like Mint, Pop!_OS, Devuan, Siduction or Trisquel.

First of all, the build instruction below can be sometimes finicky, as sometimes Debian packages do fail to install properly. The official Debian packages for wine are build in a different manner, but it is not easy or quick to setup.

First make sure you have deb-src (like deb-src http://deb.debian.org/debian/ testing main non-free contrib, see https://wiki.debian.org/SourcesList for more details) enabled in your apt sources, and multi-arch for i386 enabled (dpkg --add-architecture i386 && apt update).

# This will install most of the compilers, and all build dependencies (headers and libraries) for 64-bit wine.
sudo apt build-dep wine
# We need some extras for 32-bit.
sudo apt install build-essential mingw-w64 binutils-i686-linux-gnu
sudo apt install gcc-multilib
sudo apt install libx11-dev:i386 libgtk-3-dev:i386 libfreetype-dev:i386 libglu1-mesa-dev:i386 libosmesa6-dev:i386 opencl-c-headers libgnutls28-dev:i386 libncurses-dev:i386 libv4l-dev:i386 libpulse-dev:i386 libudev-dev:i386 libsdl2-dev:i386 libfaudio-dev:i386 libtiff-dev:i386 libjpeg-dev:i386 libpng-dev:i386 libmpg123-dev:i386 libvulkan-dev:i386 libvkd3d-dev:i386 libgcrypt20-dev:i386 libxml2-dev:i386 libxslt1-dev:i386 libgst-dev:i386 ocl-icd-opencl-dev:i386 liblcms2-dev:i386 libgstreamer1.0-dev:i386 libgstreamer-plugins-base1.0-dev:i386
sudo apt install libva-dev libva-dev:i386 

$ git clone --single-branch --branch easy-anti-cheat --depth 1000 https://github.com/Guy1524/wine.git ~/wine-guy1524-eac
$ mkdir -p ~/wine-dirs/wine64-build && cd ~/wine-dirs/wine64-build
$ ../../wine-guy1524-eac/configure --enable-win64 --disable-tests CFLAGS="-march=native -O2 -ftree-vectorize" CXXFLAGS="-march=native -O2 -ftree-vectorize" --without-openal
$ make -j$(nproc)
$ mkdir -p ~/wine-dirs/wine32-build && cd ~/wine-dirs/wine32-build
$ PKG_CONFIG=/usr/bin/i686-linux-gnu-pkg-config ../../wine-guy1524-eac/configure --with-wine64=../wine64-build --disable-tests CFLAGS="-march=native -O2 -fstack-check=no -ftree-vectorize" CXXFLAGS="-march=native -O2 -fstack-check=no -ftree-vectorize" --without-openal --without-sane --without-ldap --without-krb5 --without-gsm --without-gphoto --without-capi --without-oss --without-cups --without-hal --without-pcap
$ make -j$(nproc)

You can ignore few missing (optional) libraries (like oss, hal, capi, sane, pcap, cups, ldap, etc) reported by wine32 configure. These are not really needed.

It should be possible now to use the built wine directly from these build directories. (Wine is relocalable). If it doesn't work, try using WINE= environment variable, to point all binaries and libraries to the build directory. And if needed update PATH environment variable.

If you want to install it to default prefix (/usr/local, which can be changed by --prefix to configure), just run make install as root in both build directories. Or you can install it to a custom directory like this (order is important):

$ cd ~/wine-dirs/wine32-build && make install DESTDIR="${HOME}/wine-eac"
$ cd ~/wine-dirs/wine64-build && make install DESTDIR="${HOME}/wine-eac"

It might be possible to build wine32 using gcc-i686-linux-gnu g++-i686-linux-gnu using cross-compiling instead of gcc-multilib, but from my experience there will be linker issues, and wine configure doesn't provide means to use custom LD (like CC=i686-linux-gnu-gcc CXX=i686-linux-gnu-g++ LD=i686-linux-gnu-ld) at the moment.

If you intend to build tar ball to be distributed to other people, change -march=native to -march=haswell -mtune=generic for example.

Clone this wiki locally