Skip to content

Fixes

Fixes #11

Workflow file for this run

name: Build Wine
on:
push:
branches:
- '7.7'
workflow_dispatch:
jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Install Homebrew Packages
run: |
REQUIRED_PACKAGES=(
# Build Dependencies
"bison"
"pkg-config"
"mingw-w64"
"gcenx/wine/cx-llvm"
# Utilities (DXVK)
"jq"
# Dependencies
"freetype"
"gettext"
"gnutls"
"gstreamer"
"sdl2"
"molten-vk"
"winetricks"
)
brew install "${REQUIRED_PACKAGES[@]}"
- name: Add bison & cx-llvm to $PATH
run: |
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix cx-llvm)/bin" >> $GITHUB_PATH
- name: Build Environment Varrables
run: |
HOMEBREW_PATH=$(brew --prefix)
PACKAGES=(
"freetype"
"gettext"
"gnutls"
"gstreamer"
"sdl2"
"molten-vk"
)
LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS"
# Create environment
for PACKAGE in ${PACKAGES[@]}; do
LDFLAGS="-L$HOMEBREW_PATH/opt/$PACKAGE/lib $LDFLAGS"
CFLAGS="-I$HOMEBREW_PATH/opt/$PACKAGE/include $CPPFLAGS"
done
# Additional flags
LDFLAGS="-Wl,-rpath,$HOMEBREW_PATH/lib $LDFLAGS"
LDFLAGS="-Wl,-rpath,@executable_path/../lib/external $LDFLAGS"
CFLAGS="-O3 -Wno-deprecated-declarations -Wno-incompatible-pointer-types $CFLAGS"
# Return the environment
echo "LDFLAGS="$LDFLAGS" >> $GITHUB_ENV
echo "CPPFLAGS="$CPPFLAGS" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV
- name: Create the Build Directory
run: |
BUILD_DIR="$GITHUB_WORKSPACE/build"
WINE_FINAL_DIR="$BUILD_DIR/wine"
WINE64_BUILD_DIR="$BUILD_DIR/wine64"
DXVK_BUILD_DIR="$BUILD_DIR/dxvk"
WINETRICKS_DATA_DIR="$BUILD_DIR/winetricks"
FINAL_DIR="$BUILD_DIR/Libraries"
OUTPUT_DIR="$BUILD_DIR/Output"
mkdir -p $WINE_FINAL_DIR
mkdir -p $WINE64_BUILD_DIR
mkdir -p $DXVK_BUILD_DIR
mkdir -p $WINETRICKS_DATA_DIR
mkdir -p $FINAL_DIR
echo "BUILD_DIR="$BUILD_DIR" >> $GITHUB_ENV
echo "WINE_FINAL_DIR="$WINE_FINAL_DIR" >> $GITHUB_ENV
echo "WINE64_BUILD_DIR="$WINE64_BUILD_DIR" >> $GITHUB_ENV
echo "DXVK_BUILD_DIR="$DXVK_BUILD_DIR" >> $GITHUB_ENV
echo "FINAL_DIR="$FINAL_DIR" >> $GITHUB_ENV
- name: Set Variables
run: |
WINE_CONFIGURE_FLAGS=(
"--disable-option-checking"
"--disable-tests"
"--enable-win64"
"--prefix=$WINE_FINAL_DIR"
"--without-alsa"
"--without-capi"
"--with-coreaudio" # Required Package: NONE - Built-in
"--with-cups" # Required Package: NONE - Built-in
"--without-dbus"
"--without-fontconfig"
"--with-freetype" # Required Package: freetype - Homebrew
"--with-gettext" # Required Package: gettext - Homebrew
"--without-gettextpo"
"--without-gphoto"
"--with-gnutls" # Required Package: gnutls - Homebrew
"--without-gssapi"
"--with-gstreamer" # Required Package: gstreamer - Homebrew
"--without-krb5"
"--with-mingw" # Required Package: mingw-w64 - Homebrew
"--without-netapi"
"--with-opencl" # Required Package: none - Built-in
"--with-opengl" # Required Package: none - Built-in
"--without-oss"
"--with-pcap" # Required Package: none - Built-in
"--with-pthread" # Required Package: none - Built-in
"--without-pulse"
"--without-sane"
"--with-sdl" # Required Package: sdl2 - Homebrew
"--without-udev"
"--with-unwind" # Required Package: None - Built-in
"--without-usb"
"--without-v4l2"
"--with-vulkan" # Required Package: molten-vk - Homebrew
"--without-x"
)
echo "WINE_CONFIGURE_FLAGS=${WINE_CONFIGURE_FLAGS[@]}" >> $GITHUB_ENV
- name: Build Wine64
run: |
cd $WINE64_BUILD_DIR
$GITHUB_WORKSPACE/configure ${WINE_CONFIGURE_FLAGS[@]}
make -j$(sysctl -n hw.logicalcpu)
if [ $? -ne 0 ]; then
echo "Failed to build Wine64... Exiting."
exit 1
fi
make install-lib
- name: Install DXVK
run: |
cd $DXVK_BUILD_DIR
DXVK_URL=$(curl -s https://api.github.com/repos/Gcenx/DXVK-MacOS/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("dxvk-macOS")) | .browser_download_url')
curl -L -o dxvk.tar.gz $DXVK_URL
tar -xzf dxvk.tar.gz --strip-components=1 -C $DXVK_BUILD_DIR
rm dxvk.tar.gz
- name: Grab Verbs From Winetricks
run: |
cd $WINETRICKS_DATA_DIR
curl -L -o verbs.txt https://raw.githubusercontent.com/Winetricks/winetricks/master/files/verbs/all.txt
- name: Copy Files
run: |
cd $FINAL_DIR
mkdir -p wine
cp -r $WINE_FINAL_DIR/* wine
mkdir -p dxvk
cp -r $DXVK_BUILD_DIR/dxvk DXVK
cp -a $(brew --prefix winetricks)/bin/winetricks /
cp $WINETRICKS_DATA_DIR/verbs.txt verbs.txt
- name: Homebrew Libs [DEBUG]
run: |
ls $(brew --prefix)/lib
- name: Zip Everything [DEBUG]
run: |
zip -r -j Everything.zip $GITHUB_WORKSPACE/*
- name: Create Archive
run: |
cd $OUTPUT_DIR
tar -zcf Libraries.tar.gz $FINAL_DIR
- name: Upload Everything
uses: actions/upload-artifact@v4
with:
name: Everything
path: Everything.zip
- name: Upload Libraries [DEBUG]
uses: actions/upload-artifact@v4
with:
name: Libraries
path: $OUTPUT_DIR/Libraries.tar.gz