-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Esme Povirk
committed
Apr 22, 2024
1 parent
3991f0f
commit 9844770
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
stages: | ||
- image | ||
- build | ||
- test | ||
|
||
variables: | ||
GIT_SUBMODULE_STRATEGY: "none" | ||
|
||
include: | ||
- local: "tools/ci/image.yml" | ||
- local: "tools/ci/build.yml" | ||
- local: "tools/ci/test.yml" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import shutil | ||
import tempfile | ||
import urllib.request | ||
|
||
need_gecko = True | ||
need_mono = False | ||
|
||
basedir = os.path.join(os.getcwd(), "wine-addons") | ||
|
||
existing_files = set(os.listdir(basedir)) | ||
|
||
addons_url = 'https://gitlab.winehq.org/wine/wine/-/raw/master/dlls/appwiz.cpl/addons.c?ref_type=heads&inline=false' | ||
|
||
with urllib.request.urlopen(addons_url) as response: | ||
addons_contents = response.read().decode('ascii') | ||
|
||
gecko_version = None | ||
mono_version = None | ||
|
||
for line in addons_contents.splitlines(): | ||
if line.startswith('#define GECKO_VERSION '): | ||
gecko_version = line.split()[2].strip('"') | ||
print('Gecko version: ' + gecko_version) | ||
if line.startswith('#define MONO_VERSION '): | ||
mono_version = line.split()[2].strip('"') | ||
print('Mono version: ' + mono_version) | ||
|
||
needed_files = {} | ||
|
||
if need_gecko: | ||
needed_files['wine-gecko-' + gecko_version + '-x86.msi'] = 'https://dl.winehq.org/wine/wine-gecko/' + gecko_version + '/wine-gecko-' + gecko_version + '-x86.msi' | ||
needed_files['wine-gecko-' + gecko_version + '-x86_64.msi'] = 'https://dl.winehq.org/wine/wine-gecko/' + gecko_version + '/wine-gecko-' + gecko_version + '-x86_64.msi' | ||
if need_mono: | ||
needed_files['wine-mono-' + mono_version + '-x86.msi'] = 'https://dl.winehq.org/wine/wine-mono/' + mono_version + '/wine-mono-' + mono_version + '-x86.msi' | ||
|
||
def download(url, filename): | ||
print("Downloading "+url) | ||
with urllib.request.urlopen(url) as response: | ||
with tempfile.NamedTemporaryFile(delete=False) as tmpfile: | ||
try: | ||
shutil.copyfileobj(response, tmpfile) | ||
shutil.move(tmpfile.name, filename) | ||
except: | ||
os.unlink(tmpfile.name) | ||
raise | ||
|
||
for f in needed_files: | ||
if f in existing_files: | ||
continue | ||
download(needed_files[f], os.path.join(basedir, f)) | ||
|
||
for f in existing_files: | ||
if f not in needed_files: | ||
print("Removing "+f) | ||
os.unlink(os.path.join(basedir, f)) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
linux-test: | ||
stage: test | ||
image: $CI_REGISTRY/wine/wine:debian-bookworm | ||
interruptible: true | ||
cache: | ||
- key: wine-addons | ||
paths: | ||
- wine-addons/ | ||
needs: | ||
- job: build | ||
before_script: | ||
- | | ||
- export BASEDIR=$PWD | ||
- export PATH=$BASEDIR/usr/local/bin:$PATH | ||
- export DISPLAY=:0 | ||
- export LC_ALL=C.UTF-8 | ||
- export LP_NUM_THREADS=4 | ||
- export WINEDEBUG=err-all,fixme-all | ||
- | | ||
cat >$HOME/xorg.conf << EOF | ||
Section "Device" | ||
Identifier "dummy" | ||
Driver "dummy" | ||
VideoRam 32768 | ||
EndSection | ||
EOF | ||
- echo 'exec /usr/bin/fvwm -f config -c "Style * MwmDecor" -c "Style * UsePPosition" 2>/dev/null' >$HOME/.xinitrc | ||
- startx -- -config $HOME/xorg.conf $DISPLAY & | ||
- mkdir -p wine-addons | ||
- tools/ci/download-addons.sh | ||
- wget -nv -O wine-build.zip "https://gitlab.winehq.org/wine/wine/-/jobs/artifacts/master/download?job=build-daily-linux" | ||
- unzip -q wine-build.zip | ||
- mkdir -p $HOME/Documents $HOME/Desktop usr/local/share/wine/gecko | ||
- cp -l $BASEDIR/wine-addons/*.msi usr/local/share/wine/gecko | ||
- pulseaudio --start --exit-idle-time=-1 | ||
- WINEDLLOVERRIDES=mscoree= wine wineboot.exe -u | ||
- wine reg add 'HKCU\Software\Wine\WineDbg' /v ShowCrashDialog /t REG_DWORD /d 0 /f | ||
- wine reg add 'HKCU\Software\Wine\Mono' /v RuntimePath /d "$(wine winepath -w ${BASEDIR}/image)" /f | ||
- wine64 regsvr32 /s mscoree | ||
- wineserver -w | ||
script: | ||
- wine tests/run-tests.exe |