-
Notifications
You must be signed in to change notification settings - Fork 10
/
win-build.sh
176 lines (163 loc) · 4.65 KB
/
win-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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
mkdir -p win-deps
cd win-deps
### PIDGIN-FETCH
if [ ! -d pidgin-*.*.? ]
then
wget -c http://gaim-extprefs.sf.net/winpidgin-build-fetcher.sh
sh winpidgin-build-fetcher.sh
if [ "$?" -ne 0 ]
then
exit
fi
fi
### OLDER GCC - if needed
if [ "$1" == "win2k" ]
then
cd win32-dev
cd mingw
wget -O gcc.tar.gz -c http://sourceforge.net/projects/mingw/files/GCC%20Version%203/Previous%20Release_%20gcc-3.4.2/gcc-core-3.4.2-20040916-1.tar.gz/download
tar -xzf gcc.tar.gz
cd ..
cd ..
fi
### WIN32-MINGW
cd win32-dev
cd mingw
wget -O w32.tar.gz -c http://sourceforge.net/projects/mingw/files/MinGW%20API%20for%20MS-Windows/w32api-3.14/w32api-3.14-mingw32-dev.tar.gz/download
tar -xzf w32.tar.gz
cd ..
cd ..
### LIBPURPLE
cd pidgin-*.*.?
cd libpurple
if [ ! -e libpurple.dll ]
then
make -f Makefile.mingw
if [ "$?" -ne 0 ]
then
exit
fi
make -f Makefile.mingw install
fi
cd ..
cd ..
### G++
echo "downloading g++"
cd win32-dev
cd mingw
if [ "$1" == "win2k" ]
then
wget -O g++.tar.gz -c http://sourceforge.net/projects/mingw/files/GCC%20Version%203/Previous%20Release_%20gcc-3.4.2/gcc-g%2B%2B-3.4.2-20040916-1.tar.gz/download
else
wget -O g++.tar.gz -c http://downloads.sourceforge.net/project/mingw/GCC%20Version%203/Current%20Release_%20gcc-3.4.5-20060117-3/gcc-g%2B%2B-3.4.5-20060117-3.tar.gz?use_mirror=surfnet
fi
echo "unpacking g++"
tar -xzf g++.tar.gz
cd ..
cd ..
### GLOOX
echo "downloading gloox"
wget -c http://camaya.net/download/gloox-1.0.tar.bz2
if [ ! -d gloox ]
then
tar -xjf gloox-1.0.tar.bz2
mv gloox-1.0 gloox
fi
cd gloox
if [ ! -e src/.libs/cyggloox-8.dll ]
then
rm -rf src/.deps
./configure --with-schannel --without-examples --without-tests
if [ "$?" -ne 0 ]
then
exit
fi
#make clean
make
if [ "$?" -ne 0 ]
then
exit
fi
fi
cd ..
### POCO
echo "downloading poco"
wget -c http://downloads.sourceforge.net/project/poco/sources/poco-1.3.5/poco-1.3.5-all.tar.gz?use_mirror=dfn
if [ ! -d poco-1.3.5-all ]
then
echo "unpacking poco"
tar -xzf poco-1.3.5-all.tar.gz
fi
cd poco-1.3.5-all
if [ ! -e Data/lib/MinGW/ia32/libPocoSQLite.a ]
then
./configure --config=MinGW --no-tests --no-samples
echo "patching"
sed -i 's/LIBPATH = $(POCO_BUILD)\/$(LIBDIR)/LIBPATH = ..\/$(LIBDIR)/g' build/rules/global
sed -i 's/OBJPATH = $(POCO_BUILD)\/$(COMPONENT)\/$(OBJDIR)/OBJPATH = $(OBJDIR)/g' build/rules/global
sed -i 's/INCLUDE = $(foreach p,$(POCO_ADD_INCLUDE),-I$(p)) -Iinclude $(foreach p,$(COMPONENTS),-I$(POCO_BASE)\/$(p)\/$(INCDIR))/INCLUDE = $(foreach p,$(POCO_ADD_INCLUDE),-I$(p)) -Iinclude $(foreach p,$(COMPONENTS),-I..\/$(p)\/$(INCDIR)) $(foreach p,$(COMPONENTS),-I..\/..\/$(p)\/$(INCDIR))/g' build/rules/global
sed -i 's/libexecs: $(filter-out $(foreach f,$(OMIT),$f%),$(libexecs))/libexecs: Foundation-libexec Data-libexec Data\/SQLite-libexec/g' Makefile
sed -i 's/all: libexecs tests samples/all: libexecs/g' Makefile
echo "compiling"
sleep 3
make
if [ "$?" -ne 0 ]
then
exit
fi
fi
cd ..
### GLib Binaries
wget -O glib.zip -c http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.22/glib_2.22.4-1_win32.zip
unzip -n glib.zip
cd ..
### SPECTRUM
echo "copying gloox headers"
cp win-deps/gloox/src/*.h win-deps/gloox
echo "aclocal"
aclocal
echo "automake"
automake --add-missing
echo "autoconf"
autoconf
echo "removing .deps"
rm -rf src/.deps
./configure
make clean
make
if [ "$?" -ne 0 ]
then
exit
fi
### SPECTRUM INSTALL
echo "copying libraries into bin/"
mkdir -p bin
cp src/spectrum.exe bin/spectrum.exe
strip bin/spectrum.exe
cp spectrum.cfg.win bin/spectrum.cfg
cp -r win-deps/pidgin-*.*.?/win32-install-dir/* bin/
cp win-deps/bin/*.dll bin/
cp nsis/*.bat bin/
cp win-deps/gtk_installer/gtk_install_files/bin/intl.dll bin/
cp win-deps/gtk_installer/gtk_install_files/bin/iconv.dll bin/
cp win-deps/gtk_installer/gtk_install_files/bin/asprintf.dll bin/
cp win-deps/gtk_installer/gtk_install_files/bin/libexpat.dll bin/
cp win-deps/gtk_installer/gtk_install_files/bin/zlib1.dll bin/
cp win-deps/gtk_installer/gtk_install_files/bin/xmlparse.dll bin/
cp win-deps/gtk_installer/gtk_install_files/bin/xmltok.dll bin/
cp win-deps/gtk_installer/gtk_install_files/bin/charset.dll bin/
cp win-deps/gtk_installer/gtk_install_files/bin/libatk-1.0-0.dll bin/
cp win-deps/win32-dev/libxml2-2.6.30/bin/libxml2.dll bin/
cp win-deps/gloox/src/.libs/cyggloox-8.dll bin/
strip bin/cyggloox-8.dll
### Package
rm -rf spectrum-git
mv bin spectrum-git
echo "creating spectrum-git.tar.gz"
tar -czf spectrum-git.tar.gz spectrum-git
echo "creating spectrum-git.tar.bz2"
tar -cjf spectrum-git.tar.bz2 spectrum-git
## NSIS installer
cd nsis
makensis spectrum.nsi
cd ..