aboutsummaryrefslogtreecommitdiffstats
path: root/main/m4
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-09 19:55:16 -0600
committerWilliam Pitcock <nenolod@dereferenced.org>2018-02-10 03:08:31 +0000
commitc92a7291387abc01e47ee1495558fd2c727a57bd (patch)
treeb8d4ba956cf2177146b62ff0e3572bd5fcd2a8ab /main/m4
parent80b1c4bc0b8a88ad34cc88a972deaad90ae659ce (diff)
downloadaports-c92a7291387abc01e47ee1495558fd2c727a57bd.tar.bz2
aports-c92a7291387abc01e47ee1495558fd2c727a57bd.tar.xz
main/m4: add test suite, fix license, modernise
Diffstat (limited to 'main/m4')
-rw-r--r--main/m4/APKBUILD32
-rw-r--r--main/m4/disable-mbrtowc-test.patch10
-rw-r--r--main/m4/localename-test-fix.patch34
3 files changed, 60 insertions, 16 deletions
diff --git a/main/m4/APKBUILD b/main/m4/APKBUILD
index 84a701ca03..b066eeed61 100644
--- a/main/m4/APKBUILD
+++ b/main/m4/APKBUILD
@@ -1,40 +1,40 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=m4
pkgver=1.4.18
-pkgrel=0
+pkgrel=1
pkgdesc="GNU macro processor"
url="https://www.gnu.org/software/m4"
depends=
makedepends=texinfo
arch="all"
-license="GPL"
+license="GPL-3.0+"
subpackages="m4-doc"
source="ftp://ftp.gnu.org/gnu/m4/$pkgname-$pkgver.tar.gz
+ disable-mbrtowc-test.patch
+ localename-test-fix.patch
"
-_builddir="$srcdir"/$pkgname-$pkgver
-
-prepare() {
- cd "$_builddir"
-}
-
build() {
- cd "$_builddir"
- LIBS="-lrt" ./configure \
+ cd "$builddir"
+ ./configure \
--build=$CBUILD \
--host=$CHOST \
- --prefix=/usr \
- || return 1
+ --prefix=/usr
make
}
+check() {
+ cd "$builddir"
+ make check
+}
+
package() {
- cd "$_builddir"
+ cd "$builddir"
make install DESTDIR="$pkgdir"
rm -rf "$pkgdir"/usr/lib/charset.alias
rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
}
-md5sums="a077779db287adf4e12a035029002d28 m4-1.4.18.tar.gz"
-sha256sums="ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab m4-1.4.18.tar.gz"
-sha512sums="29254dd4267a093e8d9da3a26df8b02564044cdb4506be539ec1aff4e5d406477bcf32f5e813c840f3aec77293bfe2cdde18f6a21724a7e0bfff646ec88b74ae m4-1.4.18.tar.gz"
+sha512sums="29254dd4267a093e8d9da3a26df8b02564044cdb4506be539ec1aff4e5d406477bcf32f5e813c840f3aec77293bfe2cdde18f6a21724a7e0bfff646ec88b74ae m4-1.4.18.tar.gz
+78bf099c96fcec8c9cebd4e34f0d7c942e99da2ec238baa9464f8443580edb0565e9026c433ee54fb564304ec8e7e90766e19474472e57b48e567fd7b356777e disable-mbrtowc-test.patch
+fac0cb58e698996284a222c4da340f92689d6db98f1fbab6e61e1c5f2d90122660296f8e5c60c94169413e3e2ee632c6264f12b98e5d3a1e1aae145a2d4aac45 localename-test-fix.patch"
diff --git a/main/m4/disable-mbrtowc-test.patch b/main/m4/disable-mbrtowc-test.patch
new file mode 100644
index 0000000000..cc2be24786
--- /dev/null
+++ b/main/m4/disable-mbrtowc-test.patch
@@ -0,0 +1,10 @@
+--- m4-1.4.18/tests/test-mbrtowc5.sh.old 2016-12-31 13:54:43.000000000 +0000
++++ m4-1.4.18/tests/test-mbrtowc5.sh 2017-07-30 17:29:50.879924130 +0000
+@@ -1,6 +1,2 @@
+ #!/bin/sh
+-# Test whether the POSIX locale has encoding errors.
+-LC_ALL=C \
+-./test-mbrtowc${EXEEXT} 5 || exit
+-LC_ALL=POSIX \
+-./test-mbrtowc${EXEEXT} 5
++exit 77
diff --git a/main/m4/localename-test-fix.patch b/main/m4/localename-test-fix.patch
new file mode 100644
index 0000000000..04584aba66
--- /dev/null
+++ b/main/m4/localename-test-fix.patch
@@ -0,0 +1,34 @@
+--- m4-1.4.18/tests/localename.c.old 2016-12-31 13:54:43.000000000 +0000
++++ m4-1.4.18/tests/localename.c 2017-07-30 16:40:47.098541270 +0000
+@@ -40,7 +40,7 @@
+ # if defined __APPLE__ && defined __MACH__
+ # include <xlocale.h>
+ # endif
+-# if __GLIBC__ >= 2 && !defined __UCLIBC__
++# if defined __linux__
+ # include <langinfo.h>
+ # endif
+ # if !defined IN_LIBINTL
+@@ -2692,16 +2692,19 @@
+ locale_t thread_locale = uselocale (NULL);
+ if (thread_locale != LC_GLOBAL_LOCALE)
+ {
+-# if __GLIBC__ >= 2 && !defined __UCLIBC__
++# if defined(_NL_LOCALE_NAME)
++ const char *name = nl_langinfo(_NL_LOCALE_NAME(category));
++# if __GLIBC__ >= 2 && !defined __UCLIBC__
+ /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
+ glibc < 2.12.
+ See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>. */
+- const char *name =
+- nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
++ if (name[0] == '\0')
++ name = nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
+ if (name[0] == '\0')
+ /* Fallback code for glibc < 2.4, which did not implement
+ nl_langinfo (_NL_LOCALE_NAME (category)). */
+ name = thread_locale->__names[category];
++# endif
+ return name;
+ # elif defined __FreeBSD__ || (defined __APPLE__ && defined __MACH__)
+ /* FreeBSD, Mac OS X */