-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathbuild-for-windows.sh
71 lines (59 loc) · 2.01 KB
/
build-for-windows.sh
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
updater=0
while getopts "hu" flag; do
case $flag in
h)
echo "No flags - Build without the updater function"
echo "-u - Enable the updater function"
exit
;;
u)
updater=1
;;
esac
done
echo "Installing dependencies..."
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-python
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-gtk4
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-libadwaita
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-python-pillow
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-python-gobject
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-python-pip
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-yt-dlp
pacman -S --noconfirm --needed unzip
pip install aria2p
pip install pyinstaller
echo "Downloading aria2 and ffmpeg..."
aria2="aria2-1.37.0-win-64bit-build1"
ffmpeg="ffmpeg-n7.1-latest-win64-lgpl-shared-7.1"
wget "https://github.com/aria2/aria2/releases/download/release-1.37.0/$aria2.zip"
wget "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/$ffmpeg.zip"
mkdir aria2
unzip -d aria2 $aria2.zip
mkdir ffmpeg
unzip -d ffmpeg $ffmpeg.zip
echo "Generating locales..."
rm -rf locale
mkdir locale
for po in po/*.po; do
lang=$(basename "$po" .po)
mkdir locale/$lang
mkdir locale/$lang/LC_MESSAGES
msgfmt -o "locale/$lang/LC_MESSAGES/varia.mo" "$po"
done
echo "Building PyInstaller distributable..."
cp -r windows/* src/
cd src
pyinstaller varia.spec
cd ..
cp -r locale src/dist/variamain/
cp data/icons/hicolor/symbolic/apps/io.github.giantpinkrobots.varia-symbolic.svg src/dist/variamain/
cp data/icons/hicolor/symbolic/apps/network-computer-symbolic.svg src/dist/variamain/
cp data/icons/hicolor/scalable/apps/io.github.giantpinkrobots.varia.svg src/dist/variamain/
cp -r dependencies_information src/dist/variamain/
cp ./aria2/$aria2/aria2c.exe src/dist/variamain/
cp -r ./ffmpeg/$ffmpeg/bin/* src/dist/variamain/
if [ $updater -eq 1 ]; then
touch src/dist/variamain/updater-function-enabled
fi
echo "Build complete."
echo "src/dist/variamain/variamain.exe"