From owner-svn-ports-head@freebsd.org Wed Jan 16 20:36:49 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D617114947B3; Wed, 16 Jan 2019 20:36:48 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C29486451; Wed, 16 Jan 2019 20:36:48 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F4DF7710; Wed, 16 Jan 2019 20:36:48 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0GKamGG088819; Wed, 16 Jan 2019 20:36:48 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0GKal5r088815; Wed, 16 Jan 2019 20:36:47 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201901162036.x0GKal5r088815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Wed, 16 Jan 2019 20:36:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r490518 - in head/devel/boost-libs: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: in head/devel/boost-libs: . files X-SVN-Commit-Revision: 490518 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C29486451 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2019 20:36:49 -0000 Author: tijl Date: Wed Jan 16 20:36:47 2019 New Revision: 490518 URL: https://svnweb.freebsd.org/changeset/ports/490518 Log: Fix use of iconv in Boost Locale. On FreeBSD it used __ICONV_F_HIDE_INVALID which hides invalid sequences, but what Boost really wants is that iconv returns an error on invalid sequences like GNU libiconv does by default. On FreeBSD ICONV_SET_ILSEQ_INVALID can be used for this. It has to be set via iconvctl. PR: 215393 Added: head/devel/boost-libs/files/patch-libs_locale_src_encoding_iconv_codepage.ipp (contents, props changed) head/devel/boost-libs/files/patch-libs_locale_src_posix_codecvt.cpp (contents, props changed) head/devel/boost-libs/files/patch-libs_locale_src_util_iconv.hpp (contents, props changed) Modified: head/devel/boost-libs/Makefile Modified: head/devel/boost-libs/Makefile ============================================================================== --- head/devel/boost-libs/Makefile Wed Jan 16 20:17:52 2019 (r490517) +++ head/devel/boost-libs/Makefile Wed Jan 16 20:36:47 2019 (r490518) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= boost-libs -PORTREVISION= 0 +PORTREVISION= 1 COMMENT= Free portable C++ libraries (without Boost.Python) Added: head/devel/boost-libs/files/patch-libs_locale_src_encoding_iconv_codepage.ipp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/boost-libs/files/patch-libs_locale_src_encoding_iconv_codepage.ipp Wed Jan 16 20:36:47 2019 (r490518) @@ -0,0 +1,11 @@ +--- libs/locale/src/encoding/iconv_codepage.ipp.orig 2017-09-02 09:56:14 UTC ++++ libs/locale/src/encoding/iconv_codepage.ipp +@@ -43,7 +43,7 @@ class iconverter_base { (public) + bool open(char const *to,char const *from,method_type how) + { + close(); +- cvt_ = iconv_open(to,from); ++ cvt_ = call_iconv_open(to,from); + how_ = how; + return cvt_ != (iconv_t)(-1); + } Added: head/devel/boost-libs/files/patch-libs_locale_src_posix_codecvt.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/boost-libs/files/patch-libs_locale_src_posix_codecvt.cpp Wed Jan 16 20:36:47 2019 (r490518) @@ -0,0 +1,20 @@ +--- libs/locale/src/posix/codecvt.cpp.orig 2017-09-02 09:56:14 UTC ++++ libs/locale/src/posix/codecvt.cpp +@@ -38,7 +38,7 @@ namespace impl_posix { + iconv_t d = (iconv_t)(-1); + std::vector first_byte_table; + try { +- d = iconv_open(utf32_encoding(),encoding.c_str()); ++ d = call_iconv_open(utf32_encoding(),encoding.c_str()); + if(d == (iconv_t)(-1)) { + throw std::runtime_error("Unsupported encoding" + encoding); + } +@@ -186,7 +186,7 @@ namespace impl_posix { + { + if(d!=(iconv_t)(-1)) + return; +- d=iconv_open(to,from); ++ d=call_iconv_open(to,from); + } + + static char const *utf32_encoding() Added: head/devel/boost-libs/files/patch-libs_locale_src_util_iconv.hpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/boost-libs/files/patch-libs_locale_src_util_iconv.hpp Wed Jan 16 20:36:47 2019 (r490518) @@ -0,0 +1,49 @@ +--- libs/locale/src/util/iconv.hpp.orig 2017-09-02 09:56:14 UTC ++++ libs/locale/src/util/iconv.hpp +@@ -12,27 +12,7 @@ + + namespace boost { + namespace locale { +-#if defined(__ICONV_F_HIDE_INVALID) && defined(__FreeBSD__) + extern "C" { +- typedef size_t (*const_iconv_ptr_type)(iconv_t d,char const **in,size_t *insize,char **out,size_t *outsize,uint32_t,size_t *); +- typedef size_t (*nonconst_iconv_ptr_type)(iconv_t d,char **in,size_t *insize,char **out,size_t *outsize,uint32_t,size_t *); +- } +- inline size_t do_iconv(const_iconv_ptr_type ptr,iconv_t d,char **in,size_t *insize,char **out,size_t *outsize) +- { +- char const **rin = const_cast(in); +- return ptr(d,rin,insize,out,outsize,__ICONV_F_HIDE_INVALID,0); +- } +- inline size_t do_iconv(nonconst_iconv_ptr_type ptr,iconv_t d,char **in,size_t *insize,char **out,size_t *outsize) +- { +- return ptr(d,in,insize,out,outsize,__ICONV_F_HIDE_INVALID,0); +- } +- inline size_t call_iconv(iconv_t d,char **in,size_t *insize,char **out,size_t *outsize) +- { +- char const **rin = const_cast(in); +- return do_iconv(__iconv, d, in,insize,out,outsize); +- } +-#else +- extern "C" { + typedef size_t (*gnu_iconv_ptr_type)(iconv_t d,char const **in,size_t *insize,char **out,size_t *outsize); + typedef size_t (*posix_iconv_ptr_type)(iconv_t d,char **in,size_t *insize,char **out,size_t *outsize); + } +@@ -49,8 +29,17 @@ namespace boost { + { + return do_iconv( iconv, d, in,insize,out,outsize); + } ++ inline iconv_t call_iconv_open(char const *to,char const *from) ++ { ++ iconv_t d = iconv_open(to,from); ++#if defined(ICONV_SET_ILSEQ_INVALID) && defined(__FreeBSD__) ++ if(d != (iconv_t)(-1)) { ++ int ilseq_invalid = 1; ++ iconvctl(d,ICONV_SET_ILSEQ_INVALID,&ilseq_invalid); ++ } + #endif +- ++ return d; ++ } + } // locale + } // boost +