summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Zou2017-02-06 19:08:47 +0100
committerMichel Zou2017-02-06 19:08:47 +0100
commit794600abf646c71166ef515bbeea64d25757bced (patch)
treebe8538847006e37803bd6ff6f1e3b6fadea2ae6b
downloadaur-794600abf646c71166ef515bbeea64d25757bced.tar.gz
0.16
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD47
-rw-r--r--libidn2-mingw.patch95
3 files changed, 164 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6e835b3e7bf8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+# Generated by mksrcinfo v8
+# Mon Feb 6 18:08:47 UTC 2017
+pkgbase = mingw-w64-libidn2
+ pkgdesc = A free software implementation of IDNA2008 (mingw-w64)
+ pkgver = 0.16
+ pkgrel = 1
+ url = http://www.gnu.org/software/libidn
+ arch = any
+ license = GPL3, LGPL3
+ makedepends = mingw-w64-configure
+ depends = mingw-w64-crt
+ depends = mingw-w64-libunistring
+ options = staticlibs
+ options = !strip
+ options = !buildflags
+ source = http://alpha.gnu.org/gnu/libidn/libidn2-0.16.tar.gz
+ source = libidn2-mingw.patch
+ sha1sums = 26311b538897a8ed0569922132f2139ee3ec6a28
+ sha1sums = SKIP
+
+pkgname = mingw-w64-libidn2
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..43baea5c85fe
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+pkgname=mingw-w64-libidn2
+pkgver=0.16
+pkgrel=1
+pkgdesc="A free software implementation of IDNA2008 (mingw-w64)"
+arch=(any)
+url="http://www.gnu.org/software/libidn"
+license=("GPL3, LGPL3")
+makedepends=(mingw-w64-configure)
+depends=(mingw-w64-crt mingw-w64-libunistring)
+options=(staticlibs !strip !buildflags)
+source=("http://alpha.gnu.org/gnu/libidn/libidn2-${pkgver}.tar.gz"
+ libidn2-mingw.patch)
+sha1sums=('26311b538897a8ed0569922132f2139ee3ec6a28'
+ SKIP)
+
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+prepare() {
+ cd "${srcdir}/libidn2-${pkgver}"
+ # undefined refs to getline, error
+ patch -p1 -i "${srcdir}"/libidn2-mingw.patch
+ # do not build tr46map_data.c/gentr46map.c
+ sed -i "66,71d" Makefile.am
+ # disable doc
+ sed -i "s|src doc|src|g" Makefile.am
+ autoreconf -vfi
+}
+
+build() {
+ cd "${srcdir}/libidn2-${pkgver}"
+ for _arch in ${_architectures}; do
+ mkdir -p build-${_arch} && pushd build-${_arch}
+ ${_arch}-configure --disable-nls
+ make
+ popd
+ done
+}
+
+package() {
+ for _arch in ${_architectures}; do
+ cd "${srcdir}/libidn2-${pkgver}/build-${_arch}"
+ make DESTDIR="$pkgdir" install
+ 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/libidn2-mingw.patch b/libidn2-mingw.patch
new file mode 100644
index 000000000000..173100af1fc1
--- /dev/null
+++ b/libidn2-mingw.patch
@@ -0,0 +1,95 @@
+diff -ur libidn2-0.16.orig/src/idn2.c libidn2-0.16/src/idn2.c
+--- libidn2-0.16.orig/src/idn2.c 2017-02-06 18:33:44.840135786 +0100
++++ libidn2-0.16/src/idn2.c 2017-02-06 18:59:32.753490461 +0100
+@@ -42,6 +42,68 @@
+
+ #include "blurbs.h"
+
++
++size_t getline(char **lineptr, size_t *n, FILE *stream) {
++ char *bufptr = NULL;
++ char *p = bufptr;
++ size_t size;
++ int c;
++
++ if (lineptr == NULL) {
++ return -1;
++ }
++ if (stream == NULL) {
++ return -1;
++ }
++ if (n == NULL) {
++ return -1;
++ }
++ bufptr = *lineptr;
++ size = *n;
++
++ c = fgetc(stream);
++ if (c == EOF) {
++ return -1;
++ }
++ if (bufptr == NULL) {
++ bufptr = malloc(128);
++ if (bufptr == NULL) {
++ return -1;
++ }
++ size = 128;
++ }
++ p = bufptr;
++ while(c != EOF) {
++ if ((p - bufptr) > (size - 1)) {
++ size = size + 128;
++ bufptr = realloc(bufptr, size);
++ if (bufptr == NULL) {
++ return -1;
++ }
++ }
++ *p++ = c;
++ if (c == '\n') {
++ break;
++ }
++ c = fgetc(stream);
++ }
++
++ *p++ = '\0';
++ *lineptr = bufptr;
++ *n = size;
++
++ return p - bufptr - 1;
++}
++
++
++
++
++
++
++
++
++
++
+ const char version_etc_copyright[] =
+ /* Do *not* mark this string for translation. %s is a copyright
+ symbol suitable for this locale, and %d is the copyright
+@@ -161,9 +223,10 @@
+ free (output);
+ }
+ else
+- error (EXIT_FAILURE, 0, "%s: %s",
++ exit(EXIT_FAILURE);
++ /*error (EXIT_FAILURE, 0, "%s: %s",
+ args_info.register_given ? "register" : "lookup",
+- idn2_strerror (rc));
++ idn2_strerror (rc));*/
+ }
+
+ int
+@@ -222,7 +285,8 @@
+ }
+
+ if (ferror (stdin))
+- error (EXIT_FAILURE, errno, "%s", _("input error"));
++ exit(EXIT_FAILURE);
++ /*error (EXIT_FAILURE, errno, "%s", _("input error"));*/
+
+ cmdline_parser_free (&args_info);
+