ports/51185: New port: chinese/stardict2

Statue statue at freebsd.sinica.edu.tw
Sun Apr 20 14:20:12 UTC 2003


>Number:         51185
>Category:       ports
>Synopsis:       New port: chinese/stardict2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 20 07:20:10 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Statue
>Release:        FreeBSD 4.7-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD freebsd.sinica.edu.tw 4.7-PRERELEASE FreeBSD 4.7-PRERELEASE #2: Mon Sep 9 10:45:46 CST 2002 ycheng at freebsd.sinica.edu.tw:/usr/src/sys/compile/GENERIC i386


	
>Description:

StarDict is a international dictionary that run in Gnome envornment.
It have powerful features such as "Glob-style pattern matching",
"Scan seletion word","Fuzzy search" and etc.

WWW: http://reciteword.cosoft.org.cn/yaoguang/
	
>How-To-Repeat:
	
>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	stardict2/
#	stardict2/Makefile
#	stardict2/distinfo
#	stardict2/files
#	stardict2/pkg-descr
#	stardict2/pkg-plist
#	stardict2/files/patch-configure
#	stardict2/files/patch-src::tools::olddic2newdic.c
#
echo c - stardict2/
mkdir -p stardict2/ > /dev/null 2>&1
echo x - stardict2/Makefile
sed 's/^X//' >stardict2/Makefile << 'END-of-stardict2/Makefile'
X# Ports collection makefile for:	stardict2
X# Date created:			13 April 2003
X# Whom:				Shen Chuan-Hsing <statue at freebsd.sinica.edu.tw>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	stardict2
XPORTVERSION=	2.0.0
XCATEGORIES=	chinese
XMASTER_SITES=	http://reciteword.cosoft.org.cn/yaoguang/myapps/ \
X		ftp://freebsd.sinica.edu.tw/pub/statue/stardict2/
XDISTNAME=	stardict-${PORTVERSION}-pre2
X
XMAINTAINER=	statue at freebsd.sinica.edu.tw
XCOMMENT=	English-Chinese dictionary
X
XLIB_DEPENDS=	gnome-2.200:${PORTSDIR}/x11/libgnome \
X		gnomeui-2.200:${PORTSDIR}/x11-toolkits/libgnomeui \
X		bonobo-2.0:${PORTSDIR}/devel/libbonobo \
X		bonobo-activation.4:${PORTSDIR}/devel/bonobo-activation
X
XGNU_CONFIGURE=	yes
XUSE_GMAKE=	yes
XUSE_X_PREFIX=	yes
XWRKSRC=		${WRKDIR}/stardict-${PORTVERSION}
X
XMAN1=		stardict.1
X
X.include <bsd.port.mk>
END-of-stardict2/Makefile
echo x - stardict2/distinfo
sed 's/^X//' >stardict2/distinfo << 'END-of-stardict2/distinfo'
XMD5 (stardict-2.0.0-pre2.tar.gz) = d82c3cb859865db3c8135690aeed3759
END-of-stardict2/distinfo
echo c - stardict2/files
mkdir -p stardict2/files > /dev/null 2>&1
echo x - stardict2/pkg-descr
sed 's/^X//' >stardict2/pkg-descr << 'END-of-stardict2/pkg-descr'
XStarDict is a international dictionary that run in Gnome envornment.
XIt have powerful features such as "Glob-style pattern matching",
X"Scan seletion word","Fuzzy search" and etc.
X
XWWW: http://reciteword.cosoft.org.cn/yaoguang/
END-of-stardict2/pkg-descr
echo x - stardict2/pkg-plist
sed 's/^X//' >stardict2/pkg-plist << 'END-of-stardict2/pkg-plist'
Xbin/stardict
Xshare/pixmaps/stardict.png
Xshare/stardict/dic/cdict.dict
Xshare/stardict/dic/cdict.idx.gz
Xshare/stardict/dic/cedictgb.dict
Xshare/stardict/dic/cedictgb.idx.gz
Xshare/stardict/dic/stardict.dict
Xshare/stardict/dic/stardict.idx.gz
Xshare/stardict/dic/xdict.dict
Xshare/stardict/dic/xdict.idx.gz
Xshare/stardict/dic/xdict_ce.dict
Xshare/stardict/dic/xdict_ce.idx.gz
Xshare/stardict/skins/default/phonetic.png
Xshare/stardict/skins/default/skin.inf
Xshare/gnome/help/stardict/C/legal.xml
Xshare/gnome/help/stardict/C/stardict.xml
Xshare/gnome/help/stardict/C/figures/stardict_applet.png
Xshare/gnome/help/stardict/C/figures/stardict_window.png
Xshare/gnome/help/stardict/zh_CN/legal.xml
Xshare/gnome/help/stardict/zh_CN/stardict.xml
Xshare/gnome/help/stardict/zh_CN/figures/stardict_applet.png
Xshare/gnome/help/stardict/zh_CN/figures/stardict_window.png
Xshare/omf/stardict/stardict-C.omf
Xshare/omf/stardict/stardict-zh_CN.omf
Xshare/applications/stardict.desktop
Xetc/gconf/schemas/stardict.schemas
Xlib/bonobo/servers/GNOME_Stardict.server
Xetc/gconf/gconf.xml.defaults/apps/stardict/%gconf.xml
Xetc/gconf/gconf.xml.defaults/apps/stardict/float_window/%gconf.xml
Xetc/gconf/gconf.xml.defaults/schemas/apps/stardict/%gconf.xml
Xetc/gconf/gconf.xml.defaults/schemas/apps/stardict/float_window/%gconf.xml
X at dirrm share/gnome/help/stardict/zh_CN/figures
X at dirrm share/gnome/help/stardict/zh_CN
X at dirrm share/gnome/help/stardict/C/figures
X at dirrm share/gnome/help/stardict/C
X at dirrm share/gnome/help/stardict
X at dirrm etc/gconf/gconf.xml.defaults/schemas/apps/stardict/float_window
X at dirrm etc/gconf/gconf.xml.defaults/schemas/apps/stardict
X at dirrm etc/gconf/gconf.xml.defaults/apps/stardict/float_window
X at dirrm etc/gconf/gconf.xml.defaults/apps/stardict
X at dirrm share/omf/stardict
X at dirrm share/stardict/dic
X at dirrm share/stardict/skins/default
X at dirrm share/stardict/skins
X at dirrm share/stardict
END-of-stardict2/pkg-plist
echo x - stardict2/files/patch-configure
sed 's/^X//' >stardict2/files/patch-configure << 'END-of-stardict2/files/patch-configure'
X--- configure.orig	Wed Apr  9 09:30:40 2003
X+++ configure	Sun Apr 13 10:34:49 2003
X@@ -10688,11 +10688,12 @@
X   LIBS="-lpopt $LIBS"
X 
X else
X-  { { echo "$as_me:$LINENO: error: popt 1.5 or newer is required to build
X-stardict. You can download the latest version from ftp://people.redhat.com/sopwith/popt/" >&5
X-echo "$as_me: error: popt 1.5 or newer is required to build
X-stardict. You can download the latest version from ftp://people.redhat.com/sopwith/popt/" >&2;}
X-   { (exit 1); exit 1; }; }
X+  cat >>confdefs.h <<_ACEOF
X+#define HAVE_LIBPOPT 1
X+_ACEOF
X+
X+  LIBS="-lpopt $LIBS"
X+
X fi
X 
X 
END-of-stardict2/files/patch-configure
echo x - stardict2/files/patch-src::tools::olddic2newdic.c
sed 's/^X//' >stardict2/files/patch-src::tools::olddic2newdic.c << 'END-of-stardict2/files/patch-src::tools::olddic2newdic.c'
X--- src/tools/olddic2newdic.c.orig	Sun Apr 13 10:37:09 2003
X+++ src/tools/olddic2newdic.c	Sun Apr 13 10:50:46 2003
X@@ -47,6 +47,30 @@
X {
X 	FILE *idxfile,*dicfile;
X 	gchar str[256];
X+	int fd;
X+	struct stat stStat;
X+	unsigned int iCapacity,iStyle;
X+	unsigned char cIndex, cWord, cMeaning, cMark;
X+	caddr_t pFileMem;
X+	int iFileSize;
X+
X+    caddr_t p;
X+    caddr_t pMeaning, pMark;
X+	gchar *utf8_str;
X+	gsize write_size;
X+	long tmp_long,wordcount=0;
X+	int word_len, meaning_len,mark_len=0;
X+	int iLength=0;
X+		
X+	GArray *array = g_array_sized_new(FALSE,FALSE, sizeof(struct _worditem),iCapacity);
X+    struct _worditem worditem;
X+	glong old_size;
X+
X+	long offset_old;
X+	
X+	int i;
X+	struct _worditem *pworditem;
X+
X 	
X 	sprintf(str,"%s.idx",newfilename);
X 	idxfile = fopen(str,"w");
X@@ -55,7 +79,7 @@
X 	
X 	fprintf(idxfile,"stardict's idx file\ndictfile=%s\nbookname=%s\nbeigin:\n", str, bookname);
X 	
X-	int fd=open(filename,O_RDONLY);
X+	fd=open(filename,O_RDONLY);
X     if(fd==-1)
X     {
X 		g_print("open fail\n");
X@@ -63,30 +87,28 @@
X     }
X 
X     // get length of dicfile.
X-    struct stat stStat;
X     if(fstat(fd,&stStat)!=0)
X     {
X         g_print("stat fail\n");
X         return;
X     }
X-    int iFileSize=stStat.st_size;
X+    iFileSize=stStat.st_size;
X     
X     // get item count
X     lseek(fd,0-sizeof(int)*2,SEEK_END);
X-    unsigned int iCapacity,iStyle;
X     read(fd,&iCapacity,sizeof(int));
X     read(fd,&iStyle,sizeof(int));
X 	vConvertEndian(&iCapacity);
X     vConvertEndian(&iStyle);
X 
X-    unsigned char cIndex=(unsigned char)(iStyle>>24);
X-    unsigned char cWord=(unsigned char)(iStyle>>16);
X-    unsigned char cMeaning=(unsigned char)(iStyle>>8);
X-    unsigned char cMark=(unsigned char)iStyle;
X+    cIndex=(unsigned char)(iStyle>>24);
X+    cWord=(unsigned char)(iStyle>>16);
X+    cMeaning=(unsigned char)(iStyle>>8);
X+    cMark=(unsigned char)iStyle;
X 	g_print("flag: %c %c %c\n",cIndex,cWord,cMeaning);
X 
X     // mmap the file to memory
X-    caddr_t pFileMem=(caddr_t)mmap( (caddr_t)0,iFileSize-sizeof(int)*2,
X+    pFileMem=(caddr_t)mmap( (caddr_t)0,iFileSize-sizeof(int)*2,
X                             PROT_READ,MAP_SHARED|MAP_NORESERVE,fd,0 );
X     if(pFileMem==MAP_FAILED)
X     {
X@@ -95,17 +117,7 @@
X     }
X 
X     // begin to read items.
X-    caddr_t p=pFileMem;
X-    caddr_t pMeaning, pMark;
X-	gchar *utf8_str;
X-	gsize write_size;
X-	long tmp_long,wordcount=0;
X-	int word_len, meaning_len,mark_len=0;
X-	int iLength=0;
X-		
X-	GArray *array = g_array_sized_new(FALSE,FALSE, sizeof(struct _worditem),iCapacity);
X-    struct _worditem worditem;
X-	glong old_size;
X+    p=pFileMem;
X 	
X 	while(p<pFileMem+iFileSize-sizeof(int)*2 && iLength<iCapacity)
X     {
X@@ -201,11 +213,7 @@
X 	//g_qsort_with_data(parray->pdata,parray->len,sizeof(gpointer),comparefunc,NULL);
X 	g_array_sort(array,comparefunc);
X 	
X-	long offset_old;
X-	
X-	int i;
X-	
X-	struct _worditem *pworditem;
X+
X 	for (i=0;i<array->len;i++)
X 	{
X 		pworditem = &g_array_index(array, struct _worditem, i);
END-of-stardict2/files/patch-src::tools::olddic2newdic.c
exit

	


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list