commit:     74adefad66457a7f7921685f58c103f49a9ac51f
Author:     Felix Janda <felix.janda <AT> posteo <DOT> de>
AuthorDate: Sat Apr 11 21:38:05 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu Apr 16 21:20:38 2015 +0000
URL:        https://gitweb.gentoo.org/proj/hardened-dev.git/commit/?id=74adefad

net-news/newsbeuter: musl iconv does not know //TRANSLIT

 .../newsbeuter/files/newsbeuter-2.8-musl.patch     | 43 ++++++++++++++++
 net-news/newsbeuter/metadata.xml                   | 12 +++++
 net-news/newsbeuter/newsbeuter-2.8-r99.ebuild      | 59 ++++++++++++++++++++++
 3 files changed, 114 insertions(+)

diff --git a/net-news/newsbeuter/files/newsbeuter-2.8-musl.patch 
b/net-news/newsbeuter/files/newsbeuter-2.8-musl.patch
new file mode 100644
index 0000000..562fba5
--- /dev/null
+++ b/net-news/newsbeuter/files/newsbeuter-2.8-musl.patch
@@ -0,0 +1,43 @@
+https://github.com/akrennmair/newsbeuter/issues/174
+
+diff -ur a/newsbeuter-2.8/src/stflpp.cpp b/newsbeuter-2.8/src/stflpp.cpp
+--- a/newsbeuter-2.8/src/stflpp.cpp    2014-01-19 01:10:41.000000000 -0200
++++ b/newsbeuter-2.8/src/stflpp.cpp    2015-04-09 23:49:37.768386550 -0200
+@@ -16,7 +16,7 @@
+  */
+ 
+ stfl::form::form(const std::string& text) : f(0) {
+-      ipool = stfl_ipool_create((std::string(nl_langinfo(CODESET)) + 
"//TRANSLIT").c_str());
++      ipool = stfl_ipool_create(nl_langinfo(CODESET));
+       if (!ipool) {
+               throw exception(errno);
+       }
+@@ -82,7 +82,7 @@
+ 
+ std::string stfl::quote(const std::string& text) {
+       scope_mutex lock(&quote_mtx);
+-      stfl_ipool * ipool = 
stfl_ipool_create((std::string(nl_langinfo(CODESET)) + "//TRANSLIT").c_str());
++      stfl_ipool * ipool = stfl_ipool_create(nl_langinfo(CODESET));
+       std::string retval = 
stfl_ipool_fromwc(ipool,stfl_quote(stfl_ipool_towc(ipool,text.c_str())));
+       stfl_ipool_destroy(ipool);
+       return retval;
+diff -ur a/newsbeuter-2.8/src/utils.cpp b/newsbeuter-2.8/src/utils.cpp
+--- a/newsbeuter-2.8/src/utils.cpp     2014-01-19 01:10:41.000000000 -0200
++++ b/newsbeuter-2.8/src/utils.cpp     2015-04-09 23:47:39.570864222 -0200
+@@ -262,7 +262,7 @@
+       if (strcasecmp(tocode.c_str(), fromcode.c_str())==0)
+               return text;
+ 
+-      iconv_t cd = ::iconv_open((tocode + "//TRANSLIT").c_str(), 
fromcode.c_str());
++      iconv_t cd = ::iconv_open(tocode.c_str(), fromcode.c_str());
+ 
+       if (cd == reinterpret_cast<iconv_t>(-1))
+               return result;
+@@ -493,7 +493,6 @@
+ 
+ std::string utils::wstr2str(const std::wstring& wstr) {
+       std::string codeset = nl_langinfo(CODESET);
+-      codeset.append("//TRANSLIT");
+       struct stfl_ipool * ipool = stfl_ipool_create(codeset.c_str());
+       std::string result = stfl_ipool_fromwc(ipool, wstr.c_str());
+       stfl_ipool_destroy(ipool);

diff --git a/net-news/newsbeuter/metadata.xml b/net-news/newsbeuter/metadata.xml
new file mode 100644
index 0000000..eb32917
--- /dev/null
+++ b/net-news/newsbeuter/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer>
+               <email>[email protected]</email>
+               <name>Tim Harder</name>
+       </maintainer>
+       <longdescription lang="en">
+               newsbeuter is an RSS feed reader for the text console. It is 
designed
+               to run Unix-like operating systems such as Linux.
+       </longdescription>
+</pkgmetadata>

diff --git a/net-news/newsbeuter/newsbeuter-2.8-r99.ebuild 
b/net-news/newsbeuter/newsbeuter-2.8-r99.ebuild
new file mode 100644
index 0000000..09c3cea
--- /dev/null
+++ b/net-news/newsbeuter/newsbeuter-2.8-r99.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-news/newsbeuter/newsbeuter-2.8.ebuild,v 
1.3 2014/03/29 06:08:40 ago Exp $
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A RSS/Atom feed reader for the text console"
+HOMEPAGE="http://www.newsbeuter.org/index.html";
+SRC_URI="http://www.${PN}.org/downloads/${P}.tar.gz";
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="test"
+
+RDEPEND=">=dev-db/sqlite-3.5:3
+       >=dev-libs/stfl-0.21
+       >=net-misc/curl-7.18.0
+       dev-libs/json-c:=
+       dev-libs/libxml2"
+
+DEPEND="${RDEPEND}
+       dev-lang/perl
+       virtual/pkgconfig
+       sys-devel/gettext
+       test? (
+               dev-libs/boost
+               sys-devel/bc
+       )"
+
+# tests require network access
+RESTRICT="test"
+
+src_prepare() {
+       sed -i 's:-ggdb::' Makefile || die
+       epatch "${FILESDIR}"/${P}-musl.patch
+}
+
+src_configure() {
+       ./config.sh || die
+}
+
+src_compile() {
+       emake CXX="$(tc-getCXX)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
+}
+
+src_test() {
+       emake test
+       # Tests fail if in ${S} rather than in ${S}/test
+       cd "${S}"/test
+       ./test || die
+}
+
+src_install() {
+       emake prefix="${D}/usr" docdir="${D}/usr/share/doc/${PF}" install
+       dodoc AUTHORS README CHANGES
+}

Reply via email to