This repository has been archived by the owner on Mar 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcreate_wine_runtime.sh
executable file
·53 lines (39 loc) · 1.65 KB
/
create_wine_runtime.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
#!/usr/bin/env bash
## This script creates runtime for Wine by using two Ubuntu chroots
scriptdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
CHROOT_X64="${HOME}/chroots/bionic64_chroot"
CHROOT_X32="${HOME}/chroots/bionic32_chroot"
if [ ! -d "${CHROOT_X64}" ] || [ ! -d "${CHROOT_X32}" ]; then
echo "Chroots are required for the runtime creation!"
exit 1
fi
if [ ! -f "${scriptdir}"/runtime_libs_list.txt ]; then
echo "runtime_libs_list.txt is required!"
exit 1
fi
rm -rf "${scriptdir}"/wine-runtime
mkdir -p "${scriptdir}"/wine-runtime/lib32
mkdir -p "${scriptdir}"/wine-runtime/lib
echo "Copying libraries..."
while read lib; do
if [ -f "${CHROOT_X32}"/usr/local/lib/"${lib}" ]; then
cp "${CHROOT_X32}"/usr/local/lib/"${lib}" "${scriptdir}"/wine-runtime/lib32 2>/dev/null
else
cp "${CHROOT_X32}"/lib/i386-linux-gnu/"${lib}" "${scriptdir}"/wine-runtime/lib32 2>/dev/null
cp "${CHROOT_X32}"/usr/lib/i386-linux-gnu/"${lib}" "${scriptdir}"/wine-runtime/lib32 2>/dev/null
fi
if [ -f "${CHROOT_X64}"/usr/local/lib/"${lib}" ]; then
cp "${CHROOT_X64}"/usr/local/lib/"${lib}" "${scriptdir}"/wine-runtime/lib 2>/dev/null
else
cp "${CHROOT_X64}"/lib/x86_64-linux-gnu/"${lib}" "${scriptdir}"/wine-runtime/lib 2>/dev/null
cp "${CHROOT_X64}"/usr/lib/x86_64-linux-gnu/"${lib}" "${scriptdir}"/wine-runtime/lib 2>/dev/null
fi
done < "${scriptdir}"/runtime_libs_list.txt
cd "${scriptdir}" || exit 1
find wine-runtime -type f -exec strip --strip-unneeded {} \;
echo "Creating and compressing archive..."
tar -cf wine-runtime.tar wine-runtime
xz -9 wine-runtime.tar
rm -r wine-runtime
if [ -d binaries ]; then ln -sfr wine-runtime.tar.xz binaries; fi
echo "Done"