Skip to content

Commit

Permalink
update snap to use core22 and wine 9 devel
Browse files Browse the repository at this point in the history
  • Loading branch information
mmtrt committed Nov 3, 2024
1 parent f899cda commit dd4a1fd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 103 deletions.
4 changes: 2 additions & 2 deletions snap/gui/cncra2yr.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Name=C&C: Red Alert 2 Yuri's Revenge
Comment=
Exec=cncra2yr
Icon=${SNAP}/meta/gui/cncra2yr.png
Categories=Game;
Categories=Game;StrategyGame;
Terminal=false
StartupNotify=true
StartupWMClass=clientxna.exe,game.exe,gamemd-spawn.exe
StartupWMClass=clientogl.exe,game.exe,gamemd-spawn.exe
Keywords=game
12 changes: 0 additions & 12 deletions snap/gui/cncra2yrdx.desktop

This file was deleted.

12 changes: 0 additions & 12 deletions snap/gui/cncra2yrogl.desktop

This file was deleted.

6 changes: 6 additions & 0 deletions snap/local/src/pre-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

if [[ -d "$SNAP/winedata/wine" ]]; then
cp -urs "$SNAP/winedata/wine" "${XDG_CACHE_HOME}"
cp -urs "$SNAP/winedata/winetricks" "${XDG_CACHE_HOME}"
fi
15 changes: 0 additions & 15 deletions snap/local/src/pre-start

This file was deleted.

86 changes: 24 additions & 62 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,79 +11,55 @@ grade: stable
confinement: strict
architectures:
- build-on: amd64
run-on: [amd64]
base: core20
base: core22
compression: lzo

plugs:
wine-runtime-c20:
shmem:
interface: shared-memory
private: true
wine-runtime-c22:
interface: content
target: $SNAP/wine-runtime
default-provider: wine-platform-runtime-core20
wine-7-stable:
default-provider: wine-platform-runtime-core22
wine-9-devel:
interface: content
target: $SNAP/wine-platform
default-provider: wine-platform-7-stable-core20
default-provider: wine-platform-9-devel-core22

environment:
WINEDLLOVERRIDES: "mshtml=" # Prevent pop-ups about Wine Gecko
WINEPREFIX: "$SNAP_USER_COMMON/.wine"
WINEARCH: "win64"
INSTALL_URL_CNC: "https://downloads.cncnet.org/CnCNet5_YR_Installer.exe"
TRICKS: "xna40 dotnet45"
TRICKS: "win10"
NO_AT_BRIDGE: 1
DISABLE_WAYLAND: 1
SOMMELIER_INSTALL_MONO: 1
SOMMELIER_NO_THEME: 1
SYSTEM_WGETRC: $SNAP/wine-runtime/etc/wgetrc

layout:
/usr/share/libdrm:
bind: $SNAP/wine-runtime/usr/share/libdrm

apps:
cncra2yr:
extensions: [ gnome-3-38 ]
command: bin/sommelier run-exe
environment:
RUN_EXE: "C:/Westwood/RA2/Resources/clientxna.exe"
plugs:
- home
- network
- network-bind
- opengl
- audio-playback

cncra2yrdx:
extensions: [ gnome-3-38 ]
command: bin/sommelier run-exe
environment:
RUN_EXE: "C:/Westwood/RA2/Resources/clientdx.exe"
plugs:
- home
- network
- network-bind
- opengl
- audio-playback

cncra2yrogl:
extensions: [ gnome-3-38 ]
extensions: [gnome]
command: bin/sommelier run-exe
environment:
RUN_EXE: "C:/Westwood/RA2/Resources/clientogl.exe"
plugs:
- home
- network
- network-bind
- opengl
- audio-playback
- shmem

wine:
extensions: [ gnome-3-38 ]
extensions: [gnome]
command: bin/sommelier
plugs:
- home
- network
- shmem
winetricks:
extensions: [ gnome-3-38 ]
extensions: [gnome]
command: bin/sommelier winetricks
plugs:
- network
Expand All @@ -93,16 +69,13 @@ parts:
plugin: nil
source: ./snap/local/src
override-build: |
snapcraftctl build
craftctl default
set -ex
mkdir -p sommelier/hooks ; mv pre-install sommelier/hooks ; mv pre-start sommelier/hooks ; cp -R -p sommelier $SNAPCRAFT_PART_INSTALL
mkdir -p sommelier/hooks ; mv pre-install sommelier/hooks ; mv pre-init sommelier/hooks ; cp -R -p sommelier $CRAFT_PART_INSTALL
# Pre download required dependencies
wget -q "https://dl.winehq.org/wine/wine-mono/7.0.0/wine-mono-7.0.0-x86.msi" -P winedata/wine
wget -q "https://dl.winehq.org/wine/wine-mono/9.3.0/wine-mono-9.3.0-x86.msi" -P winedata/wine
wget -q "https://downloads.cncnet.org/CnCNet5_YR_Installer.exe" -P winedata
wget -q "https://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe" -P winedata/winetricks/dotnet40
wget -q "https://download.microsoft.com/download/b/a/4/ba4a7e71-2906-4b2d-a0e1-80cf16844f5f/dotnetfx45_full_x86_x64.exe" -P winedata/winetricks/dotnet45
wget -q "https://web.archive.org/web/20120325002813/https://download.microsoft.com/download/A/C/2/AC2C903B-E6E8-42C2-9FD7-BEBAC362A930/xnafx40_redist.msi" -P winedata/winetricks/xna40
cp -R -p winedata $SNAPCRAFT_PART_INSTALL
cp -R -p winedata $CRAFT_PART_INSTALL
stage:
- sommelier
- winedata
Expand All @@ -114,18 +87,7 @@ parts:
sommelier:
plugin: make
source: https://github.com/mmtrt/sommelier-core.git
source-branch: "tmp-core20"

# This reverts changes from https://github.com/snapcore/snapcraft/pull/3586
fix-fontconfig:
plugin: nil
after: [gnome-3-38-extension]
override-prime: |
sed -i '/snap-package/,+1d' $SNAPCRAFT_PRIME/snap/command-chain/desktop-launch
fix-bindtext:
plugin: nil
after: [gnome-3-38-extension]
override-prime: |
sed -i "$(grep -in bindtext $SNAPCRAFT_PRIME/snap/command-chain/desktop-launch | cut -d':' -f1 | tail -2 | head -1)d" $SNAPCRAFT_PRIME/snap/command-chain/desktop-launch
sed -i "$(grep -in bindtext $SNAPCRAFT_PRIME/snap/command-chain/desktop-launch | cut -d':' -f1 | tail -1)d" $SNAPCRAFT_PRIME/snap/command-chain/desktop-launch
source-branch: "core22"
build-packages:
- libc6-dev-i386
- gcc-multilib

0 comments on commit dd4a1fd

Please sign in to comment.