annotate pidgin/win32/nsis/generate_gtk_zip.sh @ 30848:77ac5f4584bd

I'm pretty sure this is a logical operation, not bitwise.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 14 Aug 2010 05:53:42 +0000
parents c940e427e486
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
1 #!/bin/bash
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
2 # Script to generate zip file for GTK+ runtime to be included in Pidgin installer
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
3
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
4 PIDGIN_BASE=$1
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
5
30427
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
6 if [ ! -e $PIDGIN_BASE/ChangeLog ]; then
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
7 echo $(basename $0) must must have the pidgin base dir specified as a parameter.
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
8 exit 1
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
9 fi
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
10
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
11 STAGE_DIR=$PIDGIN_BASE/pidgin/win32/nsis/gtk_runtime_stage
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
12 #Subdirectory of $STAGE_DIR
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
13 INSTALL_DIR=Gtk
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
14 CONTENTS_FILE=$INSTALL_DIR/CONTENTS
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
15
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
16 #This needs to be changed every time there is any sort of change.
29981
7fc10a9275ea Increase win32 GTK+ to 2.16.6. If people have issues, it can be reverted.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29932
diff changeset
17 BUNDLE_VERSION=2.16.6.0
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
18
29981
7fc10a9275ea Increase win32 GTK+ to 2.16.6. If people have issues, it can be reverted.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29932
diff changeset
19 ATK="http://ftp.acc.umu.se/pub/gnome/binaries/win32/atk/1.26/atk_1.26.0-1_win32.zip ATK 1.26.0-1"
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
20 CAIRO="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.8.10-1_win32.zip Cairo 1.8.10-1"
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
21 EXPAT="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/expat_2.0.1-1_win32.zip Expat 2.0.1-1"
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
22 FONTCONFIG="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/fontconfig_2.8.0-2_win32.zip Fontconfig 2.8.0-2"
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
23 FREETYPE="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype_2.3.11-2_win32.zip Freetype 2.3.11-2"
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
24 GETTEXT="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip Gettext 0.17-1"
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
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"
29981
7fc10a9275ea Increase win32 GTK+ to 2.16.6. If people have issues, it can be reverted.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29932
diff changeset
26 GTK="http://ftp.acc.umu.se/pub/gnome/binaries/win32/gtk+/2.16/gtk+_2.16.6-2_win32.zip GTK+ 2.16.6-2"
7fc10a9275ea Increase win32 GTK+ to 2.16.6. If people have issues, it can be reverted.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29932
diff changeset
27 LIBPNG="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.4.0-1_win32.zip libpng 1.4.0-1"
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
28 PANGO="http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.26/pango_1.26.2-1_win32.zip Pango 1.26.2-1"
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
29 ZLIB="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib-1.2.3.zip zlib 1.2.3"
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
30
29981
7fc10a9275ea Increase win32 GTK+ to 2.16.6. If people have issues, it can be reverted.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29932
diff changeset
31 ALL="ATK CAIRO EXPAT FONTCONFIG FREETYPE GETTEXT GLIB GTK LIBPNG PANGO ZLIB"
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
32
29921
1469137fb045 mkdir -p is better than checking for directory existence
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29911
diff changeset
33 mkdir -p $STAGE_DIR
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
34 cd $STAGE_DIR
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
35
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
36 rm -rf $INSTALL_DIR
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
37 mkdir $INSTALL_DIR
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
38
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
39 #new CONTENTS file
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
40 echo Bundle Version $BUNDLE_VERSION > $CONTENTS_FILE
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
41
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
42 function download_and_extract {
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
43 URL=${1%%\ *}
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
44 NAME=${1#*\ }
30427
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
45 FILE=$(basename $URL)
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
46 if [ ! -e $FILE ]; then
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
47 echo Downloading $NAME
30432
c940e427e486 Improve error handling
Daniel Atallah <daniel.atallah@gmail.com>
parents: 30427
diff changeset
48 wget $URL || return 1
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
49 fi
30427
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
50 EXTENSION=${FILE##*.}
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
51 #This is an OpenSuSE build service RPM
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
52 if [ $EXTENSION == 'rpm' ]; then
30432
c940e427e486 Improve error handling
Daniel Atallah <daniel.atallah@gmail.com>
parents: 30427
diff changeset
53 echo "Generating zip from $FILE"
30427
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
54 FILE=$(../rpm2zip.sh $FILE)
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
55 fi
30432
c940e427e486 Improve error handling
Daniel Atallah <daniel.atallah@gmail.com>
parents: 30427
diff changeset
56 unzip -q $FILE -d $INSTALL_DIR || exit 1
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
57 echo "$NAME" >> $CONTENTS_FILE
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
58 }
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
59
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
60 for VAL in $ALL
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
61 do
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
62 VAR=${!VAL}
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
63 download_and_extract "$VAR"
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
64 done
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
65
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
66 #Default GTK+ Theme to MS-Windows
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
67 echo gtk-theme-name = \"MS-Windows\" > $INSTALL_DIR/etc/gtk-2.0/gtkrc
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
68
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
69 #Blow away translations that we don't have in Pidgin
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
70 for LOCALE_DIR in $INSTALL_DIR/share/locale/*
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
71 do
30427
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
72 LOCALE=$(basename $LOCALE_DIR)
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
73 if [ ! -e $PIDGIN_BASE/po/$LOCALE.po ]; then
30427
23b3627ecec3 Add support for the binaries built by the opensuse build service to the
Daniel Atallah <daniel.atallah@gmail.com>
parents: 29981
diff changeset
74 echo Removing $LOCALE translation as it is missing from Pidgin
29911
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
75 rm -r $LOCALE_DIR
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
76 fi
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
77 done
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
78
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
79 #Generate zip file to be included in installer
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
80 zip -9 -r ../gtk-runtime-$BUNDLE_VERSION.zip Gtk
c65c406d0d8d The rest of the plumbing needed to build the GTK+ Runtime zip included in the installer
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff changeset
81
30432
c940e427e486 Improve error handling
Daniel Atallah <daniel.atallah@gmail.com>
parents: 30427
diff changeset
82 exit 0
c940e427e486 Improve error handling
Daniel Atallah <daniel.atallah@gmail.com>
parents: 30427
diff changeset
83