wine-build.sh 1.6 KB

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