summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2008-12-16 19:39:34 +0000
committerPeter Volkov <pva@gentoo.org>2008-12-16 19:39:34 +0000
commit0714b6d7449ab0d8713f8ddfcdb57406831209cb (patch)
treef8ffc6830a6635553ce1fd721a642073f75e6f48 /app-text/sdcv
parentInitial import. (diff)
downloadhistorical-0714b6d7449ab0d8713f8ddfcdb57406831209cb.tar.gz
historical-0714b6d7449ab0d8713f8ddfcdb57406831209cb.tar.bz2
historical-0714b6d7449ab0d8713f8ddfcdb57406831209cb.zip
Initial import, bug #118359, thank Qiangning Hong and Andrew Savchenko for initial ebuild.
Package-Manager: portage-2.2_rc17/cvs/Linux 2.6.26-openvz.git-89451f9 i686
Diffstat (limited to 'app-text/sdcv')
-rw-r--r--app-text/sdcv/ChangeLog13
-rw-r--r--app-text/sdcv/Manifest8
-rw-r--r--app-text/sdcv/files/sdcv-0.4.2-crash.patch27
-rw-r--r--app-text/sdcv/files/sdcv-0.4.2-g-handling.patch21
-rw-r--r--app-text/sdcv/files/sdcv-0.4.2-missing-headers.patch42
-rw-r--r--app-text/sdcv/files/sdcv-0.4.2-respect-HOME.patch17
-rw-r--r--app-text/sdcv/metadata.xml6
-rw-r--r--app-text/sdcv/sdcv-0.4.2.ebuild46
8 files changed, 180 insertions, 0 deletions
diff --git a/app-text/sdcv/ChangeLog b/app-text/sdcv/ChangeLog
new file mode 100644
index 000000000000..363440aad0d2
--- /dev/null
+++ b/app-text/sdcv/ChangeLog
@@ -0,0 +1,13 @@
+# ChangeLog for app-text/sdcv
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/sdcv/ChangeLog,v 1.1 2008/12/16 19:39:34 pva Exp $
+
+*sdcv-0.4.2 (16 Dec 2008)
+
+ 16 Dec 2008; Peter Volkov <pva@gentoo.org> +files/sdcv-0.4.2-crash.patch,
+ +files/sdcv-0.4.2-g-handling.patch,
+ +files/sdcv-0.4.2-missing-headers.patch,
+ +files/sdcv-0.4.2-respect-HOME.patch, +metadata.xml, +sdcv-0.4.2.ebuild:
+ Initial import, bug #118359, thank Qiangning Hong and Andrew Savchenko for
+ initial ebuild.
+
diff --git a/app-text/sdcv/Manifest b/app-text/sdcv/Manifest
new file mode 100644
index 000000000000..affb1d030f1a
--- /dev/null
+++ b/app-text/sdcv/Manifest
@@ -0,0 +1,8 @@
+AUX sdcv-0.4.2-crash.patch 1110 RMD160 a991a66ba889b55ebe6dc4ab8a6ce2eece7a440c SHA1 1311649f5288d4d51275244dd74c4cc213dd95e7 SHA256 6d85fe952eeb00808cc2874b35e7840fb0aaf29179a97d9de595acf476be86db
+AUX sdcv-0.4.2-g-handling.patch 476 RMD160 0c3bb0549126ad2cd227b8fd0efd9d07d0aeb061 SHA1 c657e087cf4bf9c05a72e22d44d00e2c5fe92e3e SHA256 88d361430b7a3e065d87055171e4fb3d53b7d15cb80a7615fb882115a7dff1a5
+AUX sdcv-0.4.2-missing-headers.patch 1099 RMD160 e8c21f59eefca918e9f1ea5b16d73cb8f2bfe063 SHA1 90d1dfd9d968aa922b3dd967ab8ee2fd740359b7 SHA256 4aba6ec3857173ea2e6ba1e5295e232b9c211f5c8235af8d1bf94c7d6eababeb
+AUX sdcv-0.4.2-respect-HOME.patch 490 RMD160 70894f798d052297d147ec5199ebe4f37f84f7bc SHA1 4f04a996cd113d04874c0ea61ce6027e8c642765 SHA256 be0804f9d637ebaea5c53e35ba59d0839ee87321d077e874ad2db7200d0e08f3
+DIST sdcv-0.4.2.tar.bz2 181384 RMD160 1a28630dad2ac07860cc5bee87f23c8585c4dabe SHA1 7620bc30890997f4f35b1864d3e98dee8490ac7c SHA256 a164f079e93986814ea2d39f3a49cf9d1b71b01aad908254457fe3d0ded9deb2
+EBUILD sdcv-0.4.2.ebuild 1081 RMD160 8995f0fb0068b98d3c11d321135c17aa136de475 SHA1 2c6a0c5a762607d59f787fa55143b4e5abd9ef4f SHA256 a06dfc5f43e2b15e89ae93cf85190eccf03d0424d2bef9fc01a2a2fddacebaad
+MISC ChangeLog 551 RMD160 850dca076721ccecba687ce4efe1dd51a7e5b45d SHA1 fd594475c79dfd3fc697f116e96722fc1c8fa325 SHA256 aed438ea194b55c74dab366c49ba2b24c866e3a4f64c0f65c260423679f9f627
+MISC metadata.xml 244 RMD160 01026fef4178594fcf3639cffa115d1b19d204b2 SHA1 5870f47a2aae500c484043dff873a8a9929ffdc8 SHA256 7d8046319fc3afd0d41c490352dd5fc608f088a7f0ab51026992e0a6203fb598
diff --git a/app-text/sdcv/files/sdcv-0.4.2-crash.patch b/app-text/sdcv/files/sdcv-0.4.2-crash.patch
new file mode 100644
index 000000000000..264cffcf1fca
--- /dev/null
+++ b/app-text/sdcv/files/sdcv-0.4.2-crash.patch
@@ -0,0 +1,27 @@
+Fix unalligned access to buffer.
+
+On several architectures (arm, armel, sparc and ia64), unalligned access to
+integers is not allowed. Buffer in this function is not alligned at all and
+attempt to read integer from it causes crash of application on such
+architectures.
+
+Reported upstream at:
+https://sourceforge.net/tracker/index.php?func=detail&aid=2149388&group_id=122858&atid=694730
+--- a/src/lib/lib.cpp
++++ b/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<guint32 *>(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<guint32 *>(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);
+ }
+ }
diff --git a/app-text/sdcv/files/sdcv-0.4.2-g-handling.patch b/app-text/sdcv/files/sdcv-0.4.2-g-handling.patch
new file mode 100644
index 000000000000..72fb690358ed
--- /dev/null
+++ b/app-text/sdcv/files/sdcv-0.4.2-g-handling.patch
@@ -0,0 +1,21 @@
+https://sourceforge.net/tracker/index.php?func=detail&aid=2125962&group_id=122858&atid=694730
+
+Fixes displaying of 'g' (gtk markup) entries.
+--- a/src/libwrapper.cpp
++++ b/src/libwrapper.cpp
+@@ -118,7 +118,6 @@
+ switch (*p++) {
+ case 'm':
+ case 'l': //need more work...
+- case 'g':
+ sec_size = strlen(p);
+ if (sec_size) {
+ res+="\n";
+@@ -128,6 +127,7 @@
+ }
+ sec_size++;
+ break;
++ case 'g':
+ case 'x':
+ sec_size = strlen(p);
+ if (sec_size) {
diff --git a/app-text/sdcv/files/sdcv-0.4.2-missing-headers.patch b/app-text/sdcv/files/sdcv-0.4.2-missing-headers.patch
new file mode 100644
index 000000000000..2011e2637e1e
--- /dev/null
+++ b/app-text/sdcv/files/sdcv-0.4.2-missing-headers.patch
@@ -0,0 +1,42 @@
+Fixes compilation with recent GCC which is more strict about C++.
+--- a/src/readline.cpp
++++ b/src/readline.cpp
+@@ -23,6 +23,7 @@
+ #endif
+
+ #include <cstdio>
++#include <cstdlib>
+ #ifdef WITH_READLINE
+ # include <readline/readline.h>
+ # include <readline/history.h>
+--- a/src/libwrapper.cpp
++++ b/src/libwrapper.cpp
+@@ -24,6 +24,7 @@
+
+ #include <glib/gi18n.h>
+ #include <map>
++#include <cstring>
+
+ #include "utils.hpp"
+
+--- a/src/utils.cpp
++++ b/src/utils.cpp
+@@ -22,6 +22,7 @@
+ # include "config.h"
+ #endif
+
++#include <cstdlib>
+ #include <glib.h>
+ #include <glib/gi18n.h>
+
+--- a/src/lib/lib.cpp
++++ b/src/lib/lib.cpp
+@@ -513,7 +513,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;
+ }
+
diff --git a/app-text/sdcv/files/sdcv-0.4.2-respect-HOME.patch b/app-text/sdcv/files/sdcv-0.4.2-respect-HOME.patch
new file mode 100644
index 000000000000..5b616500c6ce
--- /dev/null
+++ b/app-text/sdcv/files/sdcv-0.4.2-respect-HOME.patch
@@ -0,0 +1,17 @@
+=== modified file 'src/sdcv.cpp'
+--- src/sdcv.cpp 2008-11-18 12:43:28 +0000
++++ src/sdcv.cpp 2008-11-18 12:43:41 +0000
+@@ -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);
+
+
diff --git a/app-text/sdcv/metadata.xml b/app-text/sdcv/metadata.xml
new file mode 100644
index 000000000000..683f78428a60
--- /dev/null
+++ b/app-text/sdcv/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>app-dicts</herd>
+ <longdescription>sdcv - console version of StarDict program.</longdescription>
+</pkgmetadata>
diff --git a/app-text/sdcv/sdcv-0.4.2.ebuild b/app-text/sdcv/sdcv-0.4.2.ebuild
new file mode 100644
index 000000000000..a7b08400e0b6
--- /dev/null
+++ b/app-text/sdcv/sdcv-0.4.2.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/sdcv/sdcv-0.4.2.ebuild,v 1.1 2008/12/16 19:39:34 pva Exp $
+
+inherit eutils
+
+DESCRIPTION="Console version of Stardict program"
+HOMEPAGE="http://sdcv.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="nls test"
+
+RDEPEND="sys-libs/zlib
+ sys-libs/readline
+ >=dev-libs/glib-2.6.1"
+DEPEND="${RDEPEND}
+ test? ( app-dicts/stardict-quick-ru-en )
+ nls? ( >=sys-devel/gettext-0.14.1 )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${P}-missing-headers.patch"
+ epatch "${FILESDIR}/${P}-crash.patch"
+ epatch "${FILESDIR}/${P}-g-handling.patch"
+ epatch "${FILESDIR}/${P}-respect-HOME.patch"
+}
+
+src_compile() {
+ econf $(use_enable nls)
+ emake || die "emake failed"
+}
+
+src_test() {
+ export HOME=${T}
+ mkdir -p "${HOME}/.stardict/dic"
+ emake check || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS BUGS ChangeLog NEWS README TODO
+}