Ticket #42766: patch-0.7.3_2014.02.24.diff
File patch-0.7.3_2014.02.24.diff, 15.1 KB (added by gellule.xg@…, 11 years ago) |
---|
-
bundler/bundler.py
diff --git bundler/bundler.py bundler/bundler.py index abca042..8db5e13 100644
class Bundler: 73 73 module_version = utils.evaluate_pkgconfig_variables("${pkg:pango:pango_module_version}") 74 74 modulespath = self.project.get_bundle_path("Contents/Resources/lib/pango/" + 75 75 module_version + 76 " modules/")76 "/modules/") 77 77 78 78 from distutils.version import StrictVersion as V 79 79 import tempfile -
bundler/launcher.sh
diff --git bundler/launcher.sh bundler/launcher.sh index 7b15121..069fbda 100755
export GTK_PATH="$bundle_res" 33 33 export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc" 34 34 export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules" 35 35 export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders" 36 export PANGO_RC_FILE="$bundle_etc/pango/pangorc" 36 export PANGO_LIBDIR="$bundle_lib" 37 export PANGO_SYSCONFDIR="$bundle_etc" 37 38 38 39 # Localization settings. It's better to do this inside your program 39 40 # using NSLocale if possible. -
bundler/run-install-name-tool-change.sh
diff --git bundler/run-install-name-tool-change.sh bundler/run-install-name-tool-change.sh index 3a3b6a8..a69796a 100755
WRONG_PREFIX=$2 10 10 RIGHT_PREFIX="@executable_path/../$3" 11 11 ACTION=$4 12 12 13 chmod u+w $LIBRARY 14 13 15 if [ "x$ACTION" == "xchange" ]; then 14 16 libs="`otool -L $LIBRARY 2>/dev/null | fgrep compatibility | cut -d\( -f1 | grep $WRONG_PREFIX | sort | uniq`" 15 17 for lib in $libs; do -
examples/Info-gtk-demo.plist
diff --git examples/Info-gtk-demo.plist examples/Info-gtk-demo.plist index a47c60d..80b04f4 100644
7 7 <key>CFBundleExecutable</key> 8 8 <string>GtkDemo</string> 9 9 <key>CFBundleGetInfoString</key> 10 <string>2. 16.2, (C) 1997-2009The GTK+ Team http://www.gtk.org</string>10 <string>2.24.18, (C) 1997-2013 The GTK+ Team http://www.gtk.org</string> 11 11 <key>CFBundleIconFile</key> 12 12 <string>Giggle.icns</string> 13 13 <key>CFBundleIdentifier</key> … … 17 17 <key>CFBundlePackageType</key> 18 18 <string>APPL</string> 19 19 <key>CFBundleShortVersionString</key> 20 <string>2. 16.2</string>20 <string>2.24.18</string> 21 21 <key>CFBundleSignature</key> 22 22 <string>????</string> 23 23 <key>CFBundleVersion</key> 24 <string>2. 16.2</string>24 <string>2.24.18</string> 25 25 <key>NSHumanReadableCopyright</key> 26 <string>Copyright 1997 - 20 09 The GTK+ Tean, GNU General Public License.</string>26 <string>Copyright 1997 - 2013 The GTK+ Team, GNU General Public License.</string> 27 27 <key>LSMinimumSystemVersion</key> 28 28 <string>10.4</string> 29 29 </dict> -
examples/Info-pygtk-demo.plist
diff --git examples/Info-pygtk-demo.plist examples/Info-pygtk-demo.plist index 37876b4..55b6807 100644
7 7 <key>CFBundleExecutable</key> 8 8 <string>PyGtkDemo</string> 9 9 <key>CFBundleGetInfoString</key> 10 <string>2. 16.0, (C) 1997-2009The GTK+ Team http://www.gtk.org</string>10 <string>2.24.0, (C) 1997-2012 The GTK+ Team http://www.gtk.org</string> 11 11 <key>CFBundleIconFile</key> 12 12 <string>Giggle.icns</string> 13 13 <key>CFBundleIdentifier</key> … … 17 17 <key>CFBundlePackageType</key> 18 18 <string>APPL</string> 19 19 <key>CFBundleShortVersionString</key> 20 <string>2. 16.0</string>20 <string>2.24.0</string> 21 21 <key>CFBundleSignature</key> 22 22 <string>????</string> 23 23 <key>CFBundleVersion</key> 24 <string>2. 16.0</string>24 <string>2.24.0</string> 25 25 <key>NSHumanReadableCopyright</key> 26 <string>Copyright 1997 - 20 09 The GTK+ Tean,GNU General Public License.</string>26 <string>Copyright 1997 - 2012 The GTK+ Team GNU General Public License.</string> 27 27 <key>LSMinimumSystemVersion</key> 28 28 <string>10.5</string> 29 29 </dict> -
examples/gtk-demo.bundle
diff --git examples/gtk-demo.bundle examples/gtk-demo.bundle index 32173b9..4b32d6b 100644
69 69 <binary> 70 70 ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/*.so 71 71 </binary> 72 72 73 <binary> 73 74 ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so 74 75 </binary> 75 76 76 77 <!-- Starting with 2.24, gdk-pixbuf installs into its own directory. --> 77 78 <binary> 78 ${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/*.so 79 ${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/loaders/*.so 80 </binary> 81 82 <binary> 83 ${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/ 79 84 </binary> 80 85 81 <!-- Translation filenames, one for each program or library that you 86 <data> 87 ${prefix}/etc/pango/ 88 </data> 89 90 <!-- Translation filenames, one for each program or library that you 82 91 want to copy in to the bundle. The "dest" attribute is 83 92 optional, as usual. Bundler will find all translations of that 84 93 library/program under the indicated directory and copy them.--> -
examples/gtk3-demo.bundle
diff --git examples/gtk3-demo.bundle examples/gtk3-demo.bundle index b74f2ca..ba15cd3 100644
33 33 not needed. If the source path is left out, the default 34 34 script will be used. 35 35 --> 36 <launcher-script>${project}/ launcher.sh</launcher-script >36 <launcher-script>${project}/gtk3-launcher.sh</launcher-script > 37 37 38 38 <!-- Not implemented: Optional runtime, could be python or mono 39 39 for example. … … 52 52 53 53 <main-binary>${prefix}/bin/gtk3-demo</main-binary> 54 54 55 <!-- Copy in GTK+ modules. Note the ${gtkdir} macro, which expands 56 to the correct library subdirectory for the specified gtk 57 version. 58 --> 55 <!-- Copy in the input methods. Dunno if they actually work with 56 OSX. Note the ${gtkdir} macro, which expands to the correct 57 library subdirectory for the specified gtk version. --> 59 58 <binary> 60 ${prefix}/lib/${gtkdir}/modules/*.so59 ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so 61 60 </binary> 62 61 63 <!-- Copy in GTK+ theme engines and print backends. Note the use of the 64 "${pkg:module:variable}" macro, which evaluates to a pkg-config 65 variable in the specified module. Note that any libraries that 66 binaries link to are also copied in automatically. Note also 67 the included ${gtk} macro, which gets the correct package name 68 to get. --> 69 <binary> 70 ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/theming-engines/*.so 71 </binary> 62 <!-- And the print backends --> 72 63 <binary> 73 64 ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so 74 65 </binary> … … 78 69 ${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so 79 70 </binary> 80 71 72 <binary> 73 ${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/ 74 </binary> 75 76 <data> 77 ${prefix}/etc/pango/ 78 </data> 79 81 80 <!-- Translation filenames, one for each program or library that you 82 81 want to copy in to the bundle. The "dest" attribute is 83 82 optional, as usual. Bundler will find all translations of that -
new file examples/gtk3-launcher.sh
diff --git examples/gtk3-launcher.sh examples/gtk3-launcher.sh new file mode 100755 index 0000000..4aed833
- + 1 #!/bin/sh 2 3 if test "x$GTK_DEBUG_LAUNCHER" != x; then 4 set -x 5 fi 6 7 if test "x$GTK_DEBUG_GDB" != x; then 8 EXEC="gdb --args" 9 else 10 EXEC=exec 11 fi 12 13 name=`basename "$0"` 14 tmp="$0" 15 tmp=`dirname "$tmp"` 16 tmp=`dirname "$tmp"` 17 bundle=`dirname "$tmp"` 18 bundle_contents="$bundle"/Contents 19 bundle_res="$bundle_contents"/Resources 20 bundle_lib="$bundle_res"/lib 21 bundle_bin="$bundle_res"/bin 22 bundle_data="$bundle_res"/share 23 bundle_etc="$bundle_res"/etc 24 25 export DYLD_LIBRARY_PATH="$bundle_lib" 26 export XDG_CONFIG_DIRS="$bundle_etc"/xdg 27 export XDG_DATA_DIRS="$bundle_data" 28 export GTK_DATA_PREFIX="$bundle_res" 29 export GTK_EXE_PREFIX="$bundle_res" 30 export GTK_PATH="$bundle_res" 31 32 export GTK2_RC_FILES="$bundle_etc/gtk-3.0/gtkrc" 33 export GTK_IM_MODULE_FILE="$bundle_etc/gtk-3.0/gtk.immodules" 34 export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-3.0/gdk-pixbuf.loaders" 35 export PANGO_LIBDIR="$bundle_lib" 36 export PANGO_SYSCONFDIR="$bundle_etc" 37 38 39 APP=name 40 I18NDIR="$bundle_data/locale" 41 # Set the locale-related variables appropriately: 42 unset LANG LC_MESSAGES LC_MONETARY LC_COLLATE 43 44 # Has a language ordering been set? 45 # If so, set LC_MESSAGES and LANG accordingly; otherwise skip it. 46 # First step uses sed to clean off the quotes and commas, to change - to _, and change the names for the chinese scripts from "Hans" to CN and "Hant" to TW. 47 APPLELANGUAGES=`defaults read .GlobalPreferences AppleLanguages | sed -En -e 's/\-/_/' -e 's/Hant/TW/' -e 's/Hans/CN/' -e 's/[[:space:]]*\"?([[:alnum:]_]+)\"?,?/\1/p' ` 48 if test "$APPLELANGUAGES"; then 49 # A language ordering exists. 50 # Test, item per item, to see whether there is an corresponding locale. 51 for L in $APPLELANGUAGES; do 52 #test for exact matches: 53 if test -f "$I18NDIR/${L}/LC_MESSAGES/$APP.mo"; then 54 export LANG=$L 55 break 56 fi 57 #This is a special case, because often the original strings are in US 58 #English and there is no translation file. 59 if test "x$L" == "xen_US"; then 60 export LANG=$L 61 break 62 fi 63 #OK, now test for just the first two letters: 64 if test -f "$I18NDIR/${L:0:2}/LC_MESSAGES/$APP.mo"; then 65 export LANG=${L:0:2} 66 break 67 fi 68 #Same thing, but checking for any english variant. 69 if test "x${L:0:2}" == "xen"; then 70 export LANG=$L 71 break 72 fi; 73 done 74 fi 75 unset APPLELANGUAGES L 76 77 # If we didn't get a language from the language list, try the Collation preference, in case it's the only setting that exists. 78 APPLECOLLATION=`defaults read .GlobalPreferences AppleCollationOrder` 79 if test -z ${LANG} -a -n $APPLECOLLATION; then 80 if test -f "$I18NDIR/${APPLECOLLATION:0:2}/LC_MESSAGES/$APP.mo"; then 81 export LANG=${APPLECOLLATION:0:2} 82 fi 83 fi 84 if test ! -z $APPLECOLLATION; then 85 export LC_COLLATE=$APPLECOLLATION 86 fi 87 unset APPLECOLLATION 88 89 # Continue by attempting to find the Locale preference. 90 APPLELOCALE=`defaults read .GlobalPreferences AppleLocale` 91 92 if test -f "$I18NDIR/${APPLELOCALE:0:5}/LC_MESSAGES/$APP.mo"; then 93 if test -z $LANG; then 94 export LANG="${APPLELOCALE:0:5}" 95 fi 96 97 elif test -z $LANG -a -f "$I18NDIR/${APPLELOCALE:0:2}/LC_MESSAGES/$APP.mo"; then 98 export LANG="${APPLELOCALE:0:2}" 99 fi 100 101 #Next we need to set LC_MESSAGES. If at all possilbe, we want a full 102 #5-character locale to avoid the "Locale not supported by C library" 103 #warning from Gtk -- even though Gtk will translate with a 104 #two-character code. 105 if test -n $LANG; then 106 #If the language code matches the applelocale, then that's the message 107 #locale; otherwise, if it's longer than two characters, then it's 108 #probably a good message locale and we'll go with it. 109 if test $LANG == ${APPLELOCALE:0:5} -o $LANG != ${LANG:0:2}; then 110 export LC_MESSAGES=$LANG 111 #Next try if the Applelocale is longer than 2 chars and the language 112 #bit matches $LANG 113 elif test $LANG == ${APPLELOCALE:0:2} -a $APPLELOCALE > ${APPLELOCALE:0:2}; then 114 export LC_MESSAGES=${APPLELOCALE:0:5} 115 #Fail. Get a list of the locales in $PREFIX/share/locale that match 116 #our two letter language code and pick the first one, special casing 117 #english to set en_US 118 elif test $LANG == "en"; then 119 export LC_MESSAGES="en_US" 120 else 121 LOC=`find $PREFIX/share/locale -name $LANG???` 122 for L in $LOC; do 123 export LC_MESSAGES=$L 124 done 125 fi 126 else 127 #All efforts have failed, so default to US english 128 export LANG="en_US" 129 export LC_MESSAGES="en_US" 130 fi 131 CURRENCY=`echo $APPLELOCALE | sed -En 's/.*currency=([[:alpha:]]+).*/\1/p'` 132 if test "x$CURRENCY" != "x"; then 133 #The user has set a special currency. Gtk doesn't install LC_MONETARY files, but Apple does in /usr/share/locale, so we're going to look there for a locale to set LC_CURRENCY to. 134 if test -f /usr/local/share/$LC_MESSAGES/LC_MONETARY; then 135 if test -a `cat /usr/local/share/$LC_MESSAGES/LC_MONETARY` == $CURRENCY; then 136 export LC_MONETARY=$LC_MESSAGES 137 fi 138 fi 139 if test -z "$LC_MONETARY"; then 140 FILES=`find /usr/share/locale -name LC_MONETARY -exec grep -H $CURRENCY {} \;` 141 if test -n "$FILES"; then 142 export LC_MONETARY=`echo $FILES | sed -En 's%/usr/share/locale/([[:alpha:]_]+)/LC_MONETARY.*%\1%p'` 143 fi 144 fi 145 fi 146 #No currency value means that the AppleLocale governs: 147 if test -z "$LC_MONETARY"; then 148 LC_MONETARY=${APPLELOCALE:0:5} 149 fi 150 #For Gtk, which only looks at LC_ALL: 151 export LC_ALL=$LC_MESSAGES 152 153 unset APPLELOCALE FILES LOC 154 155 if test -f "$bundle_lib/charset.alias"; then 156 export CHARSETALIASDIR="$bundle_lib" 157 fi 158 159 # Extra arguments can be added in environment.sh. 160 EXTRA_ARGS= 161 if test -f "$bundle_res/environment.sh"; then 162 source "$bundle_res/environment.sh" 163 fi 164 165 # Strip out the argument added by the OS. 166 if /bin/expr "x$1" : '^x-psn_' > /dev/null; then 167 shift 1 168 fi 169 170 $EXEC "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS -
examples/launcher.sh
diff --git examples/launcher.sh examples/launcher.sh index d92f9e5..a1dfd1b 100755
export GTK_PATH="$bundle_res" 32 32 export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc" 33 33 export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules" 34 34 export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders" 35 export PANGO_RC_FILE="$bundle_etc/pango/pangorc" 35 export PANGO_LIBDIR="$bundle_lib" 36 export PANGO_SYSCONFDIR="$bundle_etc" 36 37 37 38 APP=name 38 39 I18NDIR="$bundle_data/locale" -
examples/pygtk-demo.bundle
diff --git examples/pygtk-demo.bundle examples/pygtk-demo.bundle index 699ff43..2025312 100644
96 96 97 97 <!-- Starting with 2.24, gdk-pixbuf installs into its own directory. --> 98 98 <binary> 99 ${prefix}/lib/gdk-pixbuf-2.0/${pkg: ${gtk}:gtk_binary_version}/*.so99 ${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so 100 100 </binary> 101 101 102 <!-- Translation filenames, one for each program or library that you 102 <binary> 103 ${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/*.so 104 </binary> 105 106 <!-- Translation filenames, one for each program or library that you 103 107 want to copy in to the bundle. The "dest" attribute is 104 108 optional, as usual. Bundler will find all translations of that 105 109 library/program under the indicated directory and copy them.--> -
examples/pygtk-demo.sh
diff --git examples/pygtk-demo.sh examples/pygtk-demo.sh index 9c8ec33..ecbf1c0 100755
export GTK_PATH="$bundle_res" 22 22 export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc" 23 23 export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules" 24 24 export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders" 25 export PANGO_RC_FILE="$bundle_etc/pango/pangorc" 25 export PANGO_LIBDIR="$bundle_lib" 26 export PANGO_SYSCONFDIR="$bundle_etc" 26 27 27 28 #Set $PYTHON to point inside the bundle 28 29 export PYTHON="$bundle_contents/MacOS/python"