comparison pidgin/win32/nsis/generate_gtk_zip.sh @ 29911:c65c406d0d8d

The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 01 Mar 2010 14:41:17 +0000
parents
children 1469137fb045
comparison
equal deleted inserted replaced
29910:4dc99186a03a 29911:c65c406d0d8d
1 #!/bin/bash
2 # Script to generate zip file for GTK+ runtime to be included in Pidgin installer
3
4 PIDGIN_BASE=$1
5
6 if [ ! -e $PIDGIN_BASE/ChangeLog.win32 ]; then
7 echo `basename $0` must must have the pidgin base dir specified as a parameter.
8 exit 1
9 fi
10
11 STAGE_DIR=$PIDGIN_BASE/pidgin/win32/nsis/gtk_runtime_stage
12 #Subdirectory of $STAGE_DIR
13 INSTALL_DIR=Gtk
14 CONTENTS_FILE=$INSTALL_DIR/CONTENTS
15
16 #This needs to be changed every time there is any sort of change.
17 BUNDLE_VERSION=2.14.7.0
18
19 ATK="http://ftp.gnome.org/pub/gnome/binaries/win32/atk/1.24/atk_1.24.0-1_win32.zip ATK 1.24.0-1"
20 CAIRO="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.8.10-1_win32.zip Cairo 1.8.10-1"
21 EXPAT="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/expat_2.0.1-1_win32.zip Expat 2.0.1-1"
22 FONTCONFIG="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/fontconfig_2.8.0-2_win32.zip Fontconfig 2.8.0-2"
23 FREETYPE="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype_2.3.11-2_win32.zip Freetype 2.3.11-2"
24 GETTEXT="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip Gettext 0.17-1"
25 GLIB="http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.20/glib_2.20.5-1_win32.zip Glib 2.20.5-1"
26 GTK="http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.14/gtk+_2.14.7-1_win32.zip GTK+ 2.14.7-1"
27 LIBJPEG="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/jpeg_7-1_win32.zip libjpeg 7-1"
28 #Used by GTK+
29 LIBPNG="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.2.39-1_win32.zip libpng 1.2.39-1"
30 #Used by Cairo
31 LIBPNG2="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.4.0-1_win32.zip libpng 1.4.0-1"
32 LIBTIFF="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libtiff_3.9.1-1_win32.zip libtiff 3.9.1-1"
33 #PANGO="http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.22/pango_1.22.4-1_win32.zip Pango 1.22.4-1"
34 PANGO="http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.26/pango_1.26.2-1_win32.zip Pango 1.26.2-1"
35 ZLIB="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib-1.2.3.zip zlib 1.2.3"
36
37 ALL="ATK CAIRO EXPAT FONTCONFIG FREETYPE GETTEXT GLIB GTK LIBJPEG LIBPNG LIBPNG2 LIBTIFF PANGO ZLIB"
38
39 if [ ! -e $STAGE_DIR ]; then
40 mkdir $STAGE_DIR
41 fi
42 cd $STAGE_DIR
43
44 rm -rf $INSTALL_DIR
45 mkdir $INSTALL_DIR
46
47 #new CONTENTS file
48 echo Bundle Version $BUNDLE_VERSION > $CONTENTS_FILE
49
50 function download_and_extract {
51 URL=${1%%\ *}
52 NAME=${1#*\ }
53 FILE=`basename $URL`
54 if [ ! -e $FILE ]; then
55 echo Downloading $NAME
56 wget $URL
57 fi
58 unzip -q $FILE -d $INSTALL_DIR
59 echo "$NAME" >> $CONTENTS_FILE
60 }
61
62 for VAL in $ALL
63 do
64 VAR=${!VAL}
65 download_and_extract "$VAR"
66 done
67
68 #Default GTK+ Theme to MS-Windows
69 echo gtk-theme-name = \"MS-Windows\" > $INSTALL_DIR/etc/gtk-2.0/gtkrc
70
71 #Blow away translations that we don't have in Pidgin
72 for LOCALE_DIR in $INSTALL_DIR/share/locale/*
73 do
74 LOCALE=`basename $LOCALE_DIR`
75 if [ ! -e $PIDGIN_BASE/po/$LOCALE.po ]; then
76 echo Remove $LOCALE translation as it is missing from Pidgin
77 rm -r $LOCALE_DIR
78 fi
79 done
80
81 #Generate zip file to be included in installer
82 zip -9 -r ../gtk-runtime-$BUNDLE_VERSION.zip Gtk
83