From a15d4009c2d7dfb9f129cb02e38106439b095a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Forysiuk?= Date: Tue, 26 Jun 2012 18:56:06 +0200 Subject: [PATCH] makedist.midori: Handle GTK3 builds too --- win32/makedist/makedist.midori | 50 ++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/win32/makedist/makedist.midori b/win32/makedist/makedist.midori index 823f045b..f6c0d827 100755 --- a/win32/makedist/makedist.midori +++ b/win32/makedist/makedist.midori @@ -35,6 +35,7 @@ temp_dir=`mktemp -d` # check if we can use 7zip have_7zip=`which 7za` +grep -q gtk-3.0 _build/config.log && GTK3_BUILD=1 if [ "$1" != "" ]; then if [ "$1" == "debug" ]; then DEBUG_BUILD=1 @@ -136,8 +137,13 @@ grab_files etc fonts echo -n . # copy lib +if [ "$GTK3_BUILD" == "1" ]; then + grab_files lib gtk-3.0 +else + grab_files lib gtk-2.0 +fi + grab_files lib midori -grab_files lib gtk-2.0 grab_files lib/engines "*" grab_files lib gdk-pixbuf-2.0 @@ -158,7 +164,14 @@ grab_files share MS-Windows grab_files share mime grab_files share midori.mo -grab_files share webkitgtk-1.0 +if [ "$GTK3_BUILD" == "1" ]; then + grab_files share webkitgtk-3.0 + grab_files share schemas + MO_VER=30 +else + grab_files share webkitgtk-1.0 + MO_VER=20 +fi if [ "$DEBUG_BUILD" == "" ];then pushd $workdir > /dev/null @@ -174,17 +187,42 @@ find share "(" -name "midori.mo" ")" > $temp_dir/locale.list mkdir -p $workdir/share/locale/ for LOCALE in $(cat $temp_dir/locale.list); do LOCALE=$(echo $LOCALE|awk -F/ '{print $3}') - cp /usr/share/locale/$LOCALE/LC_MESSAGES/gtk20.mo $workdir/share/locale/$LOCALE/LC_MESSAGES/ + cp /usr/share/locale/$LOCALE/LC_MESSAGES/gtk$MO_VER.mo $workdir/share/locale/$LOCALE/LC_MESSAGES/ done rm $temp_dir/locale.list -# Use small icons and tango icons -gtk_etc_dir="$workdir/etc/gtk-2.0/" +# we want to override default gtk settings +if [ "$GTK3_BUILD" == "1" ]; then + gtk_etc_dir="$workdir/etc/gtk-3.0/" + gtk_rc_file="$gtk_etc_dir/settings.ini" +else + gtk_etc_dir="$workdir/etc/gtk-2.0/" + gtk_rc_file="$gtk_etc_dir/gtkrc" +fi + mkdir -p $gtk_etc_dir -cat > $gtk_etc_dir/gtkrc << _EOF +rm $gtk_rc_file + + +# Use small icons by default and Tango theme +if [ "$GTK3_BUILD" == "1" ]; then + + cat > $gtk_rc_file << _EOF +[Settings] +gtk-fallback-icon-theme = Tango +_EOF + +else + cat > $gtk_rc_file << _EOF gtk-theme-name = "MS-Windows" gtk-fallback-icon-theme = "Tango" +_EOF + +fi + +cat >> $gtk_rc_file << _EOF gtk-toolbar-style = GTK_TOOLBAR_ICONS +gtk-toolbar-icon-size = GTK_ICON_SIZE_MENU _EOF popd > /dev/null