gerbv_open_image() can now take a zip archive as an argument.
[geda-gerbv/spe.git] / win32 / extract_gtk_win32
blob14f831fac4d29380ae40c201f2341a23f4189660
1 #!/bin/sh
3 # $Id$
5 # This script is probably not useful to most people. It is used
6 # to extract a set of downloaded files for gtk for windows and
7 # also extract a bunch of license files.
9 # It is used when initially setting up a cygwin environment for
10 # building gerbv or pcb with a non-cygwin version for windows
11 # as the goal.
13 # directory where all the files have been downloaded
14 gtk_win32_downloads=${HOME}/gtk_win32_downloads
16 # directory to extract everything (including headers) to.
17 # This must match ./build_pcb.
18 gtk_win32=${HOME}/gtk_win32
19 gd_win32=${HOME}/gd_win32
21 # directory to extract runtime files (excluding headers) to.
22 # This must match ./build_pcb.
23 gtk_win32_runtime=${HOME}/gtk_win32_runtime
24 gd_win32_runtime=${HOME}/gd_win32_runtime
26 # clean out old directories
27 test ! -d ${gtk_win32} || rm -fr ${gtk_win32}
28 test ! -d ${gtk_win32_runtime} || rm -fr ${gtk_win32_runtime}
30 test ! -d ${gd_win32} || rm -fr ${gd_win32}
31 test ! -d ${gd_win32_runtime} || rm -fr ${gd_win32_runtime}
33 # make the new ones
34 mkdir -p ${gtk_win32}
35 mkdir -p ${gtk_win32_runtime}
37 mkdir -p ${gd_win32}
38 mkdir -p ${gd_win32_runtime}/bin
40 # extract the runtime files
41 cd ${gtk_win32_runtime}
42 for f in ${gtk_win32_downloads}/*.zip ; do
43 fb=`basename "${f}"`
44 case "$fb" in
45 gd-*)
46 echo "Skip gd"
48 *dev*)
49 echo "Skip developer file `basename ${fb}`"
51 *src*)
52 echo "Skip source file `basename ${fb}`"
55 echo "Extract ${fb}"
56 unzip -n -q "$f"
58 esac
59 done
61 # extract the runtime+developer files
62 cd ${gtk_win32}
63 for f in ${gtk_win32_downloads}/*.zip ; do
64 fb=`basename "${f}"`
65 case "$fb" in
66 gd-*)
67 echo "Skip gd"
69 *src*)
70 echo "Skip source file `basename ${fb}`"
73 echo "Extract ${fb}"
74 unzip -n -q "$f"
76 esac
77 done
79 chmod 755 ${gtk_win32}/bin/*
80 mv ${gtk_win32_runtime}/zlib*.dll ${gtk_win32_runtime}/bin
81 chmod 755 ${gtk_win32_runtime}/bin/*
83 cd ${HOME}
86 cd ${gd_win32}
87 unzip ${gtk_win32_downloads}/gd-*-win32.zip
88 cp */*.dll ${gd_win32_runtime}/bin
89 cat > ${gd_win32_runtime}/gd-license.txt << EOF
90 The GD library which provides png/gif/jpeg exporting
91 is covered by the following license:
93 EOF
94 cat ${gd_win32}/COPYING.TXT >> ${gd_win32_runtime}/gd-license.txt
95 chmod 755 ${gd_win32}/*/*
96 chmod 755 ${gd_win32_runtime}/*
98 cd ${HOME}
100 # extract licenses
103 tmpd=/tmp/ext.$$
104 mkdir ${tmpd}
106 cd ${tmpd}
109 cat > ${gtk_win32_runtime}/LICENSE-lgpl << EOF
110 The following packages are covered by the
111 GNU Library General Public License (LGPL)
114 cairo
115 glib
116 gtk+
117 libiconv
118 pango
119 proxy-libintl
121 ----------------------------------------
125 cat > ${gtk_win32_runtime}/LICENSE-gpl2 << EOF
126 The following packages are covered by the GNU General Public License (GPL) v2.
128 freetype
129 pkg-config
131 ----------------------------------------
135 cat > ${gtk_win32_runtime}/LICENSE-gpl3 << EOF
136 The following packages are covered by the GNU General Public License (GPL) v3.
138 gettext
140 ----------------------------------------
145 # LGPL
147 # atk-1.22.0.tar.bz2
148 # atk-1.22.0.zip
149 # atk-dev-1.22.0.zip
151 bzcat ${gtk_win32_downloads}/atk-*.tar.bz2 | tar -xf -
152 cat atk-*/COPYING >> ${gtk_win32_runtime}/LICENSE-lgpl
153 rm -fr atk-*
155 # dual LGPL and MPL (Mozilla public license)
157 #cairo-1.6.4.tar.gz
158 #cairo-1.6.4.zip
159 #cairo-dev-1.6.4.zip
161 # no copyright assigned and placed in public domain
163 # dirent.zip
165 # sort of BSD with advertising like
166 #expat-2.0.0.zip
167 echo "expat is covered by the following copyright and license" > ${gtk_win32_runtime}/LICENSE-expat
168 cat ${gtk_win32_downloads}/COPYING-expat >> ${gtk_win32_runtime}/LICENSE-expat
171 #fontconfig-2.4.2-tml-20071015.diff
172 #fontconfig-2.4.2-tml-20071015.zip
173 #fontconfig-2.4.2.tar.gz
174 #fontconfig-dev-2.4.2-tml-20071015.zip
175 tar -zxvf ${gtk_win32_downloads}/fontconfig-*.tar.gz
176 echo "fontconfig is covered by the following license" > ${gtk_win32_runtime}/LICENSE-fontconfig
177 cat fontconfig*/COPYING >> ${gtk_win32_runtime}/LICENSE-fontconfig
178 rm -fr fontconfig-*
181 # Dual, "you choose" license. We pick GPL v2.
182 #freetype-2.3.4.tar.bz2
183 #freetype-2.3.4.zip
184 #freetype-dev-2.3.4.zip
185 #bzcat ${gtk_win32_downloads}/freetype-2.3.4.tar.bz2 | tar -xvf - mv freetype-*/*/LICENSE.TXT ${gtk_win32_runtime}/LICENSE-freetype
186 #rm -fr freetype-*
189 # GPL v3
191 #gettext-0.17.tar.gz
192 #gettext-runtime-0.17.zip
193 #gettext-runtime-dev-0.17.zip
194 #gettext-tools-0.17.zip
195 tar -zxvf ${gtk_win32_downloads}/gettext-*.tar.gz
196 cat gettext-*/COPYING >> ${gtk_win32_runtime}/LICENSE-gpl3
197 rm -fr gettext-*
200 # LGPL
201 #glib-2.16.5.tar.bz2
202 #glib-2.16.5.zip
203 #glib-dev-2.16.5.zip
205 # LGPL
207 #gtk+-2.12.11.tar.bz2
208 #gtk+-2.12.11.zip
209 #gtk+-dev-2.12.11.zip
212 # jpeg license
214 #jpeg-6b-4-bin.zip
215 #jpeg-6b-4-dep.zip
216 #jpeg-6b-4-lib.zip
217 #jpegsrc.v6b.tar.gz
219 #unzip ${gtk_win32_downloads}/jpeg-*-src.zip
220 tar -zxvf ${gtk_win32_downloads}/jpegsrc.v6b.tar.gz
221 echo "libjpeg is covered by the following license:" > ${gtk_win32_runtime}/LICENSE-jpeg
222 cat jpeg-6b/README >> ${gtk_win32_runtime}/LICENSE-jpeg
223 rm -fr jpeg-6b
225 # LGPL
227 #libiconv-1.9.1.bin.woe32.zip
228 #libiconv-1.9.1.tar.gz
230 #libpng-1.2.9.tar.gz
231 #libpng-dev-1.2.9.zip
232 #libpng-1.2.9.zip
233 mkdir tmppng
234 cd tmppng
235 unzip ${gtk_win32_downloads}/libpng-dev-*.zip
237 ls include
239 echo "libpng is covered by the following copyright and license" > ${gtk_win32_runtime}/LICENSE-png
240 awk '/COPYRIGHT/,/^[ \t]*$/ {print}' include/png.h >> ${gtk_win32_runtime}/LICENSE-png
241 cd ..
242 rm -fr tmppng
244 # LGPL
246 #pango-1.20.5.tar.bz2
247 #pango-1.20.5.zip
248 #pango-dev-1.20.5.zip
251 # GPL
253 #pkg-config-0.23.tar.gz
254 #pkg-config-0.23-2.zip
255 tar -zxvf ${gtk_win32_downloads}/pkg-config-*.tar.gz
256 cat pkg-config-*/COPYING >> ${gtk_win32_runtime}/LICENSE-gpl2
257 rm -fr pkg-config-*
259 # LGPL
261 # proxy-libintl-20080728.zip
263 # BSD-like with advertising clause
265 #tiff-3.8.2.tar.gz
266 #libtiff-3.8.2.zip
267 #libtiff-dev-3.8.2.zip
268 tar -zxvf ${gtk_win32_downloads}/tiff-*.tar.gz
269 echo "libtiff is covered by the following license:" > ${gtk_win32_runtime}/LICENSE-tiff
270 cat tiff-*/COPYRIGHT >> ${gtk_win32_runtime}/LICENSE-tiff
271 rm -fr tiff-*
273 # Not needed anymore
274 #xpm-nox-4.0.3-20020617.zip
275 #xpm-nox-dev-4.0.3-20020112.zip
276 #tar -zxvf ${gtk_win32_downloads}/xpm-*.tar.gz
277 #echo "The xpm library is covered by the following license and copyright:" > ${gtk_win32_runtime}/LICENSE-xpm
278 #cat xpm-*/COPYRIGHT >> ${gtk_win32_runtime}/LICENSE-xpm
279 #rm -fr xpm-*
281 #zlib123-dll.zip
282 # the license had to be found on the zlib web site
283 echo "zlib is covered by the following license and copyright" > ${gtk_win32_runtime}/LICENSE-zlib
284 cat ${gtk_win32_downloads}/zlib_license.txt >> ${gtk_win32_runtime}/LICENSE-zlib