Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

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

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.

Patches

build.sh applies these; kpkg applies nothing by itself.

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:

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.