From 6c8a6eb2fa1fc6e1d8f1433c078be93028ebd63f Mon Sep 17 00:00:00 2001 From: Alexpux Date: Wed, 14 Jan 2015 00:25:55 +0300 Subject: [PATCH] libtre-git: New package. --- mingw-w64-libtre-git/001-autotools.patch | 59 +++++++++++++++++++++ mingw-w64-libtre-git/002-pointer-cast.patch | 13 +++++ mingw-w64-libtre-git/PKGBUILD | 53 ++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 mingw-w64-libtre-git/001-autotools.patch create mode 100644 mingw-w64-libtre-git/002-pointer-cast.patch create mode 100644 mingw-w64-libtre-git/PKGBUILD diff --git a/mingw-w64-libtre-git/001-autotools.patch b/mingw-w64-libtre-git/001-autotools.patch new file mode 100644 index 0000000000..9d1d4709c8 --- /dev/null +++ b/mingw-w64-libtre-git/001-autotools.patch @@ -0,0 +1,59 @@ +diff -Naur libtre-orig/configure.ac libtre/configure.ac +--- libtre-orig/configure.ac 2015-01-13 21:37:45.236000000 +0300 ++++ libtre/configure.ac 2015-01-13 22:03:05.152200000 +0300 +@@ -2,10 +2,11 @@ + AC_INIT(TRE, 0.8.0, [tre-general@lists.laurikari.net]) + AC_CONFIG_SRCDIR([lib/regcomp.c]) + AC_CONFIG_AUX_DIR(utils) ++AC_CONFIG_MACRO_DIRS([m4]) + AC_CANONICAL_TARGET +-AM_INIT_AUTOMAKE(1.9.0) +-AC_PREREQ(2.59) +-AM_GNU_GETTEXT_VERSION(0.17) ++AM_INIT_AUTOMAKE([subdir-objects]) ++AC_PREREQ(2.69) ++AM_GNU_GETTEXT_VERSION(0.18) + + dnl Checks for programs. + AC_PROG_CC +@@ -433,16 +433,6 @@ + [ $tre_includes ]) + fi + fi +- +-case $host in +- *-mingw*) +- dnl wcsrtombs and wcstombs don't seem to work at all on MinGW. +- if test "$tre_libutf8" != "yes"; then +- tre_wchar_reason="Not supported on MinGW" +- tre_wchar="no ($tre_wchar_reason)" +- fi +- ;; +-esac + + # Fail if wide character support was specifically requested but is + # not supported on this system. +diff -Naur libtre-orig/src/Makefile.am libtre/src/Makefile.am +--- libtre-orig/src/Makefile.am 2015-01-13 21:37:45.267200000 +0300 ++++ libtre/src/Makefile.am 2015-01-13 21:54:03.773400000 +0300 +@@ -1,7 +1,7 @@ + ## Process this file with automake to produce Makefile.in + + localedir = $(datadir)/locale +-INCLUDES = -I$(top_srcdir)/lib ++AM_CPPFLAGS = -I$(top_srcdir)/lib + + if TRE_AGREP + bin_PROGRAMS = agrep +diff -Naur libtre-orig/tests/Makefile.am libtre/tests/Makefile.am +--- libtre-orig/tests/Makefile.am 2015-01-13 21:37:45.267200000 +0300 ++++ libtre/tests/Makefile.am 2015-01-13 21:52:35.508600000 +0300 +@@ -59,7 +59,7 @@ + randtest_LDADD = libxtre.la $(LDADD) + endif !TRE_DEBUG + +-INCLUDES = -I$(top_srcdir)/lib ++AM_CPPFLAGS = -I$(top_srcdir)/lib + + EXTRA_DIST = build-tests.sh + diff --git a/mingw-w64-libtre-git/002-pointer-cast.patch b/mingw-w64-libtre-git/002-pointer-cast.patch new file mode 100644 index 0000000000..4df924ce8b --- /dev/null +++ b/mingw-w64-libtre-git/002-pointer-cast.patch @@ -0,0 +1,13 @@ +--- libtre/lib/tre-internal.h.orig 2015-01-13 23:45:59.325000000 +0300 ++++ libtre/lib/tre-internal.h 2015-01-14 00:12:06.954200000 +0300 +@@ -127,8 +127,8 @@ + /* Returns number of bytes to add to (char *)ptr to make it + properly aligned for the type. */ + #define ALIGN(ptr, type) \ +- ((((long)ptr) % sizeof(type)) \ +- ? (sizeof(type) - (((long)ptr) % sizeof(type))) \ ++ ((((intptr_t)ptr) % sizeof(type)) \ ++ ? (sizeof(type) - (((intptr_t)ptr) % sizeof(type))) \ + : 0) + + #undef MAX diff --git a/mingw-w64-libtre-git/PKGBUILD b/mingw-w64-libtre-git/PKGBUILD new file mode 100644 index 0000000000..9b336964fa --- /dev/null +++ b/mingw-w64-libtre-git/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Alexey Pavlov + +_realname=libtre +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git" +provides=("${MINGW_PACKAGE_PREFIX}-${_realname}") +conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgver=r122.c2f5d13 +pkgrel=1 +pkgdesc="The approximate regex matching library and agrep command line tool (mingw-w64)" +url="https://github.com/laurikari/tre" +arch=('any') +license=('BSD') +options=(strip staticlibs) +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "git") +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-gettext") +source=("${_realname}"::"git+https://github.com/laurikari/tre.git" + 001-autotools.patch + 002-pointer-cast.patch) +md5sums=('SKIP' + '2446ff21ecf7aed969d6cbfdf85f3b74' + 'eb7c4c23c61b59bdb9a2257e13244110') + +pkgver() { + cd "$srcdir/$_realname" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${_realname}" + patch -p1 -i ${srcdir}/001-autotools.patch + patch -p1 -i ${srcdir}/002-pointer-cast.patch + mv ChangeLog{.old,} + autoreconf -fiv +} + +build() { + mkdir -p build-${MINGW_CHOST} + cd build-${MINGW_CHOST} + ../${_realname}/configure \ + --prefix=${MINGW_PREFIX} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --build=${MINGW_CHOST} \ + --enable-shared \ + --enable-static + + make +} + +package() { + cd build-${MINGW_CHOST} + make DESTDIR=${pkgdir} install +}