summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Sun2017-11-12 17:00:00 +0000
committerAndrew Sun2017-11-12 17:00:00 +0000
commitdc93e171069fd008df51d7ce9e3ead0064b1af93 (patch)
tree16be8f8dc8facde684635546a408f7c18273b5f4
downloadaur-dc93e171069fd008df51d7ce9e3ead0064b1af93.tar.gz
add mingw-w64-libtre-git
-rw-r--r--.SRCINFO24
-rw-r--r--001-autotools.patch35
-rw-r--r--002-pointer-cast.patch13
-rw-r--r--PKGBUILD55
4 files changed, 127 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d6a800eb2fc1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = mingw-w64-libtre-git
+ pkgdesc = The approximate regex matching library and agrep command line tool (mingw-w64)
+ pkgver = r128.6fb7206
+ pkgrel = 1
+ url = https://github.com/laurikari/tre
+ arch = any
+ license = BSD
+ makedepends = mingw-w64-configure
+ makedepends = mingw-w64-pkg-config
+ makedepends = git
+ depends = mingw-w64-crt
+ depends = mingw-w64-gettext
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = libtre::git+https://github.com/laurikari/tre.git#commit=6fb7206
+ source = 001-autotools.patch
+ source = 002-pointer-cast.patch
+ md5sums = SKIP
+ md5sums = 02e5246a85cec643b651527ad934f8da
+ md5sums = eb7c4c23c61b59bdb9a2257e13244110
+
+pkgname = mingw-w64-libtre-git
+
diff --git a/001-autotools.patch b/001-autotools.patch
new file mode 100644
index 000000000000..d6aa83f00cd1
--- /dev/null
+++ b/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
diff --git a/002-pointer-cast.patch b/002-pointer-cast.patch
new file mode 100644
index 000000000000..4df924ce8b34
--- /dev/null
+++ b/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/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..dd8695b09f5e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+# Maintainer: Andrew Sun <adsun701@gmail.com>
+
+pkgname=mingw-w64-libtre-git
+pkgver=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')
+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 "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
+ install -Dm644 "${srcdir}/libtre/LICENSE" "${pkgdir}/usr/${_arch}/share/licenses/libtre/LICENSE"
+ done
+}