From 530b1a4866fbac4ee19ce3125ead30d37ef3af2f Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Wed, 21 Dec 2016 23:17:55 +0100 Subject: [PATCH] elinks: add libidn2 support --- elinks/build.sh | 3 +- elinks/meta/ChangeLog | 3 + elinks/meta/pkgdef | 2 +- elinks/src/elinks-0.12pre6-libidn2.patch | 110 +++++++++++++++++++++++ 4 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 elinks/src/elinks-0.12pre6-libidn2.patch diff --git a/elinks/build.sh b/elinks/build.sh index 42c923e..e2581c3 100755 --- a/elinks/build.sh +++ b/elinks/build.sh @@ -7,11 +7,12 @@ # Check the following 4 variables before running the script topdir=elinks version=0.13-0.1.4efea7e -pkgver=1 +pkgver=2 source[0]=http://repo.or.cz/elinks.git/snapshot/4efea7e314b49df660799e71ede713dff0cd1230.tar.gz # If there are no patches, simply comment this patch[0]=elinks-socklen_t.patch patch[1]=elinks-inet_aton.patch +patch[2]=elinks-0.12pre6-libidn2.patch # Source function library . ${BUILDPKG_SCRIPTS}/buildpkg.functions diff --git a/elinks/meta/ChangeLog b/elinks/meta/ChangeLog index c982f20..c638e1c 100644 --- a/elinks/meta/ChangeLog +++ b/elinks/meta/ChangeLog @@ -1,4 +1,7 @@ CHANGELOG --------- +* Wed Dec 21 2016 Tom G. Christensen - 0.13-0.1.4efea7e-2 +- Add support for libidn2 (via patch from fedora) + * Sat Mar 05 2016 Tom G. Christensen - 0.13-0.1.4efea7e-1 - First package diff --git a/elinks/meta/pkgdef b/elinks/meta/pkgdef index 32111a1..57bf5ad 100644 --- a/elinks/meta/pkgdef +++ b/elinks/meta/pkgdef @@ -2,7 +2,7 @@ pkgname="${pkgprefix}${topdir}" name="$topdir - A text-mode Web browser" pkgcat="application" -pkgvendor="http://change.me/please" +pkgvendor="http://elinks.or.cz" pkgdesc="Elinks is a text-based Web browser" pkgver="$pkgver" files(-,root,bin) diff --git a/elinks/src/elinks-0.12pre6-libidn2.patch b/elinks/src/elinks-0.12pre6-libidn2.patch new file mode 100644 index 0000000..18e7d0d --- /dev/null +++ b/elinks/src/elinks-0.12pre6-libidn2.patch @@ -0,0 +1,110 @@ +From 496afe1f27481eb45ac14df0bfdb287b95eefbdd Mon Sep 17 00:00:00 2001 +From: Robert Scheck +Date: Fri, 30 May 2014 15:28:54 +0200 +Subject: [PATCH] Add support for GNU Libidn2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Patch by Robert Scheck for elinks >= 0.12 which replaces current +GNU Libidn support (IDNA 2003) by GNU Libidn2 support (IDNA 2008). This is e.g. allowing +the 'ß' character in domain names. See also the Red Hat Bugzilla #1098789 for some further +information: https://bugzilla.redhat.com/show_bug.cgi?id=1098789 + +Signed-off-by: Kamil Dudka +--- + Makefile.config.in | 2 +- + configure.in | 4 ++-- + src/osdep/win32/win32.c | 2 +- + src/protocol/uri.c | 18 +++++++----------- + 4 files changed, 11 insertions(+), 15 deletions(-) + +diff --git a/Makefile.config.in b/Makefile.config.in +index fe1a559..829d350 100644 +--- a/Makefile.config.in ++++ b/Makefile.config.in +@@ -130,7 +130,7 @@ CONFIG_GOPHER = @CONFIG_GOPHER@ + CONFIG_GPM = @CONFIG_GPM@ + CONFIG_GZIP = @CONFIG_GZIP@ + CONFIG_HTML_HIGHLIGHT = @CONFIG_HTML_HIGHLIGHT@ +-CONFIG_IDN = @CONFIG_IDN@ ++CONFIG_IDN2 = @CONFIG_IDN2@ + CONFIG_INTERLINK = @CONFIG_INTERLINK@ + CONFIG_IPV6 = @CONFIG_IPV6@ + CONFIG_JW = @CONFIG_JW@ +diff --git a/configure.in b/configure.in +index 3ef8603..3f74d9c 100644 +--- a/configure.in ++++ b/configure.in +@@ -473,8 +473,8 @@ EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GZIP, zlib, zlib.h, z, gzclearerr, + EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_BZIP2, bzlib, bzlib.h, bz2, BZ2_bzReadOpen, + [ --without-bzlib disable bzlib support]) + +-EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version, +- [ --without-idn disable international domain names support]) ++EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN2, idn2, idn2.h, idn2, idn2_lookup_ul, ++ [ --without-idn2 disable international domain names support]) + + if test "x${with_gc}" != xno; then + EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GC, gc, gc.h, gc, GC_init, +diff --git a/src/osdep/win32/win32.c b/src/osdep/win32/win32.c +index 66b2128..e870a6e 100644 +--- a/src/osdep/win32/win32.c ++++ b/src/osdep/win32/win32.c +@@ -48,7 +48,7 @@ init_osdep(void) + #ifdef HAVE_LOCALE_H + setlocale(LC_ALL, ""); + #endif +-#ifdef CONFIG_IDN ++#ifdef CONFIG_IDN2 + { + char buf[60]; + UINT cp = GetACP(); +diff --git a/src/protocol/uri.c b/src/protocol/uri.c +index 5e23ea2..8987567 100644 +--- a/src/protocol/uri.c ++++ b/src/protocol/uri.c +@@ -6,8 +6,8 @@ + + #include + #include +-#ifdef HAVE_IDNA_H +-#include ++#ifdef HAVE_IDN2_H ++#include + #endif + #include + #include +@@ -531,24 +531,20 @@ add_uri_to_string(struct string *string, const struct uri *uri, + * --pasky */ + if (uri->ipv6 && wants(URI_PORT)) add_char_to_string(string, '['); + #endif +-#ifdef CONFIG_IDN ++#ifdef CONFIG_IDN2 + /* Support for the GNU International Domain Name library. + * +- * http://www.gnu.org/software/libidn/manual/html_node/IDNA-Functions.html +- * +- * Now it is probably not perfect because idna_to_ascii_lz() +- * will be using a ``zero terminated input string encoded in +- * the current locale's character set''. Anyway I don't know +- * how to convert anything to UTF-8 or Unicode. --jonas */ ++ * http://www.gnu.org/software/libidn/libidn2/manual/libidn2.html ++ */ + if (wants(URI_IDN)) { + unsigned char *host = memacpy(uri->host, uri->hostlen); + + if (host) { + char *idname; +- int code = idna_to_ascii_lz(host, &idname, 0); ++ int code = idn2_lookup_ul(host, &idname, 0); + + /* FIXME: Return NULL if it coughed? --jonas */ +- if (code == IDNA_SUCCESS) { ++ if (code == IDN2_OK) { + add_to_string(string, idname); + free(idname); + add_host = 0; +-- +1.9.3 +