Skip to content
117 changes: 117 additions & 0 deletions projects/winehq.org/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Wine: Windows API implementation for POSIX hosts.
#
# Headless minimal build aimed at CI use — runs cross-compiled
# Windows .exe files in brewkit's Linux test sandbox so we can
# validate native-Windows pantry recipes without spinning up
# GitHub Windows runners. See pkgxdev/pantry#12985 for context
# and pkgxdev/brewkit#346 for the broader RFC.
#
# What's deliberately out of this build:
#
# - X11 (--without-x): no GUI in CI
# - OpenGL/Vulkan/OSMesa: no 3D rendering
# - ALSA/PulseAudio/OSS: no audio
# - SDL/GStreamer: no media
# - CUPS/gphoto2/USB/V4L2/SANE/UDev: no peripherals
# - 32-bit Win support (--enable-archs=x86_64): 64-bit only
# - tests (--disable-tests): skip wine's own test suite (massive
# build-time saving, irrelevant for our use case)
#
# Result: a headless wine64 binary that can launch a console-only
# Windows .exe and capture its stdout/stderr. Good for CLI tool
# testing; not useful for GUI apps, games, or anything graphical.

distributable:
url: https://dl.winehq.org/wine/source/{{ version.major }}.0/wine-{{ version.raw }}.tar.xz
strip-components: 1

# Wine's release naming:
# wine-X.0 — stable (annual, lives at dl.winehq.org/.../X.0/)
# wine-X.Y — dev release (lives at dl.winehq.org/.../X.x/)
# wine-X.0-rcN — release candidates
#
# We list ONLY stable major-version directories from the dl.winehq.org
# index, then semver-sort to pick the latest. URL mode is required:
# brewkit's `github:` mode silently ignores `match:`, so we can't use
# it to filter dev releases out of the tag list.
versions:
url: https://dl.winehq.org/wine/source/
match: /\d{2,}\.0\//
strip: /\//

# Pilot scope: linux/x86-64 only. Once the integration with
# brewkit#346 lands, expanding to linux/aarch64 + darwin/* is
# a follow-up — both have wine-side complications:
# - linux/aarch64: wine can run aarch64 Windows binaries but
# x86-64 Windows requires qemu-user or hangover
# - darwin: Apple deprecated 32-bit; wine 11.x ships darwin
# support but it's a meaningful extra config dance
platforms:
- linux/x86-64

build:
dependencies:
gnu.org/bison: '^3'
github.com/westes/flex: '*'
perl.org: '^5'
gnu.org/gettext: '*'
freetype.org: '*'
gnutls.org: '*'
zlib.net: '*'
gnu.org/gcc: '*'
gnu.org/binutils: '*'
# Modern Wine compiles its built-in DLLs as real PE binaries, so it
# needs a PE cross-compiler at build time — configure aborts with
# "x86_64 PE cross-compiler not found" without one. llvm.org/mingw-w64
# provides x86_64-w64-mingw32-{gcc,clang}. No build-dep cycle: the
# mingw recipe uses Wine only in its *test* step, never its build.
llvm.org/mingw-w64: '*'

script:
- ./configure $ARGS || (cat config.log && false)
- make --jobs {{ hw.concurrency }}
- make install

env:
ARGS:
- --prefix={{ prefix }}
- --enable-archs=x86_64 # 64-bit only — half the build, all we need
- --disable-tests # skip wine's massive internal test suite
- --with-mingw # build the win-side DLLs as PE with the
# llvm.org/mingw-w64 cross-compiler (now a
# build dep). Required: modern Wine has no
# ELF-builtin fallback, so configure demands
# a PE cross-compiler regardless.
- --without-x # no X11
- --without-opengl
- --without-osmesa
- --without-vulkan
- --without-alsa
- --without-pulse
- --without-oss
- --without-sdl
- --without-gstreamer
- --without-cups
- --without-gphoto
- --without-capi
- --without-cms
- --without-udev
- --without-v4l2
- --without-sane
- --without-usb
- --without-pcap
- --without-fontconfig
- --without-krb5

test:
# `wine64 --version` returns "wine-X.Y" on stable, "wine-X.Y (Staging)"
# on staging. We just check that it ran and printed a sane version.
- wine64 --version 2>&1 | tee out
- grep "wine-{{version.marketing}}" out

provides:
- bin/wine
- bin/wine64
- bin/winepath
- bin/wineserver
- bin/winecfg
Loading