summaryrefslogtreecommitdiffstats
path: root/textproc
diff options
context:
space:
mode:
Diffstat (limited to 'textproc')
-rw-r--r--textproc/libtranslate/Makefile56
-rw-r--r--textproc/libtranslate/distinfo3
-rw-r--r--textproc/libtranslate/files/patch-src_modules_translate-generic-service.c47
-rw-r--r--textproc/libtranslate/files/patch-src_translate-session.c38
-rw-r--r--textproc/libtranslate/files/patch-src_translate-util.c11
-rw-r--r--textproc/libtranslate/pkg-descr17
-rw-r--r--textproc/libtranslate/pkg-plist42
7 files changed, 214 insertions, 0 deletions
diff --git a/textproc/libtranslate/Makefile b/textproc/libtranslate/Makefile
new file mode 100644
index 000000000..ddb6fc75b
--- /dev/null
+++ b/textproc/libtranslate/Makefile
@@ -0,0 +1,56 @@
+# New ports collection makefile for: libtranslate
+# Date created: 15 Jan 2005
+# Whom: Jean-Yves Lefort <jylefort@brutele.be>
+#
+# $FreeBSD$
+#
+
+PORTNAME= libtranslate
+PORTVERSION= 0.99
+PORTREVISION= 4
+CATEGORIES= textproc
+MASTER_SITES= ${MASTER_SITE_SAVANNAH}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+
+MAINTAINER= jylefort@FreeBSD.org
+COMMENT= A natural language translation library
+
+USE_GETOPT_LONG= yes
+USE_GNOME= glib20 gnomehack intlhack
+GNU_CONFIGURE= yes
+USE_GMAKE= yes
+USE_LDCONFIG= yes
+CPPFLAGS= -I${LOCALBASE}/include
+LDFLAGS= -L${LOCALBASE}/lib
+CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
+CONFIGURE_ARGS= --with-html-dir=${PREFIX}/share/doc
+
+OPTIONS= GENERIC "generic module" on \
+ TALKFILTERS "talkfilters module" on
+
+MAN1= translate.1
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITHOUT_GENERIC)
+CONFIGURE_ARGS+= --disable-generic
+PLIST_SUB+= GENERIC="@comment "
+.else
+PLIST_SUB+= GENERIC=""
+USE_GNOME+= libxml2
+LIB_DEPENDS+= soup-2.2:${PORTSDIR}/devel/libsoup22
+MAN5+= services.xml.5
+.endif
+
+.if defined(WITHOUT_TALKFILTERS)
+CONFIGURE_ARGS+= --disable-talkfilters
+PLIST_SUB+= TALKFILTERS="@comment "
+.else
+PLIST_SUB+= TALKFILTERS=""
+LIB_DEPENDS+= talkfilters:${PORTSDIR}/misc/talkfilters
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|echo aout|echo elf|' ${WRKSRC}/configure
+
+.include <bsd.port.post.mk>
diff --git a/textproc/libtranslate/distinfo b/textproc/libtranslate/distinfo
new file mode 100644
index 000000000..bd37b9de3
--- /dev/null
+++ b/textproc/libtranslate/distinfo
@@ -0,0 +1,3 @@
+MD5 (libtranslate-0.99.tar.gz) = 1fe75a6a6e8a0c6518890b5fa6984d42
+SHA256 (libtranslate-0.99.tar.gz) = 4b2becb139e51663022d9531c430ebcc81d8b26edc73f6ddc05707ff9950eb34
+SIZE (libtranslate-0.99.tar.gz) = 532516
diff --git a/textproc/libtranslate/files/patch-src_modules_translate-generic-service.c b/textproc/libtranslate/files/patch-src_modules_translate-generic-service.c
new file mode 100644
index 000000000..1626f25ff
--- /dev/null
+++ b/textproc/libtranslate/files/patch-src_modules_translate-generic-service.c
@@ -0,0 +1,47 @@
+--- src/modules/translate-generic-service.c.orig Mon Apr 11 23:08:47 2005
++++ src/modules/translate-generic-service.c Mon Apr 11 23:15:54 2005
+@@ -484,7 +484,7 @@
+
+ if (SOUP_STATUS_IS_SUCCESSFUL(message->status_code))
+ {
+- const char *charset = NULL;
++ char *charset = NULL;
+
+ if (flags & TRANSFER_CONVERT)
+ {
+@@ -493,14 +493,31 @@
+ content_type = translate_generic_service_get_header(message, &info, "Content-Type");
+ if (content_type)
+ {
+- charset = translate_ascii_strcasestr(content_type, "charset=");
+- if (charset)
+- charset += 8;
++ const char *tmp;
++
++ tmp = translate_ascii_strcasestr(content_type, "charset=");
++ if (tmp)
++ {
++ int len;
++
++ tmp += 8;
++ if (*tmp == '\'' || *tmp == '"')
++ tmp++;
++
++ len = strlen(tmp);
++ if (len > 0 && (tmp[len - 1] == '\'' || tmp[len - 1] == '"'))
++ len--;
++
++ charset = g_strndup(tmp, len);
++ }
+ }
+ }
+
+ if (charset)
+- response = g_convert(message->response.body, message->response.length, "UTF-8", charset, NULL, NULL, err);
++ {
++ response = g_convert(message->response.body, message->response.length, "UTF-8", charset, NULL, NULL, err);
++ g_free(charset);
++ }
+ else
+ {
+ if ((flags & TRANSFER_CONVERT) && ! g_utf8_validate(message->response.body, message->response.length, NULL))
diff --git a/textproc/libtranslate/files/patch-src_translate-session.c b/textproc/libtranslate/files/patch-src_translate-session.c
new file mode 100644
index 000000000..4011dcd7d
--- /dev/null
+++ b/textproc/libtranslate/files/patch-src_translate-session.c
@@ -0,0 +1,38 @@
+--- src/translate-session.c.orig Mon Apr 11 22:44:53 2005
++++ src/translate-session.c Mon Apr 11 22:51:48 2005
+@@ -703,7 +703,14 @@
+ GError *tmp_err = NULL;
+
+ g_mutex_lock(info->mutex);
+- ret = info->err != NULL;
++ if (info->err)
++ {
++ ret = TRUE;
++ if (info->progress_cond)
++ g_cond_signal(info->progress_cond);
++ }
++ else
++ ret = FALSE;
+ g_mutex_unlock(info->mutex);
+
+ if (ret)
+@@ -728,6 +735,9 @@
+ else
+ g_propagate_error(&info->err, tmp_err);
+
++ if (info->progress_cond)
++ g_cond_signal(info->progress_cond);
++
+ g_mutex_unlock(info->mutex);
+
+ return;
+@@ -759,6 +769,9 @@
+ info->err = g_error_new(TRANSLATE_SESSION_ERROR,
+ TRANSLATE_SESSION_ERROR_NO_SERVICE,
+ _("no service could translate chunk"));
++
++ if (info->progress_cond)
++ g_cond_signal(info->progress_cond);
+ }
+
+ g_mutex_unlock(info->mutex);
diff --git a/textproc/libtranslate/files/patch-src_translate-util.c b/textproc/libtranslate/files/patch-src_translate-util.c
new file mode 100644
index 000000000..abd28256f
--- /dev/null
+++ b/textproc/libtranslate/files/patch-src_translate-util.c
@@ -0,0 +1,11 @@
+--- src/translate-util.c.orig Mon Jan 17 17:45:45 2005
++++ src/translate-util.c Fri Dec 30 22:26:26 2005
+@@ -136,7 +136,7 @@
+ g_return_val_if_fail(big != NULL, NULL);
+ g_return_val_if_fail(little != NULL, NULL);
+
+- lower_big = g_ascii_strdown(big, big_len);
++ lower_big = g_ascii_strdown(big, (int) big_len);
+ lower_little = g_ascii_strdown(little, -1);
+
+ s = strstr(lower_big, lower_little);
diff --git a/textproc/libtranslate/pkg-descr b/textproc/libtranslate/pkg-descr
new file mode 100644
index 000000000..6921d5e74
--- /dev/null
+++ b/textproc/libtranslate/pkg-descr
@@ -0,0 +1,17 @@
+libtranslate is a library for translating text and web pages between
+natural languages. Its modular infrastructure allows to implement new
+translation services separately from the core library.
+
+libtranslate is shipped with a generic module supporting web-based
+translation services such as Babel Fish, Google Language Tools and
+SYSTRAN. Moreover, the generic module allows to add new services
+simply by adding a few lines to a XML file (see the services.xml(5)
+manual page).
+
+The libtranslate distribution includes a powerful command line
+interface (see the translate(1) manual page).
+
+WWW: http://www.nongnu.org/libtranslate/
+
+- Jean-Yves Lefort
+jylefort@FreeBSD.org
diff --git a/textproc/libtranslate/pkg-plist b/textproc/libtranslate/pkg-plist
new file mode 100644
index 000000000..6fb2b15e5
--- /dev/null
+++ b/textproc/libtranslate/pkg-plist
@@ -0,0 +1,42 @@
+bin/translate
+include/libtranslate/translate-common.h
+include/libtranslate/translate-pair.h
+include/libtranslate/translate-service.h
+include/libtranslate/translate-session.h
+include/libtranslate/translate-util.h
+include/libtranslate/translate.h
+lib/libtranslate.a
+lib/libtranslate.so
+lib/libtranslate.so.0
+%%GENERIC%%lib/libtranslate/modules/generic.so
+%%TALKFILTERS%%lib/libtranslate/modules/talkfilters.so
+libdata/pkgconfig/libtranslate.pc
+share/doc/libtranslate/TranslatePair.html
+share/doc/libtranslate/TranslateService.html
+share/doc/libtranslate/TranslateSession.html
+share/doc/libtranslate/api-reference.html
+share/doc/libtranslate/ch01s02.html
+share/doc/libtranslate/ch02s02.html
+share/doc/libtranslate/compiling-modules.html
+share/doc/libtranslate/home.png
+share/doc/libtranslate/index.html
+share/doc/libtranslate/index.sgml
+share/doc/libtranslate/ix01.html
+share/doc/libtranslate/left.png
+share/doc/libtranslate/libtranslate-translate-common.html
+share/doc/libtranslate/libtranslate-translate-util.html
+share/doc/libtranslate/libtranslate-translate.html
+share/doc/libtranslate/libtranslate.devhelp
+share/doc/libtranslate/overview.html
+share/doc/libtranslate/rfc3066-builtin.html
+share/doc/libtranslate/right.png
+share/doc/libtranslate/tutorials.html
+share/doc/libtranslate/up.png
+share/libtranslate/services.dtd
+share/libtranslate/services.xml
+share/locale/fr/LC_MESSAGES/libtranslate.mo
+@dirrm include/libtranslate
+@dirrm lib/libtranslate/modules
+@dirrm lib/libtranslate
+@dirrm share/doc/libtranslate
+@dirrm share/libtranslate