328.1. wine-11.0
Runs Windows programs on Linux, 64- and 32-bit, on Wayland or X11
| Version | 11.0, release 1 |
| Shelf | emulators — Standalone emulators of computers and consoles, and compatibility layers |
| Phase | 44_apps (Applications), 108 of 422 in build order |
| Licence | LGPL-2.1-or-later |
| Homepage | https://www.winehq.org/ |
| Build time | 19.4 SBU |
| Installed size | 533.5 MiB in 3982 files |
| Recipe | ports/core/emulators/wine/kpkgbuild |
About
Wine runs Windows programs on Linux by providing the Windows API itself, not by emulating a machine. The port is a WoW64 build: one 64-bit loader runs both 64-bit and 32-bit Windows programs, and no 32-bit Linux library is needed. wine-mono and wine-gecko, Wine’s .NET runtime and HTML engine, are in depends; they install under /usr/share/wine, where Wine looks for them when it sets up a prefix.
Sources
wine-11.0.tar.xz(31.6 MiB)
sha256c07a6857933c1fc60dff5448d79f39c92481c1e9db5aa628db9d0358446e0701
upstream: https://dl.winehq.org/wine/source/11.0/wine-11.0.tar.xz
archive copy: sources-2/emulators--wine-11.0.tar.xz
Dependencies
Depends on: clang, lld, llvm, bison, flex, perl, gettext, pkgconf, alsa-lib, libpulse, cups, dbus, eudev, fontconfig, freetype2, gnutls, krb5, gstreamer, gst-plugins-base, ffmpeg, libgphoto2, libpcap, libusb, pcsc-lite, sane-backends, sdl2-compat, v4l-utils, libunwind-nongnu, mesa, libglvnd, vulkan-loader, vulkan-headers, ocl-icd, opencl-headers, wayland, wayland-protocols, libxkbcommon, libX11, libXext, libXcomposite, libXcursor, libXfixes, libXi, libXinerama, libXrandr, libXrender, libXxf86vm, xorgproto, librsvg, wine-mono, wine-gecko.
Required by: no port names it.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
--without-hwloc, line 60: hwloc (explained with the switches below)
Patches
build.sh applies these; kpkg applies nothing by itself.
rpath-origin.patch— Adds a check toconfigure.ac, and the same check generated intoconfigure, that the compiler accepts-Wl,-rpath,$ORIGIN, and when it does adds that run path toUNIXLDFLAGS, the link flags of Wine’s Unix libraries. Those libraries, under/usr/lib/wine/x86_64-unix, name each other inDT_NEEDEDby bare file name. musl’s loader matches an already-loaded library only when it was found by a search, not by the path Winedlopens it with, so without an$ORIGINrun path every one of them fails to load.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install wine'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/emulators/wine.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/emulators/wine
echo 'c07a6857933c1fc60dff5448d79f39c92481c1e9db5aa628db9d0358446e0701 wine-11.0.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/wine
SRC=$SRC_ROOT/wine-11.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf wine-11.0.tar.xz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/rpath-origin.patch"
export CROSSCFLAGS="-O2 -pipe"
./configure \
--prefix=/usr \
--libdir=/usr/lib \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-archs=x86_64,i386 \
--with-mingw=clang \
--disable-tests \
--with-wayland \
--with-x \
--with-xcomposite \
--with-xcursor \
--with-xfixes \
--with-xinerama \
--with-xinput \
--with-xinput2 \
--with-xrandr \
--with-xrender \
--with-xshape \
--with-xshm \
--with-xxf86vm \
--with-opengl \
--with-vulkan \
--with-opencl \
--with-alsa \
--with-pulse \
--with-cups \
--with-dbus \
--with-udev \
--with-usb \
--with-sdl \
--with-v4l2 \
--with-gphoto \
--with-sane \
--with-pcap \
--with-pcsclite \
--with-gnutls \
--with-krb5 \
--with-gssapi \
--with-gstreamer \
--with-ffmpeg \
--with-fontconfig \
--with-freetype \
--with-inotify \
--with-unwind \
--with-pthread \
--without-hwloc \
--without-oss \
--without-capi \
--without-coreaudio \
--without-netapi
make
make DESTDIR=$PKG install
ln -s wine "$PKG/usr/bin/wine64"
find "${PKG:?}/usr/share/man" -mindepth 1 -maxdepth 1 -name '*.UTF-8' -exec rm -rf {} +
install -d "$PKG/usr/share/icons/hicolor/128x128/apps"
rsvg-convert -w 128 -h 128 programs/winecfg/logo.svg \
-o "$PKG/usr/share/icons/hicolor/128x128/apps/wine.png"
rsvg-convert -w 128 -h 128 programs/winecfg/winecfg.svg \
-o "$PKG/usr/share/icons/hicolor/128x128/apps/wine-winecfg.png"
install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/wine.desktop" <<'EOF2'
[Desktop Entry]
Type=Application
Name=Wine Program Loader
Comment=Run a Windows program
Exec=wine start /unix %f
Icon=wine
Terminal=false
NoDisplay=true
MimeType=application/x-msdownload;application/x-msi;application/x-ms-shortcut;application/x-bat;
EOF2
cat > "$PKG/usr/share/applications/wine-winecfg.desktop" <<'EOF2'
[Desktop Entry]
Type=Application
Name=Wine Configuration
GenericName=Windows Compatibility Settings
Comment=Windows version, drives, graphics and audio for Windows programs
Exec=winecfg
Icon=wine-winecfg
Terminal=false
StartupWMClass=winecfg.exe
Categories=System;Emulator;
Keywords=wine;windows;exe;compatibility;winecfg;
EOF2
chmod 644 "$PKG"/usr/share/applications/wine*.desktop
The switches, and why each is set:
CROSSCFLAGS="-O2 -pipe"— The compile flags for the Windows (PE) half of Wine. They replace upstream’s default,-g -O2, so the DLLs carry no debug information.--enable-archs=x86_64,i386— Build the PE side for both architectures in one tree, which is the WoW64 layout: the Unix side is 64-bit only, and the i386 DLLs run under it.--with-mingw=clang— Compile the PE side with clang in its MSVC-compatible mode, linked by lld. Wine carries its own C runtime, so no MinGW toolchain or headers are involved; without the value configure searches for a*-w64-mingw32-gccfirst.--disable-tests— Do not build the regression tests.--with-wayland— This switch and every--with-after it are libraries Wine uses whenever it finds them; naming one turns a missing library into a configure error (This is an error since --with-… was requested) instead of a notice. Between them they are both display drivers (--with-waylandand--with-xwith its X extensions), OpenGL, Vulkan and OpenCL, ALSA and PulseAudio sound, CUPS printing, D-Bus and udev device hot-plugging, libusb, SDL game controllers, V4L2 cameras, gPhoto digital cameras, SANE scanners, libpcap, PC/SC smart cards, GnuTLS for Schannel, Kerberos and GSSAPI, GStreamer and FFmpeg codecs, fontconfig and FreeType, inotify, libunwind and pthreads.--without-hwloc— Do not use hwloc for the CPU and cache topology; upstream’s help text says that path is FreeBSD’s. On Linux Wine reads the topology from sysfs.--without-oss— No OSS sound driver. OSS is not on this system.--without-capi— No CAPI, the ISDN interface.--without-coreaudio— No CoreAudio driver, which is macOS’s.--without-netapi— Do not use Samba’s NetAPI library.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/wine, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf wine-11.0-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/wine, and runs the triggers its paths call for.
Contents
Installed programs: function_grep.pl, msidb, msiexec, notepad, regedit, regsvr32, widl, wine, wine64, wineboot, winebuild, winecfg, wineconsole, winecpp, winedbg, winedump, winefile, wineg++, winegcc, winemaker, winemine, winepath, wineserver, wmc, wrc.
Installed directories: /usr/include/wine, /usr/lib/wine, /usr/share/licenses/wine, /usr/share/wine/fonts, /usr/share/wine/nls, /usr/share/wine/winmd.
Short descriptions
msiexec |
Wine MSI Installer |
notepad |
Wine text editor |
regedit |
Wine registry editor |
regsvr32 |
Wine DLL Registration Server |
widl |
Wine Interface Definition Language (IDL) compiler |
wine |
run Windows programs on Unix |
wineboot |
perform Wine initialization, startup, and shutdown tasks |
winebuild |
Wine dll builder |
winecfg |
Wine Configuration Editor |
wineconsole |
Wine console manager |
winedbg |
Wine debugger |
winedump |
Wine DLL tool |
winefile |
Wine File Manager |
winegcc |
Wine C and C++ MinGW Compatible Compiler |
winemaker |
generate a build infrastructure for compiling Windows programs on Unix |
winemine |
Wine Minesweeper game |
winepath |
convert Unix paths to/from Win32 paths |
wineserver |
the Wine server |
wmc |
Wine Message Compiler |
wrc |
Wine Resource Compiler |
Notes
Both display drivers are built. Wine tries x11 before wayland and the session always sets DISPLAY, so winex11 under Xwayland is the default, and a Vulkan surface there needs the vulkan-loader’s xcb and xlib platforms. winewayland is chosen per prefix with Graphics=wayland under HKCU\Software\Wine\Drivers, or for one run by starting wine with DISPLAY unset.
build.sh links wine64 to wine, for scripts that call wine64; in WoW64 the one loader is both. Only the English manual pages are kept: the *.UTF-8 directories under /usr/share/man are removed.
The program loader’s entry has NoDisplay=true and only opens a Windows program from the file manager. winecfg is the one menu row: a prefix is made on first use, and every other Windows program is reached through the file it opens or wine <program>. Its window class is its executable name, winecfg.exe.