summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Favre2015-06-26 07:57:32 +0200
committerBenoit Favre2015-06-26 07:57:32 +0200
commit0d80284fa082cc0f32ac15dade00fd301747543a (patch)
treed8556efdb090c48f36226e5750b87130c240a98a
downloadaur-0d80284fa082cc0f32ac15dade00fd301747543a.tar.gz
Initial import
-rw-r--r--.AURINFO18
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD53
-rw-r--r--getdelim.patch80
4 files changed, 171 insertions, 0 deletions
diff --git a/.AURINFO b/.AURINFO
new file mode 100644
index 000000000000..810494ad413f
--- /dev/null
+++ b/.AURINFO
@@ -0,0 +1,18 @@
+pkgbase = mingw-w64-gfsm
+ pkgdesc = A weighted finite state transducer (WFST) library and associated command line tools. (mingw-w64)
+ pkgver = 0.0.15.1
+ pkgrel = 4
+ url = http://kaskade.dwds.de/~moocow/mirror/projects/gfsm/
+ arch = any
+ license = LGPL
+ makedepends = mingw-w64-configure
+ depends = mingw-w64-crt
+ depends = mingw-w64-glib2
+ source = http://kaskade.dwds.de/~moocow/mirror/projects/gfsm/gfsm-0.0.15-1.tar.gz
+ source = getdelim.patch
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+
+pkgname = mingw-w64-gfsm
+
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0219c9451774
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = mingw-w64-gfsm
+ pkgdesc = A weighted finite state transducer (WFST) library and associated command line tools. (mingw-w64)
+ pkgver = 0.0.15.1
+ pkgrel = 4
+ url = http://kaskade.dwds.de/~moocow/mirror/projects/gfsm/
+ arch = any
+ license = LGPL
+ makedepends = mingw-w64-configure
+ depends = mingw-w64-crt
+ depends = mingw-w64-glib2
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = http://kaskade.dwds.de/~moocow/mirror/projects/gfsm/gfsm-0.0.15-1.tar.gz
+ source = getdelim.patch
+ md5sums = e13ca735ee146d242b33d4de74fb6157
+ md5sums = 46825b464058f1ab72b3361d29123716
+
+pkgname = mingw-w64-gfsm
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b4def8317247
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,53 @@
+# Maintainer: Benoit Favre <benoit.favre@lif.univ-mrs.fr>
+pkgname=mingw-w64-gfsm
+_pkgname=gfsm
+pkgver=0.0.15.1
+_pkgver=0.0.15-1
+pkgrel=4
+pkgdesc="A weighted finite state transducer (WFST) library and associated command line tools. (mingw-w64)"
+arch=(any)
+url="http://kaskade.dwds.de/~moocow/mirror/projects/gfsm/"
+license=('LGPL')
+makedepends=(mingw-w64-configure)
+depends=(mingw-w64-crt mingw-w64-glib2)
+options=(!strip !buildflags staticlibs)
+source=(http://kaskade.dwds.de/~moocow/mirror/projects/gfsm/${_pkgname}-${_pkgver}.tar.gz
+ getdelim.patch)
+md5sums=('e13ca735ee146d242b33d4de74fb6157'
+ '46825b464058f1ab72b3361d29123716')
+
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+prepare() {
+ cd "$srcdir/$_pkgname-$_pkgver"
+ patch -p1 < ../getdelim.patch
+ find . -name Makefile.am | xargs -i sed -i "s/_la_LDFLAGS = /_la_LDFLAGS = -no-undefined /" {}
+ sed -i 's/AM_PROG_LIBTOOL/AC_LIBTOOL_WIN32_DLL\nAM_PROG_LIBTOOL/' configure.ac
+ rm -rf m4
+ sh autogen.sh
+}
+
+build() {
+ cd "$srcdir/$_pkgname-$_pkgver"
+ for _arch in ${_architectures}; do
+ mkdir -p build-${_arch} && pushd build-${_arch}
+ ${_arch}-configure
+ make
+ popd
+ done
+}
+
+package() {
+ cd "$srcdir/$_pkgname-$_pkgver"
+ for _arch in ${_architectures}; do
+ pushd build-${_arch}
+ make DESTDIR="$pkgdir/" install
+ rm -rf "${pkgdir}"/usr/${_arch}/share
+ rm -rf "${pkgdir}"/usr/${_arch}/bin/*.exe
+ find "${pkgdir}"/usr/${_arch} -name \*.dll | xargs ${_arch}-strip --strip-unneeded
+ find "${pkgdir}"/usr/${_arch} -name \*.a | xargs ${_arch}-strip -g
+ popd
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/getdelim.patch b/getdelim.patch
new file mode 100644
index 000000000000..c3f023f7b448
--- /dev/null
+++ b/getdelim.patch
@@ -0,0 +1,80 @@
+diff -rupN old/src/libgfsm/getdelim.c new/src/libgfsm/getdelim.c
+--- old/src/libgfsm/getdelim.c 1970-01-01 01:00:00.000000000 +0100
++++ new/src/libgfsm/getdelim.c 2015-03-01 21:23:17.381413359 +0100
+@@ -0,0 +1,54 @@
++/* Copyright (c) 2009-2013, Kevin Lawler <k.concerns@gmail.com>
++
++Permission to use, copy, modify, and/or distribute this software for any
++purpose with or without fee is hereby granted, provided that the above
++copyright notice and this permission notice appear in all copies.
++
++THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++
++This file is borrowed from https://github.com/asalac/kona-mingw
++*/
++
++#define _GNU_SOURCE
++#include <stdlib.h>
++#include <stdio.h>
++#include <sys/types.h>
++#include <errno.h>
++
++
++signed int getdelim(char **lineptr, size_t *n, int delim, FILE *stream) {
++ size_t i;
++ if (!lineptr || !n) {
++ errno=EINVAL;
++ return -1;
++ }
++ if (!*lineptr) *n=0;
++ for (i=0; ; ) {
++ int x;
++ if (i>=*n) {
++ int tmp=*n+100;
++ char* new=realloc(*lineptr,tmp);
++ if (!new) return -1;
++ *lineptr=new; *n=tmp;
++ }
++ x=fgetc(stream);
++ if (x==EOF) { if (!i) return -1; (*lineptr)[i]=0; return i; }
++ (*lineptr)[i]=x;
++ ++i;
++ if (x==delim || i>=*n) break;
++ }
++ (*lineptr)[i]=0;
++ return i;
++}
++
++signed int getline(char **lineptr, size_t *n, FILE *stream) {
++ return getdelim(lineptr,n,'\n',stream);
++}
++
++
+diff -rupN old/src/libgfsm/Makefile.am new/src/libgfsm/Makefile.am
+--- old/src/libgfsm/Makefile.am 2014-08-22 11:17:56.000000000 +0200
++++ new/src/libgfsm/Makefile.am 2015-03-01 21:18:26.890095396 +0100
+@@ -92,7 +92,8 @@ libgfsm_la_SOURCES = \
+ gfsmRegex.tab.y \
+ gfsmRegexCompiler.c \
+ gfsmIndexed.c \
+- gfsmIndexedIO.c
++ gfsmIndexedIO.c \
++ getdelim.c
+
+ sources_argh = \
+ gfsmIndexed.c \
+@@ -210,7 +211,7 @@ gfsmRegexCompiler.o: gfsmRegexCompiler.c
+ AM_CPPFLAGS = -I. -I$(SRCDIR)/gnulib
+
+ ## --- compiler flags (cc)
+-AM_CFLAGS = $(gfsm_WFLAGS) $(gfsm_OFLAGS)
++AM_CFLAGS = $(gfsm_WFLAGS) $(gfsm_OFLAGS) -D_GNU_SOURCE
+
+ ##-----------------------------------------------------------------------
+ ## Additional variable: library versioning