diff options
author | demon <demon@FreeBSD.org> | 2014-05-07 22:34:24 +0800 |
---|---|---|
committer | demon <demon@FreeBSD.org> | 2014-05-07 22:34:24 +0800 |
commit | 965ec3fe369dca5ff9e82c518be29ad8da483b9a (patch) | |
tree | 37281532f9a62777c8c3cbe1006101508ef26f0b /math | |
parent | 9878c843530610c9daf8df4598d74460b60f004e (diff) | |
download | freebsd-ports-gnome-965ec3fe369dca5ff9e82c518be29ad8da483b9a.tar.gz freebsd-ports-gnome-965ec3fe369dca5ff9e82c518be29ad8da483b9a.tar.zst freebsd-ports-gnome-965ec3fe369dca5ff9e82c518be29ad8da483b9a.zip |
New port: foma.
Foma is a compiler, programming language, and C library for constructing
finite-state automata and transducers for various uses. It has specific
support for many natural language processing applications such as producing
morphological analyzers. Although NLP applications are probably the main use
of foma, it is sufficiently generic to use for a large number of purposes.
Diffstat (limited to 'math')
-rw-r--r-- | math/Makefile | 1 | ||||
-rw-r--r-- | math/foma/Makefile | 25 | ||||
-rw-r--r-- | math/foma/distinfo | 2 | ||||
-rw-r--r-- | math/foma/files/patch-flookup.c | 10 | ||||
-rw-r--r-- | math/foma/files/patch-fomalib.h | 11 | ||||
-rw-r--r-- | math/foma/files/patch-iface.c | 28 | ||||
-rw-r--r-- | math/foma/files/patch-io.c | 56 | ||||
-rw-r--r-- | math/foma/pkg-descr | 17 | ||||
-rw-r--r-- | math/foma/pkg-plist | 8 |
9 files changed, 158 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile index e06fba56d4cd..af072b06d0b8 100644 --- a/math/Makefile +++ b/math/Makefile @@ -124,6 +124,7 @@ SUBDIR += fftw3-long SUBDIR += fftw3-quad SUBDIR += fityk + SUBDIR += foma SUBDIR += fpc-fftw SUBDIR += fpc-gmp SUBDIR += fpc-numlib diff --git a/math/foma/Makefile b/math/foma/Makefile new file mode 100644 index 000000000000..215d021c54f3 --- /dev/null +++ b/math/foma/Makefile @@ -0,0 +1,25 @@ +# Created by: Dmitry Sivachenko <mitya@yandex-team.ru> +# $FreeBSD$ + +PORTNAME= foma +PORTVERSION= 0.9.17 +CATEGORIES= math +MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} + +MAINTAINER= demon@FreeBSD.org +COMMENT= A toolkit for constructing finite-state automata and transducers + +LICENSE= GPLv2 + +USES= gmake +USE_GCC= yes +USE_LDCONFIG= yes + +do-install: + cd ${WRKSRC} && ${INSTALL_DATA} fomalib.h fomalibconf.h ${STAGEDIR}${PREFIX}/include/ + cd ${WRKSRC} && ${INSTALL_PROGRAM} foma flookup cgflookup ${STAGEDIR}${PREFIX}/bin/ + ${INSTALL_LIB} ${WRKSRC}/libfoma.a ${STAGEDIR}${PREFIX}/lib/ + ${INSTALL_LIB} ${WRKSRC}/libfoma.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libfoma.so.0 + cd ${STAGEDIR}${PREFIX}/lib && ${LN} -s libfoma.so.0 libfoma.so + +.include <bsd.port.mk> diff --git a/math/foma/distinfo b/math/foma/distinfo new file mode 100644 index 000000000000..9546f68e9858 --- /dev/null +++ b/math/foma/distinfo @@ -0,0 +1,2 @@ +SHA256 (foma-0.9.17.tar.gz) = 71761499b83af79cdc81b8b73ad2a2a1dd90c7466653ee89ba7dc9863fdf74f0 +SIZE (foma-0.9.17.tar.gz) = 333693 diff --git a/math/foma/files/patch-flookup.c b/math/foma/files/patch-flookup.c new file mode 100644 index 000000000000..d29f7a06711c --- /dev/null +++ b/math/foma/files/patch-flookup.c @@ -0,0 +1,10 @@ +--- flookup.c.orig 2014-05-07 17:56:43.000000000 +0400 ++++ flookup.c 2014-05-07 17:57:05.000000000 +0400 +@@ -23,6 +23,7 @@ + #include <unistd.h> + #include <sys/types.h> + #include <sys/socket.h> ++#include <netinet/in.h> + #include <arpa/inet.h> + #include "fomalib.h" + diff --git a/math/foma/files/patch-fomalib.h b/math/foma/files/patch-fomalib.h new file mode 100644 index 000000000000..f250acb87beb --- /dev/null +++ b/math/foma/files/patch-fomalib.h @@ -0,0 +1,11 @@ +--- fomalib.h.orig 2012-11-17 13:46:43.000000000 +0400 ++++ fomalib.h 2014-05-07 18:16:20.000000000 +0400 +@@ -298,7 +298,7 @@ + FEXPORT int save_defined(); + FEXPORT int save_stack_att(); + FEXPORT int write_prolog(struct fsm *net, char *filename); +-FEXPORT int foma_net_print(struct fsm *net, gzFile *outfile); ++FEXPORT int foma_net_print(struct fsm *net, gzFile outfile); + + /* Lookups */ + diff --git a/math/foma/files/patch-iface.c b/math/foma/files/patch-iface.c new file mode 100644 index 000000000000..b6e355ad5b86 --- /dev/null +++ b/math/foma/files/patch-iface.c @@ -0,0 +1,28 @@ +--- iface.c.orig 2012-08-10 19:40:14.000000000 +0400 ++++ iface.c 2014-05-07 18:17:01.000000000 +0400 +@@ -16,7 +16,6 @@ + /* along with foma. If not, see <http://www.gnu.org/licenses/>. */ + + #include <stdio.h> +-#include <wchar.h> + #include <stdlib.h> + #include <string.h> + #include <limits.h> +@@ -47,7 +46,7 @@ + extern int g_med_cutoff ; + extern char *g_att_epsilon; + +-extern int foma_net_print(struct fsm *net, gzFile *outfile); ++extern int foma_net_print(struct fsm *net, gzFile outfile); + + static char *sigptr(struct sigma *sigma, int number); + static int print_dot(struct fsm *net, char *filename); +@@ -999,7 +998,7 @@ + } + + void iface_save_stack(char *filename) { +- gzFile *outfile; ++ gzFile outfile; + struct stack_entry *stack_ptr; + + if (iface_stack_check(1)) { diff --git a/math/foma/files/patch-io.c b/math/foma/files/patch-io.c new file mode 100644 index 000000000000..5891ce618807 --- /dev/null +++ b/math/foma/files/patch-io.c @@ -0,0 +1,56 @@ +--- io.c.orig 2011-12-09 18:04:38.000000000 +0400 ++++ io.c 2014-05-07 18:15:26.000000000 +0400 +@@ -56,7 +56,7 @@ static size_t io_get_gz_file_size(char * + static size_t io_get_file_size(char *filename); + static size_t io_get_regular_file_size(char *filename); + size_t io_gz_file_to_mem (struct io_buf_handle *iobh, char *filename); +-int foma_net_print(struct fsm *net, gzFile *outfile); ++int foma_net_print(struct fsm *net, gzFile outfile); + struct fsm *io_net_read(struct io_buf_handle *iobh, char **net_name); + static inline int explode_line (char *buf, int *values); + +@@ -507,7 +507,7 @@ struct fsm *fsm_read_text_file(char *fil + } + + int fsm_write_binary_file(struct fsm *net, char *filename) { +- gzFile *outfile; ++ gzFile outfile; + if ((outfile = gzopen(filename,"wb")) == NULL) { + return(1); + } +@@ -560,7 +560,7 @@ struct fsm *fsm_read_binary_file(char *f + } + + int save_defined(char *filename) { +- gzFile *outfile; ++ gzFile outfile; + struct defined *def; + def = get_defines(); + if (def == NULL) { +@@ -829,7 +829,7 @@ static int io_gets(struct io_buf_handle + return(i); + } + +-int foma_net_print(struct fsm *net, gzFile *outfile) { ++int foma_net_print(struct fsm *net, gzFile outfile) { + struct sigma *sigma; + struct fsm_state *fsm; + int i, maxsigma, laststate, *cm, extras; +@@ -949,7 +949,7 @@ static size_t io_get_regular_file_size(c + + + static size_t io_get_file_size(char *filename) { +- gzFile *FILE; ++ gzFile FILE; + size_t size; + FILE = gzopen(filename, "r"); + if (FILE == NULL) { +@@ -968,7 +968,7 @@ static size_t io_get_file_size(char *fil + size_t io_gz_file_to_mem(struct io_buf_handle *iobh, char *filename) { + + size_t size; +- gzFile *FILE; ++ gzFile FILE; + + size = io_get_file_size(filename); + if (size == 0) { diff --git a/math/foma/pkg-descr b/math/foma/pkg-descr new file mode 100644 index 000000000000..6027d74152b6 --- /dev/null +++ b/math/foma/pkg-descr @@ -0,0 +1,17 @@ +Foma is a compiler, programming language, and C library for constructing +finite-state automata and transducers for various uses. It has specific +support for many natural language processing applications such as producing +morphological analyzers. Although NLP applications are probably the main use +of foma, it is sufficiently generic to use for a large number of purposes. + +The foma interface is similar to the Xerox xfst interface, and supports +most of the commands and the regular expression syntax in xfst. +Many grammars written for xfst compile out-of-the-box with foma. + +The library contains efficient implementations of all classical +automata/transducer algorithms: determinization, minimization, epsilon-removal, +composition, boolean operations. Also, more advanced construction methods +are available: context restriction, quotients, first-order regular logic, +transducers from replacement rules, etc. + +WWW: https://code.google.com/p/foma/ diff --git a/math/foma/pkg-plist b/math/foma/pkg-plist new file mode 100644 index 000000000000..fc70b94b16b3 --- /dev/null +++ b/math/foma/pkg-plist @@ -0,0 +1,8 @@ +bin/cgflookup +bin/flookup +bin/foma +include/fomalib.h +include/fomalibconf.h +lib/libfoma.a +lib/libfoma.so +lib/libfoma.so.0 |