Skip to content

Commit 201ad55

Browse files
tannevaledclaudejhheider
authored
new(winehq.org): headless wine for Windows-binary CI testing (#12986)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Jacob Heider <jacob@pkgx.dev>
1 parent ccfc212 commit 201ad55

1 file changed

Lines changed: 139 additions & 0 deletions

File tree

projects/winehq.org/package.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Wine: Windows API implementation for POSIX hosts.
2+
#
3+
# Headless minimal build aimed at CI use — runs cross-compiled
4+
# Windows .exe files in brewkit's Linux test sandbox so we can
5+
# validate native-Windows pantry recipes without spinning up
6+
# GitHub Windows runners. See pkgxdev/pantry#12985 for context
7+
# and pkgxdev/brewkit#346 for the broader RFC.
8+
#
9+
# What's deliberately out of this build:
10+
#
11+
# - X11 (--without-x): no GUI in CI
12+
# - OpenGL/Vulkan/OSMesa: no 3D rendering
13+
# - ALSA/PulseAudio/OSS: no audio
14+
# - SDL/GStreamer: no media
15+
# - CUPS/gphoto2/USB/V4L2/SANE/UDev: no peripherals
16+
# - 32-bit Win support (--enable-archs=x86_64): 64-bit only
17+
# - tests (--disable-tests): skip wine's own test suite (massive
18+
# build-time saving, irrelevant for our use case)
19+
#
20+
# Result: a headless wine64 binary that can launch a console-only
21+
# Windows .exe and capture its stdout/stderr. Good for CLI tool
22+
# testing; not useful for GUI apps, games, or anything graphical.
23+
24+
distributable:
25+
url: https://dl.winehq.org/wine/source/{{ version.major }}.0/wine-{{ version.raw }}.tar.xz
26+
strip-components: 1
27+
28+
# Wine's release naming:
29+
# wine-X.0 — stable (annual, lives at dl.winehq.org/.../X.0/)
30+
# wine-X.Y — dev release (lives at dl.winehq.org/.../X.x/)
31+
# wine-X.0-rcN — release candidates
32+
#
33+
# We list ONLY stable major-version directories from the dl.winehq.org
34+
# index, then semver-sort to pick the latest. URL mode is required:
35+
# brewkit's `github:` mode silently ignores `match:`, so we can't use
36+
# it to filter dev releases out of the tag list.
37+
versions:
38+
url: https://dl.winehq.org/wine/source/
39+
match: /\d{2,}\.0\//
40+
strip: /\//
41+
42+
# Pilot scope: linux/x86-64 only. Once the integration with
43+
# brewkit#346 lands, expanding to linux/aarch64 + darwin/* is
44+
# a follow-up — both have wine-side complications:
45+
# - linux/aarch64: wine can run aarch64 Windows binaries but
46+
# x86-64 Windows requires qemu-user or hangover
47+
# - darwin: Apple deprecated 32-bit; wine 11.x ships darwin
48+
# support but it's a meaningful extra config dance
49+
platforms:
50+
- linux/x86-64
51+
52+
build:
53+
dependencies:
54+
gnu.org/bison: "^3"
55+
github.com/westes/flex: "*"
56+
perl.org: "^5"
57+
gnu.org/gettext: "*"
58+
freetype.org: "*"
59+
gnutls.org: "*"
60+
zlib.net: "*"
61+
gnu.org/gcc: "*"
62+
gnu.org/binutils: "*"
63+
# Modern Wine compiles its built-in DLLs as real PE binaries, so it
64+
# needs a PE cross-compiler at build time — configure aborts with
65+
# "x86_64 PE cross-compiler not found" without one. llvm.org/mingw-w64
66+
# provides x86_64-w64-mingw32-{gcc,clang}. No build-dep cycle: the
67+
# mingw recipe uses Wine only in its *test* step, never its build.
68+
llvm.org/mingw-w64: "*"
69+
70+
script:
71+
- ./configure $ARGS || (cat config.log && false)
72+
- make --jobs {{ hw.concurrency }}
73+
- make install
74+
- run: if test ! -f wine64; then ln -s wine wine64; fi
75+
working-directory: ${{prefix}}/bin
76+
77+
env:
78+
ARGS:
79+
- --prefix={{ prefix }}
80+
# 64-bit only — half the build, all we need
81+
- --enable-archs=x86_64
82+
# skip wine's massive internal test suite
83+
- --disable-tests
84+
# build the win-side DLLs as PE with the
85+
# llvm.org/mingw-w64 cross-compiler (now a
86+
# build dep). Required: modern Wine has no
87+
# ELF-builtin fallback, so configure demands
88+
# a PE cross-compiler regardless.
89+
- --with-mingw
90+
# no X11
91+
- --without-x
92+
- --without-opengl
93+
- --without-osmesa
94+
- --without-vulkan
95+
- --without-alsa
96+
- --without-pulse
97+
- --without-oss
98+
- --without-sdl
99+
- --without-gstreamer
100+
- --without-cups
101+
- --without-gphoto
102+
- --without-capi
103+
- --without-cms
104+
- --without-udev
105+
- --without-v4l2
106+
- --without-sane
107+
- --without-usb
108+
- --without-pcap
109+
- --without-fontconfig
110+
- --without-krb5
111+
112+
test:
113+
dependencies:
114+
llvm.org/mingw-w64: "*"
115+
env:
116+
WINEDEBUG: "-all"
117+
WINEDLLOVERRIDES: "mscoree=;mshtml="
118+
WINEPREFIX: $PWD/.wine
119+
script:
120+
- wine64 --version | grep {{version.raw}}
121+
# cross-compile a console .exe and actually run it through wine
122+
- run: x86_64-w64-mingw32-clang -o hello.exe $FIXTURE
123+
fixture:
124+
extname: c
125+
content: |
126+
#include <stdio.h>
127+
int main(void) {
128+
printf("hello from wine\n");
129+
return 0;
130+
}
131+
# strip the Windows CR; wine prints "hello from wine\r\n"
132+
- test "$(wine64 hello.exe | tr -d '\r')" = "hello from wine"
133+
134+
provides:
135+
- bin/wine
136+
- bin/wine64
137+
- bin/winepath
138+
- bin/wineserver
139+
- bin/winecfg

0 commit comments

Comments
 (0)