From owner-svn-ports-all@FreeBSD.ORG Sun Jan 19 14:28:38 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 941641F3; Sun, 19 Jan 2014 14:28:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7430B1113; Sun, 19 Jan 2014 14:28:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0JESc5d046185; Sun, 19 Jan 2014 14:28:38 GMT (envelope-from miwi@svn.freebsd.org) Received: (from miwi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0JESaAO046177; Sun, 19 Jan 2014 14:28:36 GMT (envelope-from miwi@svn.freebsd.org) Message-Id: <201401191428.s0JESaAO046177@svn.freebsd.org> From: Martin Wilke Date: Sun, 19 Jan 2014 14:28:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r340306 - in head/textproc/sdcv: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jan 2014 14:28:38 -0000 Author: miwi Date: Sun Jan 19 14:28:36 2014 New Revision: 340306 URL: http://svnweb.freebsd.org/changeset/ports/340306 QAT: https://qat.redports.org/buildarchive/r340306/ Log: - Fix build with clang PR: 185696 Submitted by: ports fury Added: head/textproc/sdcv/files/patch-src__lib__lib.cpp (contents, props changed) head/textproc/sdcv/files/patch-src__lib__mapfile.hpp (contents, props changed) head/textproc/sdcv/files/patch-src__libwrapper.cpp (contents, props changed) head/textproc/sdcv/files/patch-src__readline.cpp (contents, props changed) head/textproc/sdcv/files/patch-src__sdcv.cpp (contents, props changed) head/textproc/sdcv/files/patch-src__utils.cpp (contents, props changed) Modified: head/textproc/sdcv/Makefile head/textproc/sdcv/pkg-plist (contents, props changed) Modified: head/textproc/sdcv/Makefile ============================================================================== --- head/textproc/sdcv/Makefile Sun Jan 19 14:25:38 2014 (r340305) +++ head/textproc/sdcv/Makefile Sun Jan 19 14:28:36 2014 (r340306) @@ -10,33 +10,33 @@ MASTER_SITES= SF MAINTAINER= ports@FreeBSD.org COMMENT= Text-based utility for work with dictionaries in StarDict's format -OPTIONS_DEFINE= NLS +LICENSE= GPLv2 # (or later) USE_BZIP2= yes -GNU_CONFIGURE= yes -USE_AUTOTOOLS= libtool +USES= gettext pkgconfig readline USE_GNOME= glib20 -USES= pkgconfig iconv +USE_AUTOTOOLS= libtoolize aclocal automake autoconf +LIBTOOLIZE_ARGS=--copy --force +ACLOCAL_ARGS= --automake-acdir=${ACLOCAL_DIR} -I m4 +AUTOMAKE_ARGS= --add-missing --copy + SUB_FILES= pkg-message -NLS_USES= gettext -NLS_CPPFLAGS= -I${LOCALBASE}/include -NLS_LDFLAGS= -L${LOCALBASE}/lib -NLS_CONFIGURE_ENABLE= nls +CPPFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib post-patch: - @${REINPLACE_CMD} -e 's|/usr/share|${PREFIX}/share|g' \ - ${WRKSRC}/doc/sdcv.1 - @${REINPLACE_CMD} -e '1425 s, install-data,,' \ - ${WRKSRC}/po/Makefile.in.in - @${REINPLACE_CMD} -e 's, getopt.h,,g' ${WRKSRC}/src/Makefile.in - @${REINPLACE_CMD} -e '146 s|()|(int, char * const [], const char *)|g' \ - ${WRKSRC}/src/getopt.h - @${REINPLACE_CMD} -e '516 s|sizeof|(guint32)sizeof|g' \ - ${WRKSRC}/src/lib/lib.cpp - @${REINPLACE_CMD} -e 's|/usr/share|${PREFIX}/share|g' \ - ${WRKSRC}/src/sdcv.cpp - @${REINPLACE_CMD} -e 's,@mandir@/uk,@mandir@,' \ - ${WRKSRC}/doc/uk/Makefile.in +.for i in doc/sdcv.1 src/sdcv.cpp + @${REINPLACE_CMD} -e \ + 's|/usr/share|${PREFIX}/share|' ${WRKSRC}/${i} +.endfor + @${REINPLACE_CMD} -e \ + 's|@mandir@/uk|@mandir@|' ${WRKSRC}/doc/uk/Makefile.am + @${REINPLACE_CMD} -e \ + 's|getopt1.c getopt.h||' ${WRKSRC}/src/Makefile.am + +pre-configure: + @${RM} -f ${WRKSRC}/m4/gettext.m4 + @${RM} -f ${WRKSRC}/src/getopt.h .include Added: head/textproc/sdcv/files/patch-src__lib__lib.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/sdcv/files/patch-src__lib__lib.cpp Sun Jan 19 14:28:36 2014 (r340306) @@ -0,0 +1,27 @@ +--- src/lib/lib.cpp.orig ++++ src/lib/lib.cpp +@@ -496,9 +496,13 @@ + entries[i].keystr=p; + len=strlen(p); + p+=len+1; +- entries[i].off=g_ntohl(*reinterpret_cast(p)); ++ /* ++ * Can not use typecasting here, because *data does not have ++ * to be alligned and unalligned access fails on some architectures. ++ */ ++ entries[i].off=((unsigned char)p[0] << 24) | ((unsigned char)p[1] << 16) | ((unsigned char)p[2] << 8) | (unsigned char)p[3]; + p+=sizeof(guint32); +- entries[i].size=g_ntohl(*reinterpret_cast(p)); ++ entries[i].size=((unsigned char)p[0] << 24) | ((unsigned char)p[1] << 16) | ((unsigned char)p[2] << 8) | (unsigned char)p[3]; + p+=sizeof(guint32); + } + } +@@ -513,7 +517,7 @@ + { + fseek(idxfile, wordoffset[page_idx], SEEK_SET); + guint32 page_size=wordoffset[page_idx+1]-wordoffset[page_idx]; +- fread(wordentry_buf, std::min(sizeof(wordentry_buf), page_size), 1, idxfile); //TODO: check returned values, deal with word entry that strlen>255. ++ fread(wordentry_buf, std::min(sizeof(wordentry_buf), (size_t)page_size), 1, idxfile); //TODO: check returned values, deal with word entry that strlen>255. + return wordentry_buf; + } + Added: head/textproc/sdcv/files/patch-src__lib__mapfile.hpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/sdcv/files/patch-src__lib__mapfile.hpp Sun Jan 19 14:28:36 2014 (r340306) @@ -0,0 +1,12 @@ +--- src/lib/mapfile.hpp.orig ++++ src/lib/mapfile.hpp +@@ -5,6 +5,9 @@ + # include "config.h" + #endif + ++#include ++#include ++ + #ifdef HAVE_MMAP + # include + # include Added: head/textproc/sdcv/files/patch-src__libwrapper.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/sdcv/files/patch-src__libwrapper.cpp Sun Jan 19 14:28:36 2014 (r340306) @@ -0,0 +1,50 @@ +--- src/libwrapper.cpp.orig ++++ src/libwrapper.cpp +@@ -24,6 +24,7 @@ + + #include + #include ++#include + + #include "utils.hpp" + +@@ -117,7 +118,6 @@ + switch (*p++) { + case 'm': + case 'l': //need more work... +- case 'g': + sec_size = strlen(p); + if (sec_size) { + res+="\n"; +@@ -127,6 +127,7 @@ + } + sec_size++; + break; ++ case 'g': + case 'x': + sec_size = strlen(p); + if (sec_size) { +@@ -208,6 +209,15 @@ + + void Library::LookupData(const string &str, TSearchResultList& res_list) + { ++#if defined(_LIBCPP_VERSION) ++ std::vector > drl(ndicts()); ++ if (!Libs::LookupData(str.c_str(), &drl[0])) ++ return; ++ for (int idict=0; idict drl[ndicts()]; + if (!Libs::LookupData(str.c_str(), drl)) + return; +@@ -215,6 +225,7 @@ + for (std::vector::size_type j=0; j ++#include + #ifdef WITH_READLINE + # include + # include Added: head/textproc/sdcv/files/patch-src__sdcv.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/sdcv/files/patch-src__sdcv.cpp Sun Jan 19 14:28:36 2014 (r340306) @@ -0,0 +1,15 @@ +--- src/sdcv.cpp.orig ++++ src/sdcv.cpp +@@ -161,7 +161,11 @@ + + strlist_t dicts_dir_list; + +- dicts_dir_list.push_back(std::string(g_get_home_dir())+G_DIR_SEPARATOR+ ++ const char *homedir = g_getenv ("HOME"); ++ if (!homedir) ++ homedir = g_get_home_dir (); ++ ++ dicts_dir_list.push_back(std::string(homedir)+G_DIR_SEPARATOR+ + ".stardict"+G_DIR_SEPARATOR+"dic"); + dicts_dir_list.push_back(data_dir); + Added: head/textproc/sdcv/files/patch-src__utils.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/sdcv/files/patch-src__utils.cpp Sun Jan 19 14:28:36 2014 (r340306) @@ -0,0 +1,11 @@ +--- src/utils.cpp.orig ++++ src/utils.cpp +@@ -22,6 +22,8 @@ + # include "config.h" + #endif + ++#include ++#include + #include + #include + Modified: head/textproc/sdcv/pkg-plist ============================================================================== --- head/textproc/sdcv/pkg-plist Sun Jan 19 14:25:38 2014 (r340305) +++ head/textproc/sdcv/pkg-plist Sun Jan 19 14:28:36 2014 (r340306) @@ -1,7 +1,7 @@ bin/sdcv man/man1/sdcv.1.gz -%%NLS%%share/locale/ru/LC_MESSAGES/sdcv.mo -%%NLS%%share/locale/sk/LC_MESSAGES/sdcv.mo -%%NLS%%share/locale/uk/LC_MESSAGES/sdcv.mo -%%NLS%%share/locale/zh_CN/LC_MESSAGES/sdcv.mo -%%NLS%%share/locale/zh_TW/LC_MESSAGES/sdcv.mo +share/locale/ru/LC_MESSAGES/sdcv.mo +share/locale/sk/LC_MESSAGES/sdcv.mo +share/locale/uk/LC_MESSAGES/sdcv.mo +share/locale/zh_CN/LC_MESSAGES/sdcv.mo +share/locale/zh_TW/LC_MESSAGES/sdcv.mo