Browse Source

mingw-w64-libtre: added to repo

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
master
Steven Noonan 1 year ago
parent
commit
d220f306cc
Signed by: steven GPG Key ID: 408EEB508ED0CD4D
  1. 1
      mingw-w64-libtre/.gitignore
  2. 35
      mingw-w64-libtre/001-autotools.patch
  3. 13
      mingw-w64-libtre/002-pointer-cast.patch
  4. 60
      mingw-w64-libtre/PKGBUILD

1
mingw-w64-libtre/.gitignore

@ -0,0 +1 @@
/libtre

35
mingw-w64-libtre/001-autotools.patch

@ -0,0 +1,35 @@
diff --git a/configure.ac b/configure.ac
index e4a94af..fac4ed7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,10 +2,11 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(TRE, 0.8.0)
AC_CONFIG_SRCDIR([lib/regcomp.c])
AC_CONFIG_AUX_DIR(utils)
+AC_CONFIG_MACRO_DIRS([m4])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign])
-AC_PREREQ(2.59)
-AM_GNU_GETTEXT_VERSION(0.17)
+AC_PREREQ(2.69)
+AM_GNU_GETTEXT_VERSION(0.18)
dnl Checks for programs.
AC_PROG_CC
@@ -433,16 +434,6 @@ if test "$tre_enable_wchar" != "no"; then
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.
if test "$tre_enable_wchar" = "yes"; then

13
mingw-w64-libtre/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

60
mingw-w64-libtre/PKGBUILD

@ -0,0 +1,60 @@
# Maintainer: Andrew Sun <adsun701@gmail.com>
pkgname=mingw-w64-libtre
pkgver=0+r128+6fb7206
pkgrel=1
arch=(any)
pkgdesc="The approximate regex matching library and agrep command line tool (mingw-w64)"
depends=('mingw-w64-crt' 'mingw-w64-gettext')
makedepends=('mingw-w64-configure' 'mingw-w64-pkg-config' 'git')
provides=('mingw-w64-libtre')
conflicts=('mingw-w64-libtre')
options=(!strip !buildflags staticlibs)
license=("BSD")
url="https://github.com/laurikari/tre"
source=("libtre"::"git+https://github.com/laurikari/tre.git#commit=6fb7206"
001-autotools.patch
002-pointer-cast.patch)
md5sums=('SKIP'
'02e5246a85cec643b651527ad934f8da'
'eb7c4c23c61b59bdb9a2257e13244110')
pkgver() {
cd "$srcdir/libtre"
printf "0+r%s+%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
prepare() {
cd "${srcdir}/libtre"
patch -p1 -i "${srcdir}/001-autotools.patch"
patch -p1 -i "${srcdir}/002-pointer-cast.patch"
mv ChangeLog{.old,}
autoreconf -fiv
}
build() {
cd "${srcdir}/libtre"
for _arch in ${_architectures}; do
mkdir -p build-${_arch} && pushd build-${_arch}
${_arch}-configure \
--enable-shared \
--enable-static \
--without-libintl-prefix
make
popd
done
}
package() {
for _arch in ${_architectures}; do
cd "${srcdir}/libtre/build-${_arch}"
make DESTDIR="$pkgdir" install
${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.exe
${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
install -Dm644 "${srcdir}/libtre/LICENSE" "${pkgdir}/usr/${_arch}/share/licenses/libtre/LICENSE"
done
}
Loading…
Cancel
Save