[Xfce4-commits] <midori:master> Require libSoup 2.27.90 and drop libidn

Christian Dywan noreply at xfce.org
Mon Oct 17 02:50:03 CEST 2011


Updating branch refs/heads/master
         to 756830f6e4af8a626bbe479e3b31f1bd2cbeac3c (commit)
       from bf8b1d93755cfe82e446909e7ff10448f846c775 (commit)

commit 756830f6e4af8a626bbe479e3b31f1bd2cbeac3c
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Oct 15 18:27:07 2011 +0200

    Require libSoup 2.27.90 and drop libidn

 README                      |    2 +-
 midori/main.c               |    4 ---
 midori/midori-view.c        |    6 -----
 midori/midori-websettings.c |    4 ---
 midori/sokoke.c             |   49 -------------------------------------------
 tests/magic-uri.c           |   12 ----------
 wscript                     |   19 +---------------
 7 files changed, 3 insertions(+), 93 deletions(-)

diff --git a/README b/README
index ee55e9b..915dda7 100644
--- a/README
+++ b/README
@@ -13,7 +13,7 @@ Midori is a lightweight web browser.
 
 Requirements: GTK+ 2.10, WebkitGTK+ 1.1.17, libXML2, libsoup 2.25.2, sqlite 3.0, Vala 0.10
 
-Optional: Unique 0.9, libidn, libnotify
+Optional: Unique 0.9, libnotify
 
 For installation instructions read INSTALL.
 
