1
|
#!/bin/bash
|
2
|
#To get OSS to compile, I downloaded a release from
|
3
|
#http://www.opensound.com/developer/sources/stable/gpl/
|
4
|
|
5
|
#And copied include/soundcard.h to /usr/lib/oss/include/sys/soundcard.h
|
6
|
|
7
|
set -e
|
8
|
if [ ! -d wine-git ]
|
9
|
then
|
10
|
git clone git://source.winehq.org/git/wine.git wine-git
|
11
|
fi
|
12
|
|
13
|
if [ -d tmp_install ]
|
14
|
then
|
15
|
rm -rf tmp_install
|
16
|
fi
|
17
|
|
18
|
cd wine-git
|
19
|
|
20
|
do_build()
|
21
|
{
|
22
|
VERSION=$1
|
23
|
shift
|
24
|
if [[ $1 == "wglext" ]]
|
25
|
then
|
26
|
WGLEXT="-DBOXED_NEED_WGLEXT"
|
27
|
shift
|
28
|
fi
|
29
|
if [ ! -f ../wine-$VERSION.zip ]
|
30
|
then
|
31
|
git reset --hard
|
32
|
git checkout wine-$VERSION
|
33
|
while [[ $1 != "" ]]; do
|
34
|
if [[ $1 == "patch" ]]
|
35
|
then
|
36
|
shift
|
37
|
git apply ../patches/$1
|
38
|
if [[ $PATCHES != "" ]]
|
39
|
then
|
40
|
PATCHES+=" "
|
41
|
fi
|
42
|
PATCHES+=$1
|
43
|
shift
|
44
|
elif [[ $1 == "revert" ]]
|
45
|
then
|
46
|
shift
|
47
|
git revert -n $1
|
48
|
if [[ $REVERTS != "" ]]
|
49
|
then
|
50
|
REVERTS+=" "
|
51
|
fi
|
52
|
REVERTS+="git revert -n $1"
|
53
|
shift
|
54
|
elif [[ $1 == "depends" ]]
|
55
|
then
|
56
|
shift
|
57
|
ADD_DEPENDS=1
|
58
|
else
|
59
|
echo "unknown do_build option: $1"
|
60
|
exit
|
61
|
fi
|
62
|
done
|
63
|
rm -rf dlls/winex11.drv/*
|
64
|
cp -r ../../wineboxed.drv/*.* dlls/winex11.drv/
|
65
|
if [[ $ADD_DEPENDS == 1 ]]
|
66
|
then
|
67
|
echo "@MAKE_DLL_RULES@" >> dlls/winex11.drv/Makefile.in
|
68
|
fi
|
69
|
#for some reason I don't understand the config process will fail when looking for dependencies because the header does not exist, even though I wrapped it in a #ifdef
|
70
|
touch include/wine/wglext.h
|
71
|
./configure LDFLAGS="-s" CFLAGS="-O2 -march=pentium4 $WGLEXT" --without-cups --without-pulse --without-alsa --without-dbus --without-sane --without-hal --prefix=/opt/wine --disable-tests $EXTRA_ARGS
|
72
|
make -j4
|
73
|
#todo find another way to achieve what I want without using sudo
|
74
|
sudo rm -rf /opt/wine
|
75
|
sudo make install
|
76
|
mkdir ../tmp_install
|
77
|
mkdir ../tmp_install/opt
|
78
|
cp -r /opt/wine ../tmp_install/opt/
|
79
|
cd ../tmp_install
|
80
|
rm opt/wine/lib/wine/winemenubuilder.exe.so
|
81
|
rm opt/wine/lib/libwine.so
|
82
|
rm opt/wine/lib/libwine.so.1
|
83
|
printf "libwine.so.1.0" > opt/wine/lib/libwine.so.link
|
84
|
printf "libwine.so.1.0" > opt/wine/lib/libwine.so.1.link
|
85
|
printf "Wine $VERSION" > wineVersion.txt
|
86
|
printf "debian10.zip" > depends.txt
|
87
|
cp ../changes.txt changes.txt
|
88
|
echo "git checkout wine-$VERSION" > build.txt
|
89
|
if [[ $REVERTS != "" ]]
|
90
|
then
|
91
|
echo $REVERTS >> build.txt
|
92
|
fi
|
93
|
if [[ $PATCHES != "" ]]
|
94
|
then
|
95
|
echo "Patched: $PATCHES" >> build.txt
|
96
|
fi
|
97
|
echo './configure CFLAGS="-O2 -march=pentium4" --without-pulse --without-alsa --without-dbus --without-sane --without-hal --prefix=/opt/wine --disable-tests' >> build.txt
|
98
|
echo "make -j4" >> build.txt
|
99
|
zip -r ../wine-$VERSION.zip *
|
100
|
cd ../wine-git
|
101
|
make clean
|
102
|
rm -rf ../tmp_install
|
103
|
fi
|
104
|
}
|
105
|
|
106
|
VERSION=$(sed 's/\..*//' /etc/debian_version)
|
107
|
echo "Debian Version = $VERSION"
|
108
|
if [ $VERSION -gt 9 ]
|
109
|
then
|
110
|
# f2e5b8070776268912e1886d4516d7ddec6969fc
|
111
|
# kernel32: Use the Get/SetComputerName functions from kernelbase.
|
112
|
# reverted because on slower systems it will fail to create a window, not sure why
|
113
|
do_build 5.0 patch wine5-lz.patch revert f2e5b8070776268912e1886d4516d7ddec6969fc
|
114
|
# do_build 4.0
|
115
|
# do_build 3.1
|
116
|
else
|
117
|
do_build 2.0 wglext
|
118
|
|
119
|
#patch wine18-19-gnutls.patch
|
120
|
#1.7.47 <= wine < 1.9.13"
|
121
|
|
122
|
#patch wine17-19-cups.patch
|
123
|
#1.7.12 <= wine < 1.9.14
|
124
|
#1.3.28"<= wine < 1.7.12 needs patch 2ac0c877f591be14815902b527f314a915eee147 but I couldn't find it so I disabled cups in the configuration
|
125
|
|
126
|
#patches yylex 1-3
|
127
|
#1.3.28 <= wine < 1.7.0
|
128
|
#patch yylex 4 - jscript
|
129
|
#1.1.10 <= wine < 1.7.0
|
130
|
#patch yylex 5 - vbscript
|
131
|
#1.3.28 <= wine < 1.7.0
|
132
|
#patch yylex 6
|
133
|
#1.5.7 <= wine < 1.7.0
|
134
|
|
135
|
do_build 1.9.0 wglext patch wine18-19-gnutls.patch patch wine17-19-cups.patch
|
136
|
do_build 1.8 wglext patch wine18-19-gnutls.patch patch wine17-19-cups.patch
|
137
|
do_build 1.7.0 wglext depends
|
138
|
do_build 1.6 wglext depends patch yylex.1.patch patch yylex.2.patch patch yylex.3.patch patch yylex.4.patch patch yylex.5.patch patch yylex.6.patch
|
139
|
fi
|