Require libSoup 2.27.90 and drop libidn

This commit is contained in:
Christian Dywan 2011-10-15 18:27:07 +02:00
parent bf8b1d9375
commit 756830f6e4
7 changed files with 3 additions and 93 deletions

2
README
View file

@ -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 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. For installation instructions read INSTALL.

View file

@ -766,10 +766,8 @@ midori_browser_privacy_preferences_cb (MidoriBrowser* browser,
katze_preferences_add_widget (preferences, button, "indented"); katze_preferences_add_widget (preferences, button, "indented");
button = katze_property_proxy (settings, "enable-html5-local-storage", NULL); button = katze_property_proxy (settings, "enable-html5-local-storage", NULL);
katze_preferences_add_widget (preferences, button, "spanned"); katze_preferences_add_widget (preferences, button, "spanned");
#if HAVE_LIBSOUP_2_27_90
button = katze_property_proxy (settings, "strip-referer", NULL); button = katze_property_proxy (settings, "strip-referer", NULL);
katze_preferences_add_widget (preferences, button, "indented"); katze_preferences_add_widget (preferences, button, "indented");
#endif
katze_preferences_add_widget (preferences, gtk_label_new (NULL), "indented"); katze_preferences_add_widget (preferences, gtk_label_new (NULL), "indented");
button = katze_property_label (settings, "maximum-history-age"); button = katze_property_label (settings, "maximum-history-age");
katze_preferences_add_widget (preferences, button, "indented"); 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); soup_message_headers_append (msg->request_headers, "Accept-Language", accpt);
g_free (accpt); g_free (accpt);
#if HAVE_LIBSOUP_2_27_90
if (katze_object_get_boolean (settings, "strip-referer")) if (katze_object_get_boolean (settings, "strip-referer"))
{ {
const gchar* referer const gchar* referer
@ -971,7 +968,6 @@ midori_soup_session_settings_accept_language_cb (SoupSession* session,
g_free (stripped_referer); g_free (stripped_referer);
} }
} }
#endif
} }
static void static void

View file

