[PATCH] add sdcv(StarDict command line version) to packages

Xiangfu Liu xiangfu at qi-hardware.com
Fri Nov 27 09:01:45 EST 2009


Hi
first need copy the dictionaries[1] to /usr/share/stardict/dic.

for now, problem is Ben NanoNote can not display UTF in the terminal. so 
Ben can't display Chinese correct. here[2] is some output.
also there is no Chinese font in Ben.

[1]http://stardict.sourceforge.net/Dictionaries_dictd-www.dict.org.php
   there is a lot of dictionaries in there, also a small wiki dump.
[2]
----
root at BenNanoNote:~# sdcv --data-dir /root/dic
Enter word or phrase: what
Found 1 items, similar to what.
-->\u6717\u9053\u82f1\u6c49\u5b57\u51785.0
-->what

*[hw\u0252t]
pron. \u4ec0\u4e48
interj. \u600e\u4e48, \u591a\u4e48
a. \u4ec0\u4e48\u7684
ad. \u5230\u4ec0\u4e48\u7a0b\u5ea6
\u76f8\u5173\u8bcd\u7ec4:
  and what not
  but what
  or what
  What about...?
  what for
  what have you
  What if...?
  what is called
  what is more
  what of
  what's what
  What the...?
  what with
  find out what's what
  know what's what
  what though

Enter word or phrase:
----


Xiangfu Liu wrote:
> ---
>  sdcv/Makefile                            |   44 ++++++++++++++++++++++++++++++
>  sdcv/patches/001-fix-compile-error.patch |   29 +++++++++++++++++++
>  2 files changed, 73 insertions(+), 0 deletions(-)
>  create mode 100644 sdcv/Makefile
>  create mode 100644 sdcv/patches/001-fix-compile-error.patch
> 
> diff --git a/sdcv/Makefile b/sdcv/Makefile
> new file mode 100644
> index 0000000..5068238
> --- /dev/null
> +++ b/sdcv/Makefile
> @@ -0,0 +1,44 @@
> +#
> +# Copyright (C) 2009 Qi Hardware Inc.
> +# Author: Xiangfu Liu <xiangfu at qi-hardware.com>
> +# 
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +include $(TOPDIR)/rules.mk
> +
> +PKG_NAME:=sdcv
> +PKG_VERSION:=0.4.2
> +
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
> +PKG_SOURCE_URL:=http://cdnetworks-kr-1.dl.sourceforge.net/project/sdcv/sdcv/0.4.2/
> +
> +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
> +
> +PKG_INSTALL:=1
> +
> +include $(INCLUDE_DIR)/package.mk
> +
> +define Package/sdcv
> +    TITLE:=sdcv
> +    SECTION:=utils
> +    CATEGORY:=Utilities
> +    URL:=http://sdcv.sourceforge.net/
> +endef
> +
> +define Package/sdcv/description
> +    StarDict Command line version
> +endef
> +
> +TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/lib/libintl/include
> +TARGET_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/libintl/lib
> +
> +CONFIGURE_ARGS += 
> +
> +define Package/sdcv/install
> +	$(INSTALL_DIR) $(1)/usr/bin
> +	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sdcv $(1)/usr/bin/
> +endef
> +
> +$(eval $(call BuildPackage,sdcv))
> diff --git a/sdcv/patches/001-fix-compile-error.patch b/sdcv/patches/001-fix-compile-error.patch
> new file mode 100644
> index 0000000..dd6efe7
> --- /dev/null
> +++ b/sdcv/patches/001-fix-compile-error.patch
> @@ -0,0 +1,29 @@
> +diff --git a/src/lib/mapfile.hpp b/src/lib/mapfile.hpp
> +index eedb1bc..300849a 100644
> +--- a/src/lib/mapfile.hpp
> ++++ b/src/lib/mapfile.hpp
> +@@ -18,9 +18,9 @@
> + class MapFile {
> + public:
> +   MapFile(void) : 
> +-		data(NULL),
> ++		data(NULL)
> + #ifdef HAVE_MMAP
> +-		mmap_fd(-1)
> ++		, mmap_fd(-1)
> + #elif defined(_WIN32)
> + 		hFile(0),
> + 		hFileMap(0)
> +diff --git a/src/utils.cpp b/src/utils.cpp
> +index 5e8d562..2e3e55e 100644
> +--- a/src/utils.cpp
> ++++ b/src/utils.cpp
> +@@ -24,6 +24,8 @@
> + 
> + #include <glib.h>
> + #include <glib/gi18n.h>
> ++#include <stdio.h>
> ++#include <stdlib.h>
> + 
> + #include "utils.hpp"
> + 


-- 
Xiangfu Liu
Email: xiangfu at qi-hardware dot com
Web: http://www.qi-hardware.com




More information about the discussion mailing list


interactive