Update #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Wine-Crossover-MacOS | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
# avoid weird linker errors with Xcode 10 and later | |
MACOSX_DEPLOYMENT_TARGET: 10.14 | |
# directories / files inside the downloaded tar file directory structure | |
WINE_CONFIGURE: ${{ github.workspace }}/sources/wine/configure | |
# build directories | |
BUILDROOT: ${{ github.workspace }}/build | |
# target directory for installation | |
INSTALLROOT: ${{ github.workspace }}/install | |
TOOLS_INSTALLATION: build-tools-cx | |
MOLTENVK_DXVK_INSTALLATION: moltenvk-dxvk | |
jobs: | |
moltenVK_DXVK: | |
runs-on: macos-13 | |
env: | |
# crossover source code to be downloaded | |
CROSS_OVER_SOURCE_URL: https://media.codeweavers.com/pub/crossover/source/crossover-sources-21.2.0.tar.gz | |
CROSS_OVER_LOCAL_FILE: crossover-22.0.1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
############ Restore MoltenVK / DXVK from cache ############## | |
- name: Restore MoltenVK / DXVK from cache | |
uses: actions/cache@v3 | |
id: cache_moltenVK_DXVK | |
with: | |
path: ${{ env.INSTALLROOT }}/${{ env.MOLTENVK_DXVK_INSTALLATION }} | |
key: cache_moltenVK_DXVK_v6 | |
############ Build MoltenVK / DXVK (if restore from cache failed) ############## | |
- name: Get and Extract Source | |
if: steps.cache_moltenVK_DXVK.outputs.cache-hit != 'true' | |
uses: ./.github/actions/get_source | |
with: | |
crossover-local-file: "${{ env.CROSS_OVER_LOCAL_FILE }}" | |
crossover-source-url: "${{ env.CROSS_OVER_SOURCE_URL }}" | |
- name: Build / Install MoltenVK and DXVK (if restore from cache failed) | |
if: steps.cache_moltenVK_DXVK.outputs.cache-hit != 'true' | |
uses: ./.github/actions/build_moltenvk_dxvk | |
with: | |
install-prefix: "${{ env.INSTALLROOT }}/${{ env.MOLTENVK_DXVK_INSTALLATION }}" | |
############ Upload MoltenVK / DXVK to be used in subsequent jobs ############## | |
- name: Tar MoltenVK / DXVK | |
run: | | |
set -x | |
pushd ${{ env.INSTALLROOT }} | |
tar -czf ${{ env.MOLTENVK_DXVK_INSTALLATION }}.tar.gz ${{ env.MOLTENVK_DXVK_INSTALLATION }} | |
ls -alt | |
popd | |
- name: Upload MoltenVK / DXVK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.MOLTENVK_DXVK_INSTALLATION }} | |
path: ${{ env.INSTALLROOT }}/${{ env.MOLTENVK_DXVK_INSTALLATION }}.tar.gz | |
wine-crossover: | |
needs: [moltenVK_DXVK] | |
strategy: | |
fail-fast: false | |
matrix: | |
CROSS_OVER_VERSION: [22.0.1, 21.2.0, 20.0.4, 19.0.2] # 22.0.0, 21.1.0, 21.0.0, 20.0.2, 20.0.1, 20.0.0, 19.0.1, 19.0.0 | |
runs-on: macos-13 | |
env: | |
# crossover source code to be downloaded | |
CROSS_OVER_SOURCE_URL: https://media.codeweavers.com/pub/crossover/source/crossover-sources-${{ matrix.CROSS_OVER_VERSION }}.tar.gz | |
CROSS_OVER_LOCAL_FILE: crossover-${{ matrix.CROSS_OVER_VERSION }} | |
# artifact names | |
WINE_INSTALLATION: wine-cx${{ matrix.CROSS_OVER_VERSION }} | |
DXVK_INSTALLATION: dxvk-cx${{ matrix.CROSS_OVER_VERSION }} | |
steps: | |
############ Prepare Workspace / Environment ############## | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get latest HomeBrew formulas/bottles | |
run: | | |
brew update | |
- name: Install Wine Build Dependencies | |
run: | | |
brew update | |
brew install gcenx/wine/cx-llvm \ | |
flex \ | |
pkgconfig | |
brew reinstall bison | |
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/d5ec00528f86b8ac31fac2a67b7667cc72aa1b04/Formula/mingw-w64.rb -O mingw-w64.rb | |
brew install mingw-w64.rb | |
- name: Install Wine Runtime Dependencies | |
run: | | |
brew install freetype \ | |
gphoto2 \ | |
gst-plugins-base \ | |
krb5 \ | |
molten-vk \ | |
sane-backends \ | |
sdl2 | |
- name: Install Wine Runtime Dependencies (pre 22) | |
if: ${{ matrix.CROSS_OVER_VERSION < '22' }} | |
run: | | |
brew install faudio \ | |
little-cms2 \ | |
libpng \ | |
mpg123 | |
- name: Add bison, cx-llvm, flex & krb5 to $PATH | |
run: | | |
set -x | |
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH | |
echo "$(brew --prefix cx-llvm)/bin" >> $GITHUB_PATH | |
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH | |
echo "$(brew --prefix krb5)/bin" >> $GITHUB_PATH | |
- name: Download MoltenVK / DXVK (from previous job) | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ env.MOLTENVK_DXVK_INSTALLATION }} | |
path: ${{ env.INSTALLROOT }} | |
- name: Unpack MoltenVK / DXVK | |
run: | | |
set -x | |
mkdir -p ${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }} | |
pushd ${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }} | |
ls -al | |
tar --strip-components=1 -xvf ${{ env.INSTALLROOT }}/${{ env.MOLTENVK_DXVK_INSTALLATION }}.tar.gz | |
ls -alt | |
popd | |
############ Download and Prepare Source Code ############## | |
- name: Get and Extract Source | |
uses: ./.github/actions/get_source | |
with: | |
crossover-local-file: "${{ env.CROSS_OVER_LOCAL_FILE }}" | |
crossover-source-url: "${{ env.CROSS_OVER_SOURCE_URL }}" | |
- name: Patch Add missing distversion.h | |
# Patch provided by Josh Dubois, CrossOver product manager, CodeWeavers. | |
run: | | |
pushd sources/wine | |
patch -p1 < ${{ github.workspace }}/distversion.patch | |
popd | |
- name: Patch in vkd3d-1.4 (specific to 22.0.0) | |
if: ${{ matrix.CROSS_OVER_VERSION == '22.0.0' }} | |
run: | | |
pushd sources/wine | |
patch -p1 < ${GITHUB_WORKSPACE}/CX22.0.0-vkd3d-1.4.patch | |
popd | |
- name: Patch ntdll/wcstring.c to prevent crash if a nullptr is supplied to the function | |
# Hack by dasmy | |
if: startsWith(matrix.CROSS_OVER_VERSION, '20') | |
run: | | |
pushd sources/wine | |
patch -p1 < ${{ github.workspace }}/wcstring.patch | |
popd | |
- name: Patch msvcrt to export the missing sincos function (specific to 20) | |
# https://gitlab.winehq.org/wine/wine/-/commit/f0131276474997b9d4e593bbf8c5616b879d3bd5 | |
if: startsWith(matrix.CROSS_OVER_VERSION, '20') | |
run: | | |
pushd sources/wine | |
patch -p1 < ${{ github.workspace }}/msvcrt-sincos.patch | |
popd | |
############ Configure 64bit Version ############## | |
- name: Configure wine64 (specific to 22) | |
if: startsWith(matrix.CROSS_OVER_VERSION, '22') | |
uses: ./.github/actions/configure_wine | |
with: | |
winearch: "wine64" | |
build-dir: "${{ env.BUILDROOT }}/wine64" | |
crossflags: "-g -O2" | |
configure-params: "--enable-win64 --with-vulkan" | |
- name: Configure wine64 (pre 22) | |
if: ${{ matrix.CROSS_OVER_VERSION < '22' }} | |
uses: ./.github/actions/configure_wine | |
with: | |
winearch: "wine64" | |
build-dir: "${{ env.BUILDROOT }}/wine64" | |
crossflags: "-g -O2 -fcommon" | |
configure-params: "--enable-win64 --with-vulkan" | |
############ Build 64bit Version ############## | |
- name: Build wine64 | |
uses: ./.github/actions/make | |
with: | |
build-dir: "${{ env.BUILDROOT }}/wine64" | |
############ Configure 32on64bit Version ############## | |
# - name: Configure wine32on64 (specific to 22) | |
# if: startsWith(matrix.CROSS_OVER_VERSION, '22') | |
# uses: ./.github/actions/configure_wine | |
# with: | |
# winearch: "wine32on64" | |
# build-dir: "${{ env.BUILDROOT }}/wine32on64" | |
# crossflags: "-g -O2" | |
# configure-params: "--enable-win32on64 --with-wine64=${{ env.BUILDROOT }}/wine64 --without-cms --without-openal --without-gstreamer --without-gphoto --without-krb5 --without-sane --without-vulkan --disable-vulkan_1 --disable-winedbg --disable-winevulkan" | |
# - name: Configure wine32on64 (pre 22) | |
# if: ${{ matrix.CROSS_OVER_VERSION < '22' }} | |
# uses: ./.github/actions/configure_wine | |
# with: | |
# winearch: "wine32on64" | |
# build-dir: "${{ env.BUILDROOT }}/wine32on64" | |
# crossflags: "-g -O2 -fcommon" | |
# configure-params: "--enable-win32on64 --with-wine64=${{ env.BUILDROOT }}/wine64 --without-cms --without-gstreamer --without-gphoto --without-krb5 --without-sane --without-vkd3d --without-vulkan --disable-vulkan_1 --disable-winedbg --disable-winevulkan" | |
############ Build 32on64bit Version ############## | |
# - name: Build wine32on64 | |
# uses: ./.github/actions/make | |
# with: | |
# build-dir: "${{ env.BUILDROOT }}/wine32on64" | |
############ Install wine ############## | |
# - name: Install wine32on64 | |
# uses: ./.github/actions/install | |
# with: | |
# build-dir: "${{ env.BUILDROOT }}/wine32on64" | |
# install-dir: "${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }}" | |
- name: Install wine64 | |
uses: ./.github/actions/install | |
with: | |
build-dir: "${{ env.BUILDROOT }}/wine64" | |
install-dir: "${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }}" | |
- name: Create wine, wine-preloader symlinks | |
run: | | |
pushd ${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }}/usr/local/bin | |
ln -s wine32on64 wine | |
ln -s wine32on64-preloader wine-preloader | |
popd | |
############ Bundle and Upload Deliverable ############## | |
- name: Tar Wine | |
run: | | |
set -x | |
pushd ${{ env.INSTALLROOT }} | |
tar -czvf ${{ env.WINE_INSTALLATION }}.tar.gz ${{ env.WINE_INSTALLATION }} | |
popd | |
- name: Upload Wine | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.WINE_INSTALLATION }} | |
path: ${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }}.tar.gz | |
wine-crossover-local: | |
strategy: | |
fail-fast: false | |
matrix: | |
CROSS_OVER_VERSION: [22.0.1] # 22.0.0, 21.2.0, 20.0.4, 19.0.2, 21.1.0, 21.0.0, 20.0.2, 20.0.1, 20.0.0 | |
runs-on: macos-13 | |
needs: wine-crossover | |
env: | |
CROSS_OVER_VERSION: ${{ matrix.CROSS_OVER_VERSION }} | |
# this has to be synchronized with the same variable in build_local.sh | |
PACKAGE_UPLOAD: ${{ github.workspace }}/upload | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Run build_local.sh | |
run: ./build_local.sh | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: artifacts-build_local-wine-cx${{ matrix.CROSS_OVER_VERSION }} | |
path: ${{ env.PACKAGE_UPLOAD }} |