pidgin/win32/nsis/generate_gtk_zip.sh

changeset 33854
5744cfb1c3d1
parent 33742
9562462b6963
child 33857
af0723304ab3
equal deleted inserted replaced
33852:368feedc80cf 33854:5744cfb1c3d1
1 #!/bin/bash 1 #!/bin/bash
2 # Script to generate zip file for GTK+ runtime to be included in Pidgin installer 2 # Script to generate zip file for GTK+ runtime to be included in Pidgin installer
3 3
4 PIDGIN_BASE=$1 4 PIDGIN_BASE=`pwd`
5 GPG_SIGN=$2 5 PIDGIN_BASE="$PIDGIN_BASE/../../.."
6 GPG_SIGN=$1
6 7
7 if [ ! -e $PIDGIN_BASE/ChangeLog ]; then 8 if [ ! -e $PIDGIN_BASE/ChangeLog ]; then
8 echo $(basename $0) must must have the pidgin base dir specified as a parameter. 9 echo pidgin base dir not found
9 exit 1 10 exit 1
10 fi 11 fi
11 12
12 STAGE_DIR=`readlink -f $PIDGIN_BASE/pidgin/win32/nsis/gtk_runtime_stage` 13 STAGE_DIR=`readlink -f $PIDGIN_BASE/pidgin/win32/nsis/gtk_runtime_stage`
13 #Subdirectory of $STAGE_DIR 14 #Subdirectory of $STAGE_DIR
14 INSTALL_DIR=Gtk 15 INSTALL_DIR=Gtk
15 CONTENTS_FILE=$INSTALL_DIR/CONTENTS 16 CONTENTS_FILE=$INSTALL_DIR/CONTENTS
16 PIDGIN_VERSION=$( < $PIDGIN_BASE/VERSION ) 17 PIDGIN_VERSION=$( < $PIDGIN_BASE/VERSION )
17 18
18 #This needs to be changed every time there is any sort of change. 19 #This needs to be changed every time there is any sort of change.
19 BUNDLE_VERSION=2.16.6.1 20 BUNDLE_VERSION=2.24.14.0
20 BUNDLE_SHA1SUM=3e586e3f716f909ff6c11bf64c5ad23f1a0c98bf 21 BUNDLE_SHA1SUM="402c265590f304537e31a1f3b04aad32c6eea620"
21 ZIP_FILE="$PIDGIN_BASE/pidgin/win32/nsis/gtk-runtime-$BUNDLE_VERSION.zip" 22 ZIP_FILE="$PIDGIN_BASE/pidgin/win32/nsis/gtk-runtime-$BUNDLE_VERSION.zip"
22 23
23 #Download the existing file (so that we distribute the exact same file for all releases with the same bundle version) 24 #Download the existing file (so that we distribute the exact same file for all releases with the same bundle version)
24 FILE="$ZIP_FILE" 25 FILE="$ZIP_FILE"
25 if [ ! -e "$FILE" ]; then 26 if [ ! -e "$FILE" ]; then
26 wget "https://pidgin.im/win32/download_redir.php?version=$PIDGIN_VERSION&gtk_version=$BUNDLE_VERSION&dl_pkg=gtk" -O "$FILE" 27 echo "Downloading the existing file"
27 fi 28 wget -q "https://pidgin.im/win32/download_redir.php?version=$PIDGIN_VERSION&gtk_version=$BUNDLE_VERSION&dl_pkg=gtk" -O "$FILE"
28 CHECK_SHA1SUM=`sha1sum $FILE` 29 if [ `stat -c %s $FILE` == 0 ]; then
29 CHECK_SHA1SUM=${CHECK_SHA1SUM%%\ *} 30 rm $FILE
31 fi
32 fi
33 if [ -e "$FILE" ]; then
34 CHECK_SHA1SUM=`sha1sum $FILE`
35 CHECK_SHA1SUM=${CHECK_SHA1SUM%%\ *}
36 else
37 CHECK_SHA1SUM=
38 fi
30 if [ "$CHECK_SHA1SUM" != "$BUNDLE_SHA1SUM" ]; then 39 if [ "$CHECK_SHA1SUM" != "$BUNDLE_SHA1SUM" ]; then
31 echo "sha1sum ($CHECK_SHA1SUM) for $FILE doesn't match expected value of $BUNDLE_SHA1SUM" 40 if [ "x$CHECK_SHA1SUM" != "x" ]; then
41 echo "sha1sum ($CHECK_SHA1SUM) for $FILE doesn't match expected value of $BUNDLE_SHA1SUM"
42 fi
32 # Allow "devel" versions to build their own bundles if the download doesn't succeed 43 # Allow "devel" versions to build their own bundles if the download doesn't succeed
33 if [[ "$PIDGIN_VERSION" == *"devel" ]]; then 44 if [[ "$PIDGIN_VERSION" == *"devel" ]]; then
34 echo "Continuing GTK+ Bundle creation for development version of Pidgin" 45 echo "Continuing GTK+ Bundle creation for development version of Pidgin"
35 else 46 else
36 exit 1 47 exit 1
37 fi 48 fi
38 else 49 else
39 exit 0 50 exit 0
40 fi 51 fi
41 52
42 53 #DOWNLOAD_HOST="http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_12.3/noarch/"
43 ATK="http://ftp.gnome.org/pub/gnome/binaries/win32/atk/1.32/atk_1.32.0-2_win32.zip ATK 1.32.0-2 sha1sum:3c31c9d6b19af840e2bd8ccbfef4072a6548dc4e" 54 #TODO: this is just a temporary mirror - Tomek Wasilczyk's <tomkiewicz@cpw.pidgin.im> Dropbox
44 #Cairo 1.10.2 has a bug that can be seen when selecting text 55 DOWNLOAD_HOST="http://dl.dropbox.com/u/5448886/pidgin-win32/runtime-deps/"
45 #CAIRO="http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/cairo_1.10.2-2_win32.zip Cairo 1.10.2-2 sha1sum:d44cd66a9f4d7d29a8f2c28d1c1c5f9b0525ba44" 56
46 CAIRO="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.8.10-1_win32.zip Cairo 1.8.10-1 sha1sum:a08476cccd807943958610977a138c4d6097c7b8" 57 ATK="${DOWNLOAD_HOST}mingw32-atk-2.6.0-1.4.noarch.rpm ATK 2.6.0-1.4 sha1sum:d0792a3355b22cf4f0e218382dde71b1e22a2b03"
47 EXPAT="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/expat_2.1.0-1_win32.zip Expat 2.1.0-1 gpg:0x71D4DDE53F188CBE" 58 CAIRO2="${DOWNLOAD_HOST}mingw32-libcairo2-1.10.2-8.4.noarch.rpm Cairo 1.10.2-8.4 sha1sum:f69af74753c7fcd95b7778eee7c3d731d64749ba"
48 FONTCONFIG="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/fontconfig_2.8.0-2_win32.zip Fontconfig 2.8.0-2 sha1sum:37a3117ea6cc50c8a88fba9b6018f35a04fa71ce" 59 DBUS="${DOWNLOAD_HOST}mingw32-dbus-1-1.4.16-1.4.noarch.rpm D-Bus 1.4.16-1.4 sha1sum:f623a75dedc9646246582f5c62310627b323b30b"
49 FREETYPE="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype_2.4.10-1_win32.zip Freetype 2.4.10-1 gpg:0x71D4DDE53F188CBE" 60 DBUS_GLIB="${DOWNLOAD_HOST}mingw32-dbus-1-glib-0.92-3.4.noarch.rpm dbus-glib 0.92-3.4 sha1sum:3af1dd35cbe2cdf62ee5144862934f5f8dd5e20d"
50 GETTEXT="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip Gettext 0.18.1.1-2 sha1sum:a7cc1ce2b99b408d1bbea9a3b4520fcaf26783b3" 61 ENCHANT="${DOWNLOAD_HOST}mingw32-enchant-1.6.0-3.7.noarch.rpm Enchant 1.6.0-3.4 sha1sum:f7e0571ef98833b087be6c9d71008b3c4c4435d6"
51 GLIB="http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip Glib 2.28.8-1 sha1sum:5d158f4c77ca0b5508e1042955be573dd940b574" 62 FONTCONFIG="${DOWNLOAD_HOST}mingw32-fontconfig-2.10.1-1.4.noarch.rpm fontconfig 2.10.1-1.4 sha1sum:64fa2a6f8576209dd2253fe52dc59ef8ac92ba6f"
52 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 sha1sum:012853e6de814ebda0cc4459f9eed8ae680e6d17" 63 FREETYPE="${DOWNLOAD_HOST}mingw32-freetype-2.4.10-1.4.noarch.rpm freetype 2.4.10-1.4 sha1sum:62a8a494df380c982d6d131ffa0846b498f3d7d0"
53 LIBPNG="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.4.12-1_win32.zip libpng 1.4.12-1 gpg:0x71D4DDE53F188CBE" 64 GDK_PIXBUF="${DOWNLOAD_HOST}mingw32-gdk-pixbuf-2.26.3-1.4.noarch.rpm gdk-pixbuf 2.26.3-1.4 sha1sum:e454ffc771d923a443553599c1981a3cc9e56bab"
54 PANGO="http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.29/pango_1.29.4-1_win32.zip Pango 1.29.4-1 sha1sum:3959319bd04fbce513458857f334ada279b8cdd4" 65 GEOCLUE="${DOWNLOAD_HOST}mingw32-libgeoclue-0.12.99-1.4.noarch.rpm Geoclue 0.12.99-1.4 sha1sum:cf3df30e75c5b38fbe2f63689cadcc2930823b9c"
55 ZLIB="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib_1.2.5-2_win32.zip zlib 1.2.5-2 sha1sum:568907188761df2d9309196e447d91bbc5555d2b" 66 GLIB="${DOWNLOAD_HOST}mingw32-glib2-2.34.1-1.4.noarch.rpm Glib 2.34.1-1.4 sha1sum:34317487546e5ca5d493c38794c927ff94b6a5b7"
56 67 GST="${DOWNLOAD_HOST}mingw32-libgstreamer-0.10.35-1.4.noarch.rpm GStreamer 0.10.35-1.4 sha1sum:fd5bb6f8a9083eb3ca402670e7c38474f7270efe"
57 ALL="ATK CAIRO EXPAT FONTCONFIG FREETYPE GETTEXT GLIB GTK LIBPNG PANGO ZLIB" 68 GST_INT="${DOWNLOAD_HOST}mingw32-libgstinterfaces-0.10.32-5.4.noarch.rpm GStreamer-interfaces 0.10.32-5.4 sha1sum:cec1dd36bbcc10716e9f8776e4bd53fb0b07d8bb"
69 GTK2="${DOWNLOAD_HOST}mingw32-gtk2-2.24.14-1.4.noarch.rpm GTK+ 2.24.14-1.4 sha1sum:71971fe63d355aa893536b691f249ace78d89a2b"
70 LIBFFI="${DOWNLOAD_HOST}mingw32-libffi-3.0.10-2.4.noarch.rpm libffi 3.0.10-2.4 sha1sum:871f13d5f02c03d62b882cc1fa4c98dcff76d4c5"
71 LIBGCC="${DOWNLOAD_HOST}mingw32-libgcc-4.7.2-2.4.noarch.rpm libgcc 4.7.2-2.4 sha1sum:9023897a5faf380efc89699ac5145c985d03a8bf"
72 LIBJASPER="${DOWNLOAD_HOST}mingw32-libjasper-1.900.1-6.4.noarch.rpm JasPer 1.900.1-6.4 sha1sum:25e01ed277b8dda6191afb7dd0e0928558c1f2d6"
73 LIBICU="${DOWNLOAD_HOST}mingw32-libicu-51.1-2.1.noarch.rpm ICU 51.1-2.1 sha1sum:97ec8264e38abceeadda4631730bb0b5f3f3ebfe"
74 LIBINTL="${DOWNLOAD_HOST}mingw32-libintl-0.18.1.1-13.4.noarch.rpm libintl 0.18.1.1-13.4 sha1sum:043c3b8eb9c872681faed5ec5263456a24bf29e4"
75 LIBJPEG="${DOWNLOAD_HOST}mingw32-libjpeg-8d-3.4.noarch.rpm libjpeg 8d-3.4 sha1sum:5d1db1eaabc6ababbed648408adbbe6eee0292fc"
76 LIBJSON="${DOWNLOAD_HOST}mingw32-libjson-glib-0.14.2-1.4.noarch.rpm json-glib 0.14.2-1.4 sha1sum:698194c97baf732bd6b109778f2834d71eedc524"
77 LIBLZMA="${DOWNLOAD_HOST}mingw32-liblzma-5.0.4-1.4.noarch.rpm liblzma 5.0.4-1.4 sha1sum:ef360fab4b6c77d1618891ccc8f52c2421f37c09"
78 LIBPNG="${DOWNLOAD_HOST}mingw32-libpng-1.5.11-1.4.noarch.rpm libpng 1.5.11-1.4 sha1sum:99d0a077f70e83f7df10f28915a2137a0ff34462"
79 LIBSOUP="${DOWNLOAD_HOST}mingw32-libsoup-2.40.3-1.4.noarch.rpm libsoup 2.40.3-1.4 sha1sum:3f2d836acea04741508a341b2bddaa55fd49f720"
80 LIBSTDCPP="${DOWNLOAD_HOST}mingw32-libstdc++-4.7.2-2.4.noarch.rpm libstdc++ 4.7.2-2.4 sha1sum:e031fad6b7bf54c9846d5a857bb8de6faefdcd1b"
81 LIBTIFF="${DOWNLOAD_HOST}mingw32-libtiff-4.0.2-1.4.noarch.rpm libtiff 4.0.2-1.4 sha1sum:9a8f8b018e8bafd47067fe6fd0debc1e887239b1"
82 LIBXSLT="${DOWNLOAD_HOST}mingw32-libxslt-1.1.27-1.4.noarch.rpm libxslt 1.1.27-1.4 sha1sum:4a08612ad73235b0fab95e17644d72e8f24097c3"
83 PANGO="${DOWNLOAD_HOST}mingw32-pango-1.30.1-1.4.noarch.rpm Pango 1.30.1-1.4 sha1sum:69c4515babdf99b0ded04c24dc3a7f33debac934"
84 PIXMAN="${DOWNLOAD_HOST}mingw32-pixman-0.26.0-1.4.noarch.rpm pixman 0.26.0-1.4 sha1sum:f751fe428ea83996daf7e57bff6f4f79361b0d29"
85 PTHREADS="${DOWNLOAD_HOST}mingw32-pthreads-2.8.0-14.6.noarch.rpm pthreads 2.8.0-14.6 sha1sum:e948ae221f82bbcb4fbfd991638e4170c150fe9f"
86 SQLITE="${DOWNLOAD_HOST}mingw32-libsqlite-3.7.6.2-1.6.noarch.rpm SQLite 3.7.6.2-1.6 sha1sum:f61529bc0c996d9af28a94648ce6102d579ed928"
87 WEBKITGTK="${DOWNLOAD_HOST}mingw32-libwebkitgtk-1.10.2-1.3.noarch.rpm WebKitGTK+ 1.10.2-1.3 sha1sum:33b558d2110fc2caf2c3c0ab24a6c18645814893"
88 ZLIB="${DOWNLOAD_HOST}mingw32-zlib-1.2.7-1.4.noarch.rpm zlib 1.2.7-1.4 sha1sum:83e91f3b4d14e47131ca33fc69e12b82aabdd589"
89 ALL="ATK CAIRO2 DBUS DBUS_GLIB ENCHANT FONTCONFIG FREETYPE GDK_PIXBUF GEOCLUE GLIB GST GST_INT GTK2 LIBFFI LIBGCC LIBJASPER LIBICU LIBINTL LIBJPEG LIBJSON LIBLZMA LIBPNG LIBSOUP LIBSTDCPP LIBTIFF LIBXSLT PANGO PIXMAN PTHREADS SQLITE WEBKITGTK ZLIB"
58 90
59 mkdir -p $STAGE_DIR 91 mkdir -p $STAGE_DIR
60 cd $STAGE_DIR 92 cd $STAGE_DIR
61 93
62 rm -rf $INSTALL_DIR 94 rm -rf $INSTALL_DIR
63 mkdir $INSTALL_DIR 95 mkdir $INSTALL_DIR
64 96
65 #new CONTENTS file 97 #new CONTENTS file
66 echo Bundle Version $BUNDLE_VERSION > $CONTENTS_FILE 98 echo Bundle Version $BUNDLE_VERSION > $CONTENTS_FILE
99
100 #TODO: temporary mirror also
101 CPIO_URL="http://dl.dropbox.com/u/5448886/pidgin-win32/cpio/bsdcpio-3.0.3-1.4.zip"
102 CPIO_SHA1SUM="0cb99adb2c2d759c9a21228223e55c8bf227f736"
103 CPIO_DIR="bsdcpio"
104 FILE="bsdcpio.zip"
105 if [ ! -e "$FILE" ]; then
106 echo "Downloading bsdcpio"
107 wget -q "$CPIO_URL" -O "$FILE" || exit 1
108 fi
109 CHECK_SHA1SUM=`sha1sum $FILE`
110 CHECK_SHA1SUM=${CHECK_SHA1SUM%%\ *}
111 if [ "$CHECK_SHA1SUM" != "$CPIO_SHA1SUM" ]; then
112 echo "sha1sum ($CHECK_SHA1SUM) for $FILE doesn't match expected value of $CPIO_SHA1SUM"
113 rm $FILE
114 exit 1
115 fi
116 rm -rf $CPIO_DIR
117 unzip -q $FILE -d . || exit 1
67 118
68 function download_and_extract { 119 function download_and_extract {
69 URL=${1%%\ *} 120 URL=${1%%\ *}
70 VALIDATION=${1##*\ } 121 VALIDATION=${1##*\ }
71 NAME=${1%\ *} 122 NAME=${1%\ *}
72 NAME=${NAME#*\ } 123 NAME=${NAME#*\ }
73 FILE=$(basename $URL) 124 FILE=$(basename $URL)
125 MINGW_DIR="usr/i686-w64-mingw32/sys-root/mingw"
126 MINGW_DIR_TOP="usr"
74 if [ ! -e $FILE ]; then 127 if [ ! -e $FILE ]; then
75 echo Downloading $NAME 128 echo Downloading $NAME
76 wget $URL || exit 1 129 wget -q $URL || exit 1
77 fi 130 fi
78 VALIDATION_TYPE=${VALIDATION%%:*} 131 VALIDATION_TYPE=${VALIDATION%%:*}
79 VALIDATION_VALUE=${VALIDATION##*:} 132 VALIDATION_VALUE=${VALIDATION##*:}
80 if [ $VALIDATION_TYPE == 'sha1sum' ]; then 133 if [ $VALIDATION_TYPE == 'sha1sum' ]; then
81 CHECK_SHA1SUM=`sha1sum $FILE` 134 CHECK_SHA1SUM=`sha1sum $FILE`
85 exit 1 138 exit 1
86 fi 139 fi
87 elif [ $VALIDATION_TYPE == 'gpg' ]; then 140 elif [ $VALIDATION_TYPE == 'gpg' ]; then
88 if [ ! -e "$FILE.asc" ]; then 141 if [ ! -e "$FILE.asc" ]; then
89 echo Downloading GPG key for $NAME 142 echo Downloading GPG key for $NAME
90 wget "$URL.asc" || exit 1 143 wget -q "$URL.asc" || exit 1
91 fi 144 fi
92 #Use our own keyring to avoid adding stuff to the main keyring 145 #Use our own keyring to avoid adding stuff to the main keyring
93 #This doesn't use $GPG_SIGN because we don't this validation to be bypassed when people are skipping signing output 146 #This doesn't use $GPG_SIGN because we don't this validation to be bypassed when people are skipping signing output
94 GPG_BASE="gpg -q --keyring $STAGE_DIR/$VALIDATION_VALUE-keyring.gpg" 147 GPG_BASE="gpg -q --keyring $STAGE_DIR/$VALIDATION_VALUE-keyring.gpg"
95 if [[ ! -e $STAGE_DIR/$VALIDATION_VALUE-keyring.gpg \ 148 if [[ ! -e $STAGE_DIR/$VALIDATION_VALUE-keyring.gpg \
103 exit 1 156 exit 1
104 fi 157 fi
105 EXTENSION=${FILE##*.} 158 EXTENSION=${FILE##*.}
106 #This is an OpenSuSE build service RPM 159 #This is an OpenSuSE build service RPM
107 if [ $EXTENSION == 'rpm' ]; then 160 if [ $EXTENSION == 'rpm' ]; then
108 echo "Generating zip from $FILE" 161 rm -rf $MINGW_DIR_TOP
109 FILE=$(../rpm2zip.sh $FILE) 162 bsdcpio/bsdcpio.exe --quiet -f etc/fonts/conf.d -di < $FILE || exit 1
110 fi 163 cp -rf $MINGW_DIR/* $INSTALL_DIR
111 unzip -q $FILE -d $INSTALL_DIR || exit 1 164 rm -rf $MINGW_DIR_TOP
165 else
166 unzip -q $FILE -d $INSTALL_DIR || exit 1
167 fi
112 echo "$NAME" >> $CONTENTS_FILE 168 echo "$NAME" >> $CONTENTS_FILE
113 } 169 }
114 170
171 echo "Downloading and extracting components..."
115 for VAL in $ALL 172 for VAL in $ALL
116 do 173 do
117 VAR=${!VAL} 174 VAR=${!VAL}
118 download_and_extract "$VAR" 175 download_and_extract "$VAR"
119 done 176 done
120 177 rm -rf $CPIO_DIR
121 #Default GTK+ Theme to MS-Windows 178 echo "All components ready"
122 echo gtk-theme-name = \"MS-Windows\" > $INSTALL_DIR/etc/gtk-2.0/gtkrc 179
123 180 cp $INSTALL_DIR/bin/libintl-8.dll $INSTALL_DIR/bin/intl.dll
124 #Blow away translations that we don't have in Pidgin 181
125 for LOCALE_DIR in $INSTALL_DIR/share/locale/* 182 #Default GTK+ Theme to MS-Windows (already set)
126 do 183 #echo gtk-theme-name = \"MS-Windows\" > $INSTALL_DIR/etc/gtk-2.0/gtkrc
127 LOCALE=$(basename $LOCALE_DIR) 184
128 if [ ! -e $PIDGIN_BASE/po/$LOCALE.po ]; then 185 #Blow away translations that we don't have in Pidgin (temporarily not included)
129 echo Removing $LOCALE translation as it is missing from Pidgin 186 #for LOCALE_DIR in $INSTALL_DIR/share/locale/*
130 rm -r $LOCALE_DIR 187 #do
131 fi 188 # LOCALE=$(basename $LOCALE_DIR)
132 done 189 # if [ ! -e $PIDGIN_BASE/po/$LOCALE.po ]; then
190 # echo Removing $LOCALE translation as it is missing from Pidgin
191 # rm -r $LOCALE_DIR
192 # fi
193 #done
133 194
134 #Generate zip file to be included in installer 195 #Generate zip file to be included in installer
135 rm -f $ZIP_FILE 196 rm -f $ZIP_FILE
136 zip -9 -r $ZIP_FILE Gtk 197 zip -9 -r $ZIP_FILE Gtk
137 ($GPG_SIGN -ab $ZIP_FILE && $GPG_SIGN --verify $ZIP_FILE.asc) || exit 1 198 if [ "x$GPG_SIGN" != "x" ]; then
199 ($GPG_SIGN -ab $ZIP_FILE && $GPG_SIGN --verify $ZIP_FILE.asc) || exit 1
200 fi
138 201
139 exit 0 202 exit 0
140

mercurial