commit:     2aff7c0e30e88ff7120bbf2e0e67a3af00c6ad40
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 03:15:22 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 03:15:34 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2aff7c0e

sys-fs/quotatool: fix build w/ Clang 16, musl

Closes: https://bugs.gentoo.org/831289
Closes: https://bugs.gentoo.org/875416
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../quotatool/files/quotatool-1.6.2-clang16.patch  |  32 +++++
 .../files/quotatool-1.6.2-fix-autoconf.patch       | 133 +++++++++++++++++++++
 .../quotatool/files/quotatool-1.6.2-warnings.patch |  67 +++++++++++
 ...tool-1.6.2.ebuild => quotatool-1.6.2-r1.ebuild} |   9 +-
 4 files changed, 239 insertions(+), 2 deletions(-)

diff --git a/sys-fs/quotatool/files/quotatool-1.6.2-clang16.patch 
b/sys-fs/quotatool/files/quotatool-1.6.2-clang16.patch
new file mode 100644
index 000000000000..e68ed5f53814
--- /dev/null
+++ b/sys-fs/quotatool/files/quotatool-1.6.2-clang16.patch
@@ -0,0 +1,32 @@
+https://github.com/ekenberg/quotatool/commit/ad6944baaa73cf6230f9a2bef2399b31c2130547
+
+From ad6944baaa73cf6230f9a2bef2399b31c2130547 Mon Sep 17 00:00:00 2001
+From: Bas Zoetekouw <bas.zoetek...@surfnet.nl>
+Date: Thu, 9 Aug 2018 22:11:58 +0200
+Subject: [PATCH] fix compiler warnings
+
+--- a/src/output.h
++++ b/src/output.h
+@@ -17,8 +17,8 @@
+ 
+ extern int output_level;
+ 
+-inline void   output_version (void);
+-inline void   output_help (void);
++void   output_version (void);
++void   output_help (void);
+ 
+ void   output_debug (const char *format, ...);
+ void   output_info (const char *format, ...);
+--- a/src/quota.h
++++ b/src/quota.h
+@@ -110,7 +110,7 @@ void        quota_delete   (quota_t *myquota);
+ int         quota_get      (quota_t *myquota);
+ int         quota_set      (quota_t *myquota);
+ 
+-int         xfs_reset_grace(quota_t *myquota, int grace_type);
++int         quota_reset_grace(quota_t *myquota, int grace_type);
+ 
+ 
+ #endif /* INCLUDE_QUOTATOOL_QUOTA */
+

