libtre-git: New package.

This commit is contained in:
Alexpux
2015-01-14 00:25:55 +03:00
parent eecf6d93ac
commit 6c8a6eb2fa
3 changed files with 125 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,53 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_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
}