diff --git a/midori/main.c b/midori/main.c
index 5d2ea92..694557c 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -766,10 +766,8 @@ midori_browser_privacy_preferences_cb (MidoriBrowser*    browser,
     katze_preferences_add_widget (preferences, button, "indented");
     button = katze_property_proxy (settings, "enable-html5-local-storage", NULL);
     katze_preferences_add_widget (preferences, button, "spanned");
-    #if HAVE_LIBSOUP_2_27_90
     button = katze_property_proxy (settings, "strip-referer", NULL);
     katze_preferences_add_widget (preferences, button, "indented");
-    #endif
     katze_preferences_add_widget (preferences, gtk_label_new (NULL), "indented");
     button = katze_property_label (settings, "maximum-history-age");
     katze_preferences_add_widget (preferences, button, "indented");
@@ -950,7 +948,6 @@ midori_soup_session_settings_accept_language_cb (SoupSession*       session,
     soup_message_headers_append (msg->request_headers, "Accept-Language", accpt);
     g_free (accpt);
 
-    #if HAVE_LIBSOUP_2_27_90
     if (katze_object_get_boolean (settings, "strip-referer"))
     {
         const gchar* referer
@@ -971,7 +968,6 @@ midori_soup_session_settings_accept_language_cb (SoupSession*       session,
             g_free (stripped_referer);
         }
     }
-    #endif
 }
 
 static void
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 60f91ff..315894b 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -3910,10 +3910,6 @@ midori_view_set_uri (MidoriView*  view,
                 #endif
 
                 katze_assign (view->uri, g_strdup (uri));
-                #ifndef WEBKIT_USER_AGENT_MAJOR_VERSION
-                    #define WEBKIT_USER_AGENT_MAJOR_VERSION 532
-                    #define WEBKIT_USER_AGENT_MINOR_VERSION 1
-                #endif
                 #ifdef G_ENABLE_DEBUG
                     #define DEBUGGING " (Debug)"
                 #else
@@ -3933,7 +3929,6 @@ midori_view_set_uri (MidoriView*  view,
                     "<tr><td>Glib</td><td>%d.%d.%d (%d.%d.%d)</td></tr>"
                     "<tr><td>libsoup</td><td>%s</td></tr>"
                     "<tr><td>libnotify</td><td>%s</td></tr>"
-                    "<tr><td>libidn</td><td>%s</td></tr>"
                     "<tr><td>libunique</td><td>%s</td></tr>"
                     "<tr><td>libhildon</td><td>%s</td></tr>"
                     "<tr><td>Platform</td><td>%s</td></tr>"
@@ -3957,7 +3952,6 @@ midori_view_set_uri (MidoriView*  view,
                     glib_major_version, glib_minor_version, glib_micro_version,
                     LIBSOUP_VERSION,
                     HAVE_LIBNOTIFY ? "Yes" : "No",
-                    HAVE_LIBIDN ? "Yes" : "No",
                     HAVE_UNIQUE ? "Yes" : "No",
                     HAVE_HILDON ? "Yes" : "No",
                     sys_name, ident,
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index ba06916..3dbb903 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -1128,10 +1128,6 @@ generate_ident_string (MidoriWebSettings* web_settings,
 
     const gchar* lang = pango_language_to_string (gtk_get_default_language ());
 
-    #ifndef WEBKIT_USER_AGENT_MAJOR_VERSION
-        #define WEBKIT_USER_AGENT_MAJOR_VERSION 532
-        #define WEBKIT_USER_AGENT_MINOR_VERSION 1
-    #endif
     const int webcore_major = WEBKIT_USER_AGENT_MAJOR_VERSION;
     const int webcore_minor = WEBKIT_USER_AGENT_MINOR_VERSION;
 
diff --git a/midori/sokoke.c b/midori/sokoke.c
index 707490a..5530354 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -35,12 +35,6 @@
 #include <glib/gprintf.h>
 #include <glib/gstdio.h>
 
-#if HAVE_LIBIDN
-    #include <stringprep.h>
-    #include <punycode.h>
-    #include <idna.h>
-#endif
-
 #ifdef HAVE_HILDON_FM
     #include <hildon/hildon-file-chooser-dialog.h>
 #endif
@@ -656,30 +650,12 @@ sokoke_hostname_from_uri (const gchar* uri,
  *
  * The specified hostname is encoded if it is not ASCII.
  *
- * If no IDN support is available at compile time,
- * the hostname will be returned unaltered.
- *
  * Return value: a newly allocated hostname
  **/
 static gchar*
 sokoke_hostname_to_ascii (const gchar* hostname)
 {
-    #ifdef HAVE_LIBSOUP_2_27_90
     return g_hostname_to_ascii (hostname);
-    #elif HAVE_LIBIDN
-    uint32_t* q;
-    char* encoded;
-    int rc;
-
-    if ((q = stringprep_utf8_to_ucs4 (hostname, -1, NULL)))
-    {
-        rc = idna_to_ascii_4z (q, &encoded, IDNA_ALLOW_UNASSIGNED);
-        free (q);
-        if (rc == IDNA_SUCCESS)
-            return encoded;
-    }
-    #endif
-    return g_strdup (hostname);
 }
 
 /**
@@ -730,13 +706,7 @@ sokoke_uri_to_ascii (const gchar* uri)
 static gchar*
 sokoke_idn_to_punycode (gchar* uri)
 {
-    #if HAVE_LIBIDN
-    gchar* result = sokoke_uri_to_ascii (uri);
-    g_free (uri);
-    return result;
-    #else
     return uri;
-    #endif
 }
 
 /**
@@ -956,7 +926,6 @@ sokoke_format_uri_for_display (const gchar* uri)
     if (uri && g_str_has_prefix (uri, "http://"))
     {
         gchar* unescaped = sokoke_uri_unescape_string (uri);
-        #ifdef HAVE_LIBSOUP_2_27_90
         gchar* path = NULL;
         gchar* hostname;
         gchar* decoded;
@@ -982,24 +951,6 @@ sokoke_format_uri_for_display (const gchar* uri)
         }
         g_free (hostname);
         return unescaped;
-        #elif HAVE_LIBIDN
-        gchar* decoded;
-
-        if (!unescaped)
-            return g_strdup (uri);
-        else if (!g_utf8_validate (unescaped, -1, NULL))
-        {
-            g_free (unescaped);
-            return g_strdup (uri);
-        }
-
-        if (!idna_to_unicode_8z8z (unescaped, &decoded, 0) == IDNA_SUCCESS)
-            return unescaped;
-        g_free (unescaped);
-        return decoded;
-        #else
-        return unescaped;
-        #endif
     }
     return g_strdup (uri);
 }
diff --git a/tests/magic-uri.c b/tests/magic-uri.c
index 5ea4acc..81ff023 100644
--- a/tests/magic-uri.c
+++ b/tests/magic-uri.c
@@ -121,19 +121,11 @@ magic_uri_idn (void)
     } URIItem;
 
     static const URIItem items[] = {
-    #if HAVE_LIBIDN || defined (HAVE_LIBSOUP_2_27_90)
      { "http://www.münchhausen.at", "http://www.xn--mnchhausen-9db.at" },
      { "http://www.خداوند.com/", "http://www.xn--mgbndb8il.com/" },
      { "айкидо.com", "xn--80aildf0a.com" },
      { "http://東京理科大学.jp", "http://xn--1lq68wkwbj6ugkpigi.jp" },
      { "https://青のネコ",  "https://xn--u9jthzcs263c" },
-    #else
-     { "http://www.münchhausen.at", NULL },
-     { "http://www.خداوند.com/", NULL },
-     { "айкидо.com", NULL },
-     { "http://東京理科大学.jp", NULL },
-     { "https://青のネコ.co.jp",  NULL },
-    #endif
     { "http://en.wikipedia.org/wiki/Kölsch_language", NULL },
     { "file:///home/mark/frühstück", NULL },
     { "about:version", NULL },
@@ -148,11 +140,7 @@ magic_uri_idn (void)
         g_free (result);
     }
 
-    #if HAVE_LIBIDN
-    test_input ("айкидо.com", "http://xn--80aildf0a.com");
-    #else
     test_input ("айкидо.com", "http://айкидо.com");
-    #endif
     test_input ("sm Küchenzubehör", SM "Küchenzubehör");
     test_input ("sm 東京理科大学", SM "東京理科大学");
 }
diff --git a/wscript b/wscript
index 1e6f4af..40b639a 100644
--- a/wscript
+++ b/wscript
@@ -210,28 +210,15 @@ def configure (conf):
     webkit_version = conf.check_cfg (modversion='webkit-1.0').split ('.')
     if int(webkit_version[0]) >= 1 and int(webkit_version[1]) >= 5 and int(webkit_version[2]) >= 1:
         check_pkg ('javascriptcoregtk-1.0', '1.1.17', args=args)
-    check_pkg ('libsoup-2.4', '2.25.2')
+    check_pkg ('libsoup-2.4', '2.27.90')
     conf.define ('HAVE_LIBSOUP_2_25_2', 1)
-    check_pkg ('libsoup-2.4', '2.27.90', False, var='LIBSOUP_2_27_90')
+    conf.define ('HAVE_LIBSOUP_2_27_90', 1)
     check_pkg ('libsoup-2.4', '2.29.3', False, var='LIBSOUP_2_29_3')
     check_pkg ('libsoup-2.4', '2.29.91', False, var='LIBSOUP_2_29_91')
     conf.define ('LIBSOUP_VERSION', conf.check_cfg (modversion='libsoup-2.4'))
     check_pkg ('libxml-2.0', '2.6')
     check_pkg ('sqlite3', '3.0', True, var='SQLITE')
 
-    if conf.env['HAVE_LIBSOUP_2_27_90']:
-       idn = 'yes'
-       conf.define ('HAVE_LIBIDN', 0)
-    else:
-        if option_enabled ('libidn'):
-            check_pkg ('libidn', '1.0', False)
-            idn = ['N/A','yes'][conf.env['HAVE_LIBIDN'] == 1]
-            if idn != 'yes':
-                option_checkfatal ('libidn', 'international domain names')
-        else:
-            idn = 'no '
-        conf.define ('HAVE_LIBIDN', [0,1][idn == 'yes'])
-
     if option_enabled ('hildon'):
         if check_pkg ('hildon-1', mandatory=False, var='HILDON'):
             check_pkg ('libosso', var='HILDON')
@@ -322,7 +309,6 @@ def configure (conf):
         Icon optimizations:  %(icons)s (rsvg-convert)
         Notifications:       %(libnotify)s (libnotify)
 
-        IDN support:         %(idn)s (libidn or libsoup 2.27.90)
         API documentation:   %(api_docs)s (gtk-doc)
         ''' % locals ())
     if unique == 'yes' and conf.check_cfg (modversion='unique-1.0') == '1.0.4':
@@ -366,7 +352,6 @@ def set_options (opt):
 
     group = opt.add_option_group ('Optional features', '')
     add_enable_option ('unique', 'single instance support', group)
-    add_enable_option ('libidn', 'international domain name support', group)
     add_enable_option ('libnotify', 'notification support', group)
     add_enable_option ('addons', 'building of extensions', group)
     add_enable_option ('tests', 'building of tests', group, disable=True)


More information about the Xfce4-commits mailing list