4444 env :
4545 TARGET_TRIPLE : x86_64-apple-darwin
4646 # cross-compile from Linux to Windows using mingw
47- # FIXME The wine version in Ubuntu 22.04 is missing ProcessPrng
48- # - os: ubuntu-latest
49- # env:
50- # TARGET_TRIPLE: x86_64-pc-windows-gnu
47+ - os : ubuntu-latest
48+ env :
49+ TARGET_TRIPLE : x86_64-pc-windows-gnu
5150 - os : ubuntu-latest
5251 env :
5352 TARGET_TRIPLE : aarch64-unknown-linux-gnu
@@ -81,11 +80,11 @@ jobs:
8180 if : matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
8281 run : rustup set default-host x86_64-pc-windows-gnu
8382
84- # - name: Install MinGW toolchain and wine
85- # if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
86- # run: |
87- # sudo apt-get update
88- # sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
83+ - name : Install MinGW toolchain and wine
84+ if : matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
85+ run : |
86+ sudo apt-get update
87+ sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
8988
9089 - name : Install AArch64 toolchain and qemu
9190 if : matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'aarch64-unknown-linux-gnu'
@@ -108,6 +107,15 @@ jobs:
108107 - name : Prepare dependencies
109108 run : ./y.sh prepare
110109
110+ # The Wine version shipped with Ubuntu 22.04 doesn't implement bcryptprimitives.dll
111+ - name : Build bcryptprimitives.dll shim for Wine
112+ if : matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
113+ run : |
114+ rustup target add x86_64-pc-windows-gnu
115+ mkdir wine_shims
116+ rustc patches/bcryptprimitives.rs -Copt-level=3 -Clto=fat --out-dir wine_shims --target x86_64-pc-windows-gnu
117+ echo "WINEPATH=$(pwd)/wine_shims" >> $GITHUB_ENV
118+
111119 - name : Build
112120 run : ./y.sh build --sysroot none
113121
@@ -234,11 +242,11 @@ jobs:
234242 if : matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
235243 run : rustup set default-host x86_64-pc-windows-gnu
236244
237- - name : Install MinGW toolchain and wine
245+ - name : Install MinGW toolchain
238246 if : matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
239247 run : |
240248 sudo apt-get update
241- sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
249+ sudo apt-get install -y gcc-mingw-w64-x86-64
242250
243251 - name : Prepare dependencies
244252 run : ./y.sh prepare
0 commit comments