@ -3910,10 +3910,6 @@ midori_view_set_uri (MidoriView* view,
#endif #endif
katze_assign (view->uri, g_strdup (uri)); 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 #ifdef G_ENABLE_DEBUG
#define DEBUGGING " (Debug)" #define DEBUGGING " (Debug)"
#else #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>Glib</td><td>%d.%d.%d (%d.%d.%d)</td></tr>"
"<tr><td>libsoup</td><td>%s</td></tr>" "<tr><td>libsoup</td><td>%s</td></tr>"
"<tr><td>libnotify</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>libunique</td><td>%s</td></tr>"
"<tr><td>libhildon</td><td>%s</td></tr>" "<tr><td>libhildon</td><td>%s</td></tr>"
"<tr><td>Platform</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, glib_major_version, glib_minor_version, glib_micro_version,
LIBSOUP_VERSION, LIBSOUP_VERSION,
HAVE_LIBNOTIFY ? "Yes" : "No", HAVE_LIBNOTIFY ? "Yes" : "No",
HAVE_LIBIDN ? "Yes" : "No",
HAVE_UNIQUE ? "Yes" : "No", HAVE_UNIQUE ? "Yes" : "No",
HAVE_HILDON ? "Yes" : "No", HAVE_HILDON ? "Yes" : "No",
sys_name, ident, sys_name, ident,

View file

@ -1128,10 +1128,6 @@ generate_ident_string (MidoriWebSettings* web_settings,
const gchar* lang = pango_language_to_string (gtk_get_default_language ()); 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_major = WEBKIT_USER_AGENT_MAJOR_VERSION;
const int webcore_minor = WEBKIT_USER_AGENT_MINOR_VERSION; const int webcore_minor = WEBKIT_USER_AGENT_MINOR_VERSION;

View file

@ -35,12 +35,6 @@
#include <glib/gprintf.h> #include <glib/gprintf.h>
#include <glib/gstdio.h> #include <glib/gstdio.h>
#if HAVE_LIBIDN
#include <stringprep.h>
#include <punycode.h>
#include <idna.h>
#endif
#ifdef HAVE_HILDON_FM #ifdef HAVE_HILDON_FM
#include <hildon/hildon-file-chooser-dialog.h> #include <hildon/hildon-file-chooser-dialog.h>
#endif #endif
@ -656,30 +650,12 @@ sokoke_hostname_from_uri (const gchar* uri,
* *
* The specified hostname is encoded if it is not ASCII. * 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 * Return value: a newly allocated hostname
**/ **/
static gchar* static gchar*
sokoke_hostname_to_ascii (const gchar* hostname) sokoke_hostname_to_ascii (const gchar* hostname)
{ {
#ifdef HAVE_LIBSOUP_2_27_90
return g_hostname_to_ascii (hostname); 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* static gchar*
sokoke_idn_to_punycode (gchar* uri) sokoke_idn_to_punycode (gchar* uri)
{ {
#if HAVE_LIBIDN
gchar* result = sokoke_uri_to_ascii (uri);
g_free (uri);
return result;
#else
return uri; return uri;
#endif
} }
/** /**
@ -956,7 +926,6 @@ sokoke_format_uri_for_display (const gchar* uri)
if (uri && g_str_has_prefix (uri, "http://")) if (uri && g_str_has_prefix (uri, "http://"))
{ {
gchar* unescaped = sokoke_uri_unescape_string (uri); gchar* unescaped = sokoke_uri_unescape_string (uri);
#ifdef HAVE_LIBSOUP_2_27_90
gchar* path = NULL; gchar* path = NULL;
gchar* hostname; gchar* hostname;
gchar* decoded; gchar* decoded;
@ -982,24 +951,6 @@ sokoke_format_uri_for_display (const gchar* uri)
} }
g_free (hostname); g_free (hostname);
return unescaped; 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); return g_strdup (uri);
} }

View file

@ -121,19 +121,11 @@ magic_uri_idn (void)
} URIItem; } URIItem;
static const URIItem items[] = { 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.münchhausen.at", "http://www.xn--mnchhausen-9db.at" },
{ "http://www.خداوند.com/", "http://www.xn--mgbndb8il.com/" }, { "http://www.خداوند.com/", "http://www.xn--mgbndb8il.com/" },
{ "айкидо.com", "xn--80aildf0a.com" }, { "айкидо.com", "xn--80aildf0a.com" },
{ "http://東京理科大学.jp", "http://xn--1lq68wkwbj6ugkpigi.jp" }, { "http://東京理科大学.jp", "http://xn--1lq68wkwbj6ugkpigi.jp" },
{ "https://青のネコ", "https://xn--u9jthzcs263c" }, { "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 }, { "http://en.wikipedia.org/wiki/Kölsch_language", NULL },
{ "file:///home/mark/frühstück", NULL }, { "file:///home/mark/frühstück", NULL },
{ "about:version", NULL }, { "about:version", NULL },
@ -148,11 +140,7 @@ magic_uri_idn (void)
g_free (result); g_free (result);
} }
#if HAVE_LIBIDN
test_input ("айкидо.com", "http://xn--80aildf0a.com");
#else
test_input ("айкидо.com", "http://айкидо.com"); test_input ("айкидо.com", "http://айкидо.com");
#endif
test_input ("sm Küchenzubehör", SM "Küchenzubehör"); test_input ("sm Küchenzubehör", SM "Küchenzubehör");
test_input ("sm 東京理科大学", SM "東京理科大学"); test_input ("sm 東京理科大学", SM "東京理科大学");
} }

19
wscript
View file

@ -210,28 +210,15 @@ def configure (conf):
webkit_version = conf.check_cfg (modversion='webkit-1.0').split ('.') 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: 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 ('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) 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.3', False, var='LIBSOUP_2_29_3')
check_pkg ('libsoup-2.4', '2.29.91', False, var='LIBSOUP_2_29_91') 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')) conf.define ('LIBSOUP_VERSION', conf.check_cfg (modversion='libsoup-2.4'))
check_pkg ('libxml-2.0', '2.6') check_pkg ('libxml-2.0', '2.6')
check_pkg ('sqlite3', '3.0', True, var='SQLITE') 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 option_enabled ('hildon'):
if check_pkg ('hildon-1', mandatory=False, var='HILDON'): if check_pkg ('hildon-1', mandatory=False, var='HILDON'):
check_pkg ('libosso', var='HILDON') check_pkg ('libosso', var='HILDON')
@ -322,7 +309,6 @@ def configure (conf):
Icon optimizations: %(icons)s (rsvg-convert) Icon optimizations: %(icons)s (rsvg-convert)
Notifications: %(libnotify)s (libnotify) Notifications: %(libnotify)s (libnotify)
IDN support: %(idn)s (libidn or libsoup 2.27.90)
API documentation: %(api_docs)s (gtk-doc) API documentation: %(api_docs)s (gtk-doc)
''' % locals ()) ''' % locals ())
if unique == 'yes' and conf.check_cfg (modversion='unique-1.0') == '1.0.4': 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', '') group = opt.add_option_group ('Optional features', '')
add_enable_option ('unique', 'single instance support', group) 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 ('libnotify', 'notification support', group)
add_enable_option ('addons', 'building of extensions', group) add_enable_option ('addons', 'building of extensions', group)
add_enable_option ('tests', 'building of tests', group, disable=True) add_enable_option ('tests', 'building of tests', group, disable=True)