quota: prepare for musl 1.2.2

This commit is contained in:
Đoàn Trần Công Danh 2021-02-05 18:04:13 +07:00
parent a0e654bf82
commit c4329c58ae
2 changed files with 32 additions and 4 deletions

View File

@ -0,0 +1,29 @@
Index: configure.ac
===================================================================
--- configure.ac.orig
+++ configure.ac
@@ -38,6 +38,9 @@ AC_C_INLINE
AC_CHECK_FUNC([nl_langinfo], [
AC_DEFINE([HAVE_NL_LANGINFO], 1, [Use nl_langinfo for querying locale])
])
+AC_CHECK_DECLS([reallocarray],[
+ AC_DEFINE([HAVE_REALLOCARRAY], 1, [Have reallocarray])
+])
# ===============
# Gettext support
Index: quota.c
===================================================================
--- quota.c.orig
+++ quota.c
@@ -48,6 +48,10 @@
#define FL_SHOW_DEVICE 32768
#define FL_PROJECT 65536
+#ifndef HAVE_REALLOCARRAY
+#define reallocarray(o,n,s) realloc(o,n*s)
+#endif
+
static int flags, fmt = -1;
static enum s2s_unit spaceunit = S2S_NONE, inodeunit = S2S_NONE;
char *progname;

View File

@ -14,10 +14,9 @@ homepage="https://sourceforge.net/projects/linuxquota/"
distfiles="${SOURCEFORGE_SITE}/linuxquota/quota-tools/${pkgname}-${version}.tar.gz"
checksum=2f3e03039f378d4f0d97acdb49daf581dcaad64d2e1ddf129495fd579fbd268d
case "$XBPS_TARGET_MACHINE" in
# Only used in places where overflow is not possible.
*-musl) CFLAGS+=' -Dreallocarray\(o,n,s\)=realloc\(o,n*s\)';;
esac
pre_configure() {
autoreconf -fi
}
post_install() {
rm -rf ${DESTDIR}/usr/include/rpcsvc ${DESTDIR}/usr/share/doc/quota