-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
77 lines (54 loc) · 2.3 KB
/
build.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
72
73
74
75
76
77
#!/usr/bin/env bash
# Setup environment
export ARCH="x86_64"
export Version="4.21"
export BuildDependencies="aptitude wget file gzip bzip2 curl cabextract"
export WorkingDir="Wine.AppDir"
export PackagesDirectory='/tmp/.cache'
export wgetOptions="-nv -c --show-progress --progress=bar:force:noscroll"
export DownloadURLs=(
"https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-x86/PlayOnLinux-wine-${Version}-upstream-linux-x86.tar.gz"
"https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
"https://github.com/Hackerl/Wine_Appimage/releases/download/v0.9/libhookexecv.so"
"https://github.com/Hackerl/Wine_Appimage/releases/download/v0.9/wine-preloader_hook"
"https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
)
# Install build deps
dpkg --add-architecture i386
apt update
apt install ${BuildDependencies} zsync -y
# Create Directories
mkdir -p "${PackagesDirectory}"
mkdir -p "${WorkingDir}/Resources"
mkdir -p "${WorkingDir}/Flags"
# Download files
wget ${wgetOptions} ${DownloadURLs[@]}
# Turn executable
chmod +x "appimagetool-x86_64.AppImage"
chmod +x "data/"*
chmod +x "winetricks"
# Get WINE deps
aptitude -y -d -o dir::cache::archives="${PackagesDirectory}" install libwine:i386 libcups2:i386
wget -q "http://ftp.us.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u3_i386.deb" -O "${PackagesDirectory}/libpng12.deb"
# Extract WINE
tar -xzf "PlayOnLinux-wine-${Version}-upstream-linux-x86.tar.gz" -C "${WorkingDir}" 2> /dev/null || \
tar -xjf "PlayOnLinux-wine-${Version}-upstream-linux-x86.tar.gz" -C "${WorkingDir}"
# Copy wine dependencies to AppDir
find "${PackagesDirectory}" -name '*deb' ! -name 'libwine*' -exec dpkg -x {} "./${WorkingDir}" \;
# Copy data to AppDir
cp -r data/* "${WorkingDir}"
cp -r flags/* "${WorkingDir}/Flags"
cp -r resources/* "${WorkingDir}/Resources"
ls
pwd
ls ..
mv "libhookexecv.so" "${WorkingDir}/bin"
mv "wine-preloader_hook" "${WorkingDir}/bin"
mv "winetricks" "${WorkingDir}/bin"
cp "$(which cabextract)" "${WorkingDir}/bin"
cp appimagetool-x86_64.AppImage "${WorkingDir}"
# Build AppImage
./appimagetool-x86_64.AppImage --appimage-extract-and-run "${WorkingDir}"
mv "Wine-x86_64.AppImage" "Wine-${Version}-x86_64.AppImage"
zsyncmake "Wine-${Version}-x86_64.AppImage"
exit