-
Notifications
You must be signed in to change notification settings - Fork 0
/
com.blizzard.BattleNet.yml
132 lines (115 loc) · 4.77 KB
/
com.blizzard.BattleNet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
app-id: com.blizzard.BattleNet
sdk: org.freedesktop.Sdk
runtime: org.freedesktop.Platform
runtime-version: &runtime-version '24.08'
base: org.winehq.WineStaging
base-version: stable-23.08
command: BattleNetWrapper
rename-desktop-file: BattleNet.desktop
rename-icon: BattleNet
finish-args:
- --device=all
- --filesystem=host:ro
- --filesystem=xdg-run/app/com.discordapp.Discord:create # Required for setting up Discord rich presence
- --filesystem=xdg-run/gamescope-0:ro # Required for Gamescope on Steam Deck
- --socket=pulseaudio
- --socket=x11
- --share=network
- --share=ipc
- --allow=multiarch
inherit-extensions:
- org.freedesktop.Platform.Compat.i386
- org.freedesktop.Platform.GL32
- org.freedesktop.Platform.ffmpeg-full
- org.freedesktop.Platform.ffmpeg_full.i386
- org.winehq.WineStaging.gecko
- org.winehq.WineStaging.mono
- org.winehq.WineStaging.DLLs
add-extensions:
com.blizzard.BattleNet.Hearthstone:
subdirectories: true
directory: share
# version: stable
# versions: stable;beta;test
no-autodownload: true
autodelete: true
modules:
# Icoutils, needed for extracting .ico from BattleNetSetup.exe
- name: Icoutils
buildsystem: simple
sources:
- type: archive
url: http://savannah.nongnu.org/download/icoutils/icoutils-0.32.3.tar.bz2
sha256: 17abe02d043a253b68b47e3af69c9fc755b895db68fdc8811786125df564c6e0
build-commands:
- |
echo "Configuring and make Icoutls"
./configure --prefix=${FLATPAK_DEST}
make
echo "Installing Icoutils"
make install
# ImageMagick, needed for converting .ico extracted from exe to .png
- name: ImageMagick
buildsystem: simple
sources:
- type: git
url: https://github.com/ImageMagick/ImageMagick.git
tag: 7.1.1-36
build-commands:
- |
echo "Configuring and make ImageMagick"
./configure --prefix=${FLATPAK_DEST}
make
echo "Installing ImageMagick"
make install
# BattleNet Setup exe, shell scripts that extract and convert BattleNet icon and a script that installs/launches BattleNet
- name: BattleNet
buildsystem: simple
sources:
# Metadata file for Flatpak repos
- type: file
path: com.blizzard.BattleNet.metainfo.xml
# Desktop file
- type: file
path: BattleNet.desktop
# The Windows exe that will be ran with wine to install BattleNet (If it is already installed, the exe instead launches BattleNet)
- type: file
url: https://www.battle.net/download/getInstallerForGame?os=win&version=LIVE&gameProgram=BATTLENET_APP
sha256: 002f33fee7b8a159058368b7e93e492931c4ca72e90660bdb2691bcd62fedd3c
dest-filename: BattleNetSetup.exe
# Shell script that extracts BattleNet icon from the BattleNetSetup.exe, converts it to different sized png files and move those to the correct icon locations
- type: shell
commands:
- |
echo "Extracting BattleNet icon from BattleNetSetup.exe"
wrestool -x --output=BattleNet.ico -t14 BattleNetSetup.exe
echo "Converting BattleNet.ico to BattleNet.png"
convert BattleNet.ico BattleNet.png
echo "Moving BattleNet-6.png to /app/share/icons/hicolor/64x64/apps/BattleNet.png"
mv BattleNet-6.png /app/share/icons/hicolor/64x64/apps/BattleNet.png
echo "Moving BattleNet-0.png to /app/share/icons/hicolor/128x128/apps/BattleNet.png"
mv BattleNet-0.png /app/share/icons/hicolor/128x128/apps/BattleNet.png
echo "Moving BattleNet-3.png to /app/share/icons/hicolor/256x256/apps/BattleNet.png"
mv BattleNet-3.png /app/share/icons/hicolor/256x256/apps/BattleNet.png
# Script that is ran everytime the final Flatpak is ran, which sets up Discord rich presence and then runs the BattleNetSetup.exe with Wine
- type: script
commands:
- |
echo "Setting up Discord rich presence"
for i in {0..9}; do
test -S $XDG_RUNTIME_DIR/discord-ipc-$i ||
ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i;
done
echo "Launching BattleNetSetup.exe"
wine /app/bin/BattleNetSetup.exe
dest-filename: BattleNetWrapper
build-commands:
- |
echo "Installing com.blizzard.BattleNet.metainfo.xml in /app/share/metainfo/"
install -Dm644 -t /app/share/metainfo/ com.blizzard.BattleNet.metainfo.xml
echo "Moving BattleNet.desktop to /app/share/applications"
mv BattleNet.desktop /app/share/applications
echo "Moving BattleNetSetup.exe to /app/bin"
mv BattleNetSetup.exe /app/bin
echo "Moving BattleNetWrapper to /app/bin"
mv BattleNetWrapper /app/bin