summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2010-08-07 12:54:45 +0000
committerobache <obache@pkgsrc.org>2010-08-07 12:54:45 +0000
commit1750c9bacc693c596f9493ae23af0dc8cf7f025a (patch)
tree84fb888bcf1c2728e0b9195791973c713ef4ec38
parent2fc7251a0ef3af3548548a9439a3258da432a38c (diff)
downloadpkgsrc-1750c9bacc693c596f9493ae23af0dc8cf7f025a.tar.gz
Import tegaki-wagomu-0.3.1 as inputmethod/tegaki-wagomu.
Simple handwriting recognition engine based on DTW.
-rw-r--r--inputmethod/tegaki-wagomu/DESCR1
-rw-r--r--inputmethod/tegaki-wagomu/Makefile35
-rw-r--r--inputmethod/tegaki-wagomu/PLIST7
-rw-r--r--inputmethod/tegaki-wagomu/distinfo10
-rw-r--r--inputmethod/tegaki-wagomu/patches/patch-aa51
-rw-r--r--inputmethod/tegaki-wagomu/patches/patch-ab18
6 files changed, 122 insertions, 0 deletions
diff --git a/inputmethod/tegaki-wagomu/DESCR b/inputmethod/tegaki-wagomu/DESCR
new file mode 100644
index 00000000000..1be252f7b78
--- /dev/null
+++ b/inputmethod/tegaki-wagomu/DESCR
@@ -0,0 +1 @@
+Simple handwriting recognition engine based on DTW.
diff --git a/inputmethod/tegaki-wagomu/Makefile b/inputmethod/tegaki-wagomu/Makefile
new file mode 100644
index 00000000000..1bb5b24e98f
--- /dev/null
+++ b/inputmethod/tegaki-wagomu/Makefile
@@ -0,0 +1,35 @@
+# $NetBSD: Makefile,v 1.1.1.1 2010/08/07 12:54:45 obache Exp $
+#
+
+DISTNAME= tegaki-wagomu-0.3.1
+CATEGORIES= inputmethod
+MASTER_SITES= http://www.tegaki.org/releases/${PKGVERSION_NOREV}/
+DISTFILES= tegaki-wagomu-0.3${EXTRACT_SUFX} ${DEFAULT_DISTFILES}
+
+MAINTAINER= obache@NetBSD.org
+HOMEPAGE= http://www.tegaki.org/
+COMMENT= Simple handwriting recognition engine based on DTW
+LICENSE= gnu-gpl-v2
+
+DEPENDS+= tegaki-python>=0.3:../../inputmethod/tegaki-python
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+USE_LANGUAGES= c c++
+USE_TOOLS+= pkg-config
+
+# some files are missing in distfile, taken from 0.3.
+post-extract:
+ ${CP} ${WRKDIR}/tegaki-wagomu-0.3/tegakiwagomu.py ${WRKSRC}
+ ${CP} ${WRKDIR}/tegaki-wagomu-0.3/wagomu.h ${WRKSRC}
+
+SUBST_CLASSES+= fixver
+SUBST_STAGE.fixver= pre-configure
+SUBST_FILES.fixver= tegakiwagomu.py
+SUBST_SED.fixver= -e 's|0\.3|${PKGVERSION_NOREV}|'
+
+EGG_NAME= ${DISTNAME:S/-/_/}
+
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../lang/python/distutils.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/inputmethod/tegaki-wagomu/PLIST b/inputmethod/tegaki-wagomu/PLIST
new file mode 100644
index 00000000000..7b07ab40343
--- /dev/null
+++ b/inputmethod/tegaki-wagomu/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2010/08/07 12:54:45 obache Exp $
+${PYSITELIB}/_wagomu.so
+${PLIST.eggfile}${PYSITELIB}/${EGG_FILE}
+${PYSITELIB}/wagomu.py
+${PYSITELIB}/wagomu.pyc
+${PYSITELIB}/wagomu.pyo
+share/tegaki/engines/tegakiwagomu.py
diff --git a/inputmethod/tegaki-wagomu/distinfo b/inputmethod/tegaki-wagomu/distinfo
new file mode 100644
index 00000000000..44f7a0a1465
--- /dev/null
+++ b/inputmethod/tegaki-wagomu/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1.1.1 2010/08/07 12:54:45 obache Exp $
+
+SHA1 (tegaki-wagomu-0.3.1.tar.gz) = b2d1188e038d4117c6d257d6182480b8587eb472
+RMD160 (tegaki-wagomu-0.3.1.tar.gz) = cedb5901653756fa7a591f2fb6893d909ffff60b
+Size (tegaki-wagomu-0.3.1.tar.gz) = 6745 bytes
+SHA1 (tegaki-wagomu-0.3.tar.gz) = 113122743488415bed1471ee084911d6b0de3cde
+RMD160 (tegaki-wagomu-0.3.tar.gz) = 5b8e6395e5692de78e3f10c3d12285c3adc5d30f
+Size (tegaki-wagomu-0.3.tar.gz) = 19191 bytes
+SHA1 (patch-aa) = 337313968d03fc0ee80e0b1c2bbce76472dab3d4
+SHA1 (patch-ab) = 7f85c5154e9d3374865376e9923f06a009af7e68
diff --git a/inputmethod/tegaki-wagomu/patches/patch-aa b/inputmethod/tegaki-wagomu/patches/patch-aa
new file mode 100644
index 00000000000..80e6edd4483
--- /dev/null
+++ b/inputmethod/tegaki-wagomu/patches/patch-aa
@@ -0,0 +1,51 @@
+$NetBSD: patch-aa,v 1.1.1.1 2010/08/07 12:54:45 obache Exp $
+
+use memalign(3) if possible.
+
+--- wagomu.cpp.orig 2010-02-27 04:51:50.000000000 +0000
++++ wagomu.cpp
+@@ -78,7 +78,11 @@ Character::Character(unsigned int n_vec,
+ ptr += diff;
+ ((char*)ptr)[-1]= diff;
+ */
++#ifdef HAVE_POSIX_MEMALIGN
++ posix_memalign((void**)&points, 16, n_vec * VEC_DIM_MAX *
++#else
+ points = (float *) memalign(16, n_vec * VEC_DIM_MAX *
++#endif
+ sizeof(float));
+ }
+
+@@ -198,16 +202,32 @@ bool Recognizer::open(char *path) {
+ max_n_vectors = get_max_n_vectors();
+
+ #ifdef __SSE__
++#ifdef HAVE_POSIX_MEMALIGN
++ posix_memalign((void**)&dtw1v, 16, max_n_vectors * VEC_DIM_MAX *
++#else
+ dtw1v = (wg_v4sf *) memalign(16, max_n_vectors * VEC_DIM_MAX *
++#endif
+ sizeof(wg_v4sf));
++#ifdef HAVE_POSIX_MEMALIGN
++ posix_memalign((void**)&dtw2v, 16, max_n_vectors * VEC_DIM_MAX *
++#else
+ dtw2v = (wg_v4sf *) memalign(16, max_n_vectors * VEC_DIM_MAX *
++#endif
+ sizeof(wg_v4sf));
+ dtw1 = (float *) dtw1v;
+ dtw2 = (float *) dtw2v;
+ #else
++#ifdef HAVE_POSIX_MEMALIGN
++ posix_memalign((void**)&dtw1, 16, max_n_vectors * VEC_DIM_MAX *
++#else
+ dtw1 = (float *) memalign(16, max_n_vectors * VEC_DIM_MAX *
++#endif
+ sizeof(float));
++#ifdef HAVE_POSIX_MEMALIGN
++ posix_memalign((void**)&dtw2, 16, max_n_vectors * VEC_DIM_MAX *
++#else
+ dtw2 = (float *) memalign(16, max_n_vectors * VEC_DIM_MAX *
++#endif
+ sizeof(float));
+ #endif
+
diff --git a/inputmethod/tegaki-wagomu/patches/patch-ab b/inputmethod/tegaki-wagomu/patches/patch-ab
new file mode 100644
index 00000000000..c79da95ecc4
--- /dev/null
+++ b/inputmethod/tegaki-wagomu/patches/patch-ab
@@ -0,0 +1,18 @@
+$NetBSD: patch-ab,v 1.1.1.1 2010/08/07 12:54:45 obache Exp $
+
+Use posix_memalign(3) if possible.
+
+--- setup.py.orig 2010-02-27 04:51:50.000000000 +0000
++++ setup.py
+@@ -25,8 +25,10 @@ def pkg_config(package, option):
+ sub.wait()
+ return [a[2:] for a in args]
+
+-if platform.system() in ["Darwin", "Windows"]:
++if platform.system() in ["Darwin", "OpenBSD", "Windows"]:
+ macros = []
++elif platform.system() in ["NetBSD", "FreeBSD", "DragonFly"]:
++ macros = [("HAVE_POSIX_MEMALIGN", None)]
+ else:
+ macros = [("HAVE_MEMALIGN", None)]
+