From c4329c58ae1ab18534fdf5721e4db42541a335dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 5 Feb 2021 18:04:13 +0700 Subject: [PATCH] quota: prepare for musl 1.2.2 --- srcpkgs/quota/patches/reallocarray.patch | 29 ++++++++++++++++++++++++ srcpkgs/quota/template | 7 +++--- 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/quota/patches/reallocarray.patch diff --git a/srcpkgs/quota/patches/reallocarray.patch b/srcpkgs/quota/patches/reallocarray.patch new file mode 100644 index 00000000000..b269f5ab3b5 --- /dev/null +++ b/srcpkgs/quota/patches/reallocarray.patch @@ -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; diff --git a/srcpkgs/quota/template b/srcpkgs/quota/template index d4fa3d04edb..2751287061f 100644 --- a/srcpkgs/quota/template +++ b/srcpkgs/quota/template @@ -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