summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfg2015-06-10 18:38:31 +0200
committerkfg2015-06-10 18:38:31 +0200
commit9d29f8d324e0bb2ebfdb6e7fd2c5d53f95dc6d97 (patch)
treea80bc8fe2edd79b8b41b667f3a82daf281fd2d7f
downloadaur-9d29f8d324e0bb2ebfdb6e7fd2c5d53f95dc6d97.tar.gz
Initial import
-rw-r--r--.SRCINFO27
-rw-r--r--PKGBUILD63
-rw-r--r--autotools.patch45
-rw-r--r--mingw.patch57
-rw-r--r--recode-3.6-as-if.patch19
-rw-r--r--recode-3.6-gettextfix.diff23
6 files changed, 234 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b5f5c93bea27
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,27 @@
+pkgbase = mingw-w64-recode
+ pkgdesc = Converts files between various character sets and usages (mingw-w64)
+ pkgver = 3.6
+ pkgrel = 9
+ url = http://recode.progiciels-bpi.ca/index.html
+ arch = any
+ license = GPL
+ license = LGPL
+ makedepends = mingw-w64-gcc
+ depends = mingw-w64-crt
+ depends = mingw-w64-gettext
+ options = !strip !buildflags staticlibs
+ source = recode-3.6.tar.gz::https://github.com/pinard/recode/tarball/v3.6
+ source = http://ftp.de.debian.org/debian/pool/main/r/recode/recode_3.6-17.diff.gz
+ source = recode-3.6-as-if.patch
+ source = recode-3.6-gettextfix.diff
+ source = autotools.patch
+ source = mingw.patch
+ md5sums = f82e9a6ede9119268c13493c9add2809
+ md5sums = 3716ae269074e31add3d29387ff09438
+ md5sums = fca7484ba332c8ad59eb02334883cd92
+ md5sums = eb602e80a24b5448604bfebeacc55304
+ md5sums = 8680ae965cdcd26f0dea1b8f85c34226
+ md5sums = 515d43fe361a44f576fea310f85472ae
+
+pkgname = mingw-w64-recode
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..0fe465118fce
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,63 @@
+# Maintainer: Karl-Felix Glatzer <karl.glatzer@gmx.de>
+pkgname=mingw-w64-recode
+pkgver=3.6
+pkgrel=9
+pkgdesc="Converts files between various character sets and usages (mingw-w64)"
+arch=('any')
+url="http://recode.progiciels-bpi.ca/index.html"
+license=('GPL' 'LGPL')
+depends=('mingw-w64-crt' 'mingw-w64-gettext')
+options=('!strip !buildflags staticlibs')
+makedepends=('mingw-w64-gcc')
+source=(recode-${pkgver}.tar.gz::"https://github.com/pinard/recode/tarball/v${pkgver}"
+ 'http://ftp.de.debian.org/debian/pool/main/r/recode/recode_3.6-17.diff.gz'
+ 'recode-3.6-as-if.patch' 'recode-3.6-gettextfix.diff' 'autotools.patch' 'mingw.patch')
+md5sums=('f82e9a6ede9119268c13493c9add2809'
+ '3716ae269074e31add3d29387ff09438'
+ 'fca7484ba332c8ad59eb02334883cd92'
+ 'eb602e80a24b5448604bfebeacc55304'
+ '8680ae965cdcd26f0dea1b8f85c34226'
+ '515d43fe361a44f576fea310f85472ae')
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+prepare() {
+ cd ${srcdir}/pinard-Recode-2127b34
+ patch -Np1 -i ${srcdir}/recode-3.6-as-if.patch
+ patch -Np1 -i ${srcdir}/recode-3.6-gettextfix.diff
+ patch -Np1 -i ${srcdir}/recode_3.6-17.diff
+ patch -Np1 -i ${srcdir}/autotools.patch
+ patch -Np1 -i ${srcdir}/mingw.patch
+ sed -i '1i#include <stdlib.h>' src/argmatch.c
+ sed -i -e '/^AM_C_PROTOTYPES/d' -e '/^AUTOMAKE_OPTIONS.*ansi2knr/d' \
+ configure.in src/Makefile.am
+ rm -f acinclude.m4
+ autoreconf -fi
+ libtoolize
+}
+
+build() {
+ for _arch in ${_architectures}; do
+ mkdir -p ${srcdir}/build-${_arch} && cd ${srcdir}/build-${_arch}
+ unset LDFLAGS CPPFLAGS
+ export ac_cv_func_malloc_0_nonnull=yes
+ export jm_cv_func_working_malloc=yes
+ export jm_cv_func_working_realloc=yes
+ ${srcdir}/pinard-Recode-2127b34/configure --prefix=/usr/${_arch} --host=${_arch} \
+ --mandir=/usr/${_arch}/share/man \
+ --infodir=/usr/${_arch}/share/info --without-included-gettext
+ make
+ done
+}
+
+package() {
+ for _arch in ${_architectures}; do
+ cd ${srcdir}/build-${_arch}
+ make DESTDIR="${pkgdir}" install
+
+ rm -r "${pkgdir}/usr/${_arch}/share"
+ rm "${pkgdir}/usr/${_arch}"/bin/*.exe
+
+ ${_arch}-strip --strip-unneeded "${pkgdir}/usr/${_arch}"/bin/*.dll
+ ${_arch}-strip -g "${pkgdir}/usr/${_arch}"/lib/*.a
+ done
+}
diff --git a/autotools.patch b/autotools.patch
new file mode 100644
index 000000000000..3ff86b758dc8
--- /dev/null
+++ b/autotools.patch
@@ -0,0 +1,45 @@
+--- pinard-Recode-2127b34/configure.in 2008-02-19 05:13:35.000000000 +0100
++++ patched/configure.in 2014-01-01 18:42:41.561811995 +0100
+@@ -15,7 +15,7 @@
+ AM_PROG_LIBTOOL
+
+ AC_ISC_POSIX
+-AM_C_PROTOTYPES
++#AM_C_PROTOTYPES
+ AC_C_CONST
+ AC_C_INLINE
+ ad_AC_PROG_FLEX
+@@ -50,5 +50,13 @@
+ LTLIBOBJS=`echo $LIBOBJS | sed 's/\.o /.lo /g;s/\.o$/.lo/'`
+ AC_SUBST(LTLIBOBJS)
+
++LIBRECODE_LDFLAGS=""
++case "$host_os" in mingw*)
++ # we may assume that the backend is gnu-ld but DLLs need full resolution
++ LIBRECODE_LDFLAGS="-no-undefined ${wl}-no-undefined ${wl}-export-all-symbols"
++;; esac
++AC_MSG_RESULT([$LIBRECODE_LDFLAGS])
++AC_SUBST([LIBRECODE_LDFLAGS])
++
+ AC_OUTPUT(Makefile contrib/Makefile doc/Makefile i18n/Makefile lib/Makefile
+ libiconv/Makefile m4/Makefile src/Makefile tests/Makefile tests/atconfig)
+--- pinard-Recode-2127b34/src/Makefile.am 2008-02-19 05:13:35.000000000 +0100
++++ patched/src/Makefile.am 2014-01-01 18:18:11.097703291 +0100
+@@ -48,7 +48,7 @@
+ librecode_la_SOURCES = argmatch.c charname.c combine.c fr-charname.c \
+ hash.c iconv.c libiconv.c localcharset.c merged.c names.c outer.c quotearg.c \
+ recode.c request.c strip-pool.c task.c xmalloc.c $(C_STEPS)
+-librecode_la_LDFLAGS = -version-info 0:0:0
++librecode_la_LDFLAGS = @LIBRECODE_LDFLAGS@ -version-info 0:0:0
+
+ INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/libiconv
+ DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
+@@ -99,7 +99,7 @@
+ grep -v '^# *line [0-9]' merged.tm2 > $(srcdir)/merged.c
+ rm merged.tm1 merged.tm2
+
+-$(srcdir)/recode.1: recode
++$(srcdir)/recode.1: recode$(EXEEXT)
+ @if test -r $@ && test ! -w $@; then \
+ echo "WARNING: Page \`$@' read only, not updated"; \
+ elif $(PERL) $(top_srcdir)/doc/help2man --output=$@ ./recode; then \
diff --git a/mingw.patch b/mingw.patch
new file mode 100644
index 000000000000..9d9b25ef48df
--- /dev/null
+++ b/mingw.patch
@@ -0,0 +1,57 @@
+diff -ru pinard-Recode-2127b34/src/common.h patched/src/common.h
+--- pinard-Recode-2127b34/src/common.h 2008-02-19 05:13:35.000000000 +0100
++++ patched/src/common.h 2014-01-01 01:31:11.144541519 +0100
+@@ -106,7 +106,7 @@
+ # endif
+ #endif
+
+-#include <argmatch.h>
++#include "argmatch.h"
+
+ #include <errno.h>
+ #ifndef errno
+diff -ru pinard-Recode-2127b34/src/task.c patched/src/task.c
+--- pinard-Recode-2127b34/src/task.c 2008-02-19 05:13:35.000000000 +0100
++++ patched/src/task.c 2014-01-01 01:25:00.459235302 +0100
+@@ -25,7 +25,9 @@
+
+ #include <sys/types.h>
+
++#ifndef __MINGW32__
+ #include <sys/wait.h>
++#endif
+ /* Bruno suggests the following, from GNU make 3.79.0.2 in `job.c'. He also
+ remarks that on Linux, WEXITSTATUS are bits 15..8 and WTERMSIG are bits
+ 7..0, while BeOS uses the contrary. */
+--- pinard-Recode-2127b34/src/argmatch.c 2008-02-19 05:13:35.000000000 +0100
++++ patched/src/argmatch.c 2014-01-01 14:53:19.232440132 +0100
+@@ -159,7 +159,12 @@
+ ? _("invalid argument %s for `%s'")
+ : _("ambiguous argument %s for `%s'"));
+
++#ifdef __MINGW32__
++ printf(format, quotearg_style (ARGMATCH_QUOTING_STYLE, value), context);
++ exit(0);
++#else
+ error (0, 0, format, quotearg_style (ARGMATCH_QUOTING_STYLE, value), context);
++#endif
+ }
+
+ /* List the valid arguments for argmatch.
+--- pinard-Recode-2127b34/src/xmalloc.c 2008-02-19 05:13:35.000000000 +0100
++++ patched/src/xmalloc.c 2014-01-01 14:54:28.480302476 +0100
+@@ -70,10 +70,14 @@
+ {
+ if (xalloc_fail_func)
+ (*xalloc_fail_func) ();
++#ifdef __MINGW32__
++ printf("%s", _(xalloc_msg_memory_exhausted));
++#else
+ error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted));
+ /* The `noreturn' cannot be given to error, since it may return if
+ its first argument is 0. To help compilers understand the
+ xalloc_die does terminate, call exit. */
++#endif
+ exit (EXIT_FAILURE);
+ }
+
diff --git a/recode-3.6-as-if.patch b/recode-3.6-as-if.patch
new file mode 100644
index 000000000000..c7bcc27c8750
--- /dev/null
+++ b/recode-3.6-as-if.patch
@@ -0,0 +1,19 @@
+http://bugs.gentoo.org/283029
+
+--- a/m4/flex.m4
++++ b/m4/flex.m4
+@@ -8,11 +8,11 @@ dnl ad_AC_PROG_FLEX
+ dnl Look for flex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
+ AC_DEFUN(ad_AC_PROG_FLEX,
+ [AC_CHECK_PROGS(LEX, flex, missing)
+-if test "$LEX" = missing; then
++AS_IF([test "$LEX" = missing], [dnl
+ LEX="\$(top_srcdir)/$ac_aux_dir/missing flex"
+ LEX_OUTPUT_ROOT=lex.yy
+ AC_SUBST(LEX_OUTPUT_ROOT)dnl
+-else
++], [:
+ AC_PROG_LEX
+ AC_DECL_YYTEXT
+-fi])
++])])
diff --git a/recode-3.6-gettextfix.diff b/recode-3.6-gettextfix.diff
new file mode 100644
index 000000000000..3b7eb8ba20e6
--- /dev/null
+++ b/recode-3.6-gettextfix.diff
@@ -0,0 +1,23 @@
+http://bugs.gentoo.org/239372
+
+patch by Dmitry Karasik
+
+--- recode-3.6/m4/gettext.m4
++++ recode-3.6/m4/gettext.m4
+@@ -109,12 +109,12 @@
+ else
+ ac_items="$LINGUAS"
+ for ac_item in $ac_items; do
+- case "$ALL_LINGUAS" in
+- *$ac_item*)
++ for supported_item in $ALL_LINGUAS; do
++ if test "$ac_item" = "$supported_item"; then
+ ac_print="$ac_print $ac_item"
+ MOFILES="$MOFILES $ac_item.mo"
+- ;;
+- esac
++ fi
++ done
+ done
+ fi
+ AC_SUBST(MOFILES)