#!/bin/bash # Build the hacked Wine 4.8 fork (uunicorn/wine, branch hacking/validiy-sensor) # with the modern-toolchain fixes from work/patches/, and install it to # work/wine-build/install/. # # Prereqs (Arch): base-devel, mingw-w64-gcc, gnutls, libusb, pkgconf, gettext, # bison, flex. (mingw-w64-gcc matters: the build cross-compiles the PE side.) # # Usage: work/wine-build.sh [/path/to/wine-validity] # default source dir: /tmp/opencode/wine-validity (cloned if missing) set -eu ROOT=/home/nebulon/projects/fingerprint SRC=${1:-/tmp/opencode/wine-validity} PREFIX=$ROOT/work/wine-build/install PATCH=$ROOT/work/patches/uunicorn-wine-modern-toolchain.patch if [ ! -d "$SRC" ]; then git clone -b hacking/validiy-sensor https://github.com/uunicorn/wine "$SRC" fi cd "$SRC" git checkout hacking/validiy-sensor # modern-toolchain fixes: gnutls 3.8 API, OpenSSL 3 const-ness, -fno-common if git apply --check "$PATCH" 2>/dev/null; then git apply "$PATCH" echo "applied $PATCH" else echo "(patch already applied or conflicts - continuing)" fi ./configure --prefix="$PREFIX" \ --enable-win64 --with-gnutls --without-x --disable-tests \ --without-freetype --without-fontconfig --without-capi --without-dbus \ --without-oss --without-alsa --without-cups --without-sane --without-v4l \ --without-pcap --without-ldap --without-xml --without-xslt --without-mscms \ --disable-wmic --disable-winedbg --disable-winhlp32 \ CFLAGS='-g -O2 -Wno-error -fcommon -Dbool=winbool_field' make -j"$(nproc)" make install echo echo "Wine installed to $PREFIX" echo "Binary: $PREFIX/bin/wine64"