diff --git a/sys-fs/quotatool/files/quotatool-1.6.2-fix-autoconf.patch 
b/sys-fs/quotatool/files/quotatool-1.6.2-fix-autoconf.patch
new file mode 100644
index 000000000000..5d681bb7132f
--- /dev/null
+++ b/sys-fs/quotatool/files/quotatool-1.6.2-fix-autoconf.patch
@@ -0,0 +1,133 @@
+https://github.com/ekenberg/quotatool/commit/b42fbba1c2a863b726d30b0d80471e76c82ec801
+https://github.com/ekenberg/quotatool/commit/2b773bb36135ede595bb2305663aec809edc8d35
+
+From b42fbba1c2a863b726d30b0d80471e76c82ec801 Mon Sep 17 00:00:00 2001
+From: Bas Zoetekouw <bas.zoetek...@surfnet.nl>
+Date: Tue, 12 Feb 2019 15:35:34 +0100
+Subject: [PATCH] make configure.in work with recent autoconf
+
+--- a/configure.in
++++ b/configure.in
+@@ -1,6 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+ 
+-AC_INIT(src/main.c)
++AC_INIT
++AC_CONFIG_SRCDIR([src/main.c])
+ AC_CONFIG_AUX_DIR(tools)
+ 
+ 
+@@ -17,20 +18,20 @@ dnl 
---------------------------------------------------------------------------
+ dnl Set program, version info
+ PROGNAME=quotatool
+ AC_SUBST(PROGNAME)
+-AC_DEFINE_UNQUOTED(PROGNAME, "$PROGNAME")
++AC_DEFINE_UNQUOTED(PROGNAME, "$PROGNAME", [Name of the current program])
+ 
+ AC_SUBST(MAJOR_VERSION)
+-AC_DEFINE_UNQUOTED(MAJOR_VERSION, $MAJOR_VERSION)
++AC_DEFINE_UNQUOTED(MAJOR_VERSION, $MAJOR_VERSION, [Major version number])
+ 
+ AC_SUBST(MINOR_VERSION)
+-AC_DEFINE_UNQUOTED(MINOR_VERSION, $MINOR_VERSION)
++AC_DEFINE_UNQUOTED(MINOR_VERSION, $MINOR_VERSION, [Minor version number])
+ 
+ AC_SUBST(PATCHLEVEL)
+-AC_DEFINE_UNQUOTED(PATCHLEVEL, "$PATCHLEVEL")
++AC_DEFINE_UNQUOTED(PATCHLEVEL, "$PATCHLEVEL", [Patch level version number])
+ 
+-AC_DEFINE_UNQUOTED(COPYRIGHT_NOTICE, "$COPYRIGHT_NOTICE")
++AC_DEFINE_UNQUOTED(COPYRIGHT_NOTICE, "$COPYRIGHT_NOTICE", [Copyright notice])
+ 
+-AC_DEFINE_UNQUOTED(WWW_URL, "$WWW_URL")
++AC_DEFINE_UNQUOTED(WWW_URL, "$WWW_URL", [Upstream homepage])
+ 
+ dnl get the system type (for the makefile)
+ 
+@@ -38,31 +39,31 @@ AC_CANONICAL_HOST
+ case [$host] in
+   *linux*)
+       PLATFORM=linux
+-      AC_DEFINE(PLATFORM_LINUX, 1)
++      AC_DEFINE(PLATFORM_LINUX, 1, [Is this a Linux platform?])
+       ;;
+   *solaris*)
+       PLATFORM=solaris
+-      AC_DEFINE(PLATFORM_SOLARIS, 1)
++      AC_DEFINE(PLATFORM_SOLARIS, 1, [Is this a Solaris platform?])
+       ;;
+   *aix*)
+       PLATFORM=aix
+-      AC_DEFINE(PLATFORM_AIX, 1)
++      AC_DEFINE(PLATFORM_AIX, 1, [Is this an AIX platform?])
+       ;;
+   *freebsd*|*openbsd*|*netbsd*)
+       PLATFORM=bsd
+-      AC_DEFINE(PLATFORM_BSD, 1)
++      AC_DEFINE(PLATFORM_BSD, 1, [Is this a *BSD platform?])
+       ;;
+   *apple-darwin*)
+         PLATFORM=darwin
+-        AC_DEFINE(PLATFORM_DARWIN, 1)
++        AC_DEFINE(PLATFORM_DARWIN, 1, [Is this an OSX platform?])
+         ;;
+   *)
+       PLATFORM=unknown
+-      AC_DEFINE(PLATFORM_UNKNOWN, 1)
++      AC_DEFINE(PLATFORM_UNKNOWN, 1, [Is this an unknown platform?])
+       ;;
+ esac
+ AC_SUBST(PLATFORM)
+-AC_DEFINE_UNQUOTED(PLATFORM, $PLATFORM)
++AC_DEFINE_UNQUOTED(PLATFORM, $PLATFORM, [Name of the current platform])
+ 
+ dnl Check for programs.
+ 
+@@ -106,13 +107,13 @@ AC_C_CONST
+ AC_TYPE_UID_T
+ AC_C_INLINE
+ AC_CHECK_TYPE(u_int64_t, HAVE_U_INT64_T=1, HAVE_U_INT64_T=0)
+-AC_DEFINE_UNQUOTED(HAVE_U_INT64_T, $HAVE_U_INT64_T)
++AC_DEFINE_UNQUOTED(HAVE_U_INT64_T, $HAVE_U_INT64_T, [Can we use uint64_t?])
+ 
+ dnl Check for library functions.
+ 
+ AC_FUNC_VPRINTF
+ AC_CHECK_FUNCS(strdup strerror strtol strtod strchr)
+-test [x$PLATFORM] = [xlinux] &&  AC_DEFINE(HAVE_GNU_GETOPT, 1)
++test [x$PLATFORM] = [xlinux] &&  AC_DEFINE(HAVE_GNU_GETOPT, 1, [Can we use 
GNU getopt?])
+ 
+ dnl check for strlcpy and strlcat (mostly BSD)
+ AC_CHECK_FUNCS(strlcpy strlcat)
+@@ -121,9 +122,10 @@ dnl Check the commandline
+ 
+ AC_ARG_WITH(gnu-getopt,  \
+   [--with-gnu-getopt       getopt() is GNU getopt],\
+-            test [x$withval] != [xno] || AC_DEFINE(HAVE_GNU_GETOPT, 1))
++            test [x$withval] != [xno] || AC_DEFINE(HAVE_GNU_GETOPT, 1), [Can 
we use GNU getopt?])
+ 
+ dnl Create output files
+ 
+ AC_CONFIG_HEADER(src/config.h)
+-AC_OUTPUT(local.mk)
++AC_CONFIG_FILES([local.mk])
++AC_OUTPUT
+
+From 2b773bb36135ede595bb2305663aec809edc8d35 Mon Sep 17 00:00:00 2001
+From: Bas Zoetekouw <b...@debian.org>
+Date: Wed, 13 Feb 2019 09:00:41 +0100
+Subject: [PATCH] Update configure.in
+
+Misplaced brace
+--- a/configure.in
++++ b/configure.in
+@@ -122,7 +122,7 @@ dnl Check the commandline
+ 
+ AC_ARG_WITH(gnu-getopt,  \
+   [--with-gnu-getopt       getopt() is GNU getopt],\
+-            test [x$withval] != [xno] || AC_DEFINE(HAVE_GNU_GETOPT, 1), [Can 
we use GNU getopt?])
++            test [x$withval] != [xno] || AC_DEFINE(HAVE_GNU_GETOPT, 1, [Can 
we use GNU getopt?]))
+ 
+ dnl Create output files
+ 
+

diff --git a/sys-fs/quotatool/files/quotatool-1.6.2-warnings.patch 
b/sys-fs/quotatool/files/quotatool-1.6.2-warnings.patch
new file mode 100644
index 000000000000..0598f86b489b
--- /dev/null
+++ b/sys-fs/quotatool/files/quotatool-1.6.2-warnings.patch
@@ -0,0 +1,67 @@
+https://github.com/ekenberg/quotatool/commit/09695c944947d804cbe3b5c7e2c854953984413e
+https://github.com/ekenberg/quotatool/commit/af27842d1a6640d932407999ceec57f54a225a78
+
+From 09695c944947d804cbe3b5c7e2c854953984413e Mon Sep 17 00:00:00 2001
+From: Bas Zoetekouw <bas.zoetek...@surfnet.nl>
+Date: Thu, 9 Aug 2018 22:17:22 +0200
+Subject: [PATCH] fix implicit fallthrough
+
+--- a/src/parse.c
++++ b/src/parse.c
+@@ -268,6 +268,7 @@ argdata_t *parse_commandline (int argc, char **argv)
+ 
+     case '?':
+       output_error ("Unrecognized option: '%c'", optopt);
++      __attribute__ ((fallthrough));
+ 
+     default:
+       output_help();
+
+
+From af27842d1a6640d932407999ceec57f54a225a78 Mon Sep 17 00:00:00 2001
+From: Johan Ekenberg <johan.ekenb...@gmail.com>
+Date: Mon, 1 Apr 2019 13:19:08 +0200
+Subject: [PATCH] Fix compiler warnings
+
+__P() seems to not be used with modern compilers
+Fix switch-case attribute fallthrough warning
+--- a/src/linux/linux_quota.h
++++ b/src/linux/linux_quota.h
+@@ -117,7 +117,7 @@ struct if_dqinfo {
+       #endif
+ #endif
+ 
+-long quotactl __P((int, const char *, qid_t, caddr_t));
++long quotactl (int, const char *, qid_t, caddr_t);
+ 
+ /*
+  * runtime detection of quota format
+@@ -139,16 +139,3 @@ int kern_quota_format(fs_t *, int);
+ #include "xfs_quota.h"
+ 
+ #endif /* _QUOTA_ */
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+--- a/src/parse.c
++++ b/src/parse.c
+@@ -268,7 +268,7 @@ argdata_t *parse_commandline (int argc, char **argv)
+ 
+     case '?':
+       output_error ("Unrecognized option: '%c'", optopt);
+-      __attribute__ ((fallthrough));
++      // fall through
+ 
+     default:
+       output_help();
+

diff --git a/sys-fs/quotatool/quotatool-1.6.2.ebuild 
b/sys-fs/quotatool/quotatool-1.6.2-r1.ebuild
similarity index 68%
rename from sys-fs/quotatool/quotatool-1.6.2.ebuild
rename to sys-fs/quotatool/quotatool-1.6.2-r1.ebuild
index 29880c32b907..6cee45a2deba 100644
--- a/sys-fs/quotatool/quotatool-1.6.2.ebuild
+++ b/sys-fs/quotatool/quotatool-1.6.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -15,7 +15,12 @@ KEYWORDS="amd64 ~arm ~arm64 ppc x86"
 
 RDEPEND="sys-fs/quota"
 
-PATCHES=( "${FILESDIR}"/${PN}-1.4.13-fix-buildsystem.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.4.13-fix-buildsystem.patch
+       "${FILESDIR}"/${P}-clang16.patch
+       "${FILESDIR}"/${P}-fix-autoconf.patch
+       "${FILESDIR}"/${P}-warnings.patch
+)
 
 src_configure() {
        tc-export CC

Reply via email to