commit:     f202e754d285ee905cac3f7f1b1948a5430ab029
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May  6 08:32:09 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May  6 08:32:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f202e754

media-libs/flickcurl: fix modern C issues

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

 .../files/flickcurl-1.26-c99-configure.patch       |  23 ++
 .../flickcurl/files/flickcurl-1.26-c99.patch       | 261 +++++++++++++++++++++
 ...ckcurl-1.26.ebuild => flickcurl-1.26-r1.ebuild} |  11 +-
 3 files changed, 293 insertions(+), 2 deletions(-)

diff --git a/media-libs/flickcurl/files/flickcurl-1.26-c99-configure.patch 
b/media-libs/flickcurl/files/flickcurl-1.26-c99-configure.patch
new file mode 100644
index 000000000000..40fc7ff7b141
--- /dev/null
+++ b/media-libs/flickcurl/files/flickcurl-1.26-c99-configure.patch
@@ -0,0 +1,23 @@
+https://bugs.gentoo.org/899812
+https://github.com/dajobe/flickcurl/pull/43
+
+From 940019e2635f1bc21b712fadbf4f73ca45a26379 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Fri, 13 Jan 2023 09:33:08 +0100
+Subject: [PATCH] configure: Include <stdio.h> in vsnprintf check
+
+Avoid implicit declaration of vsnprintf for improved C99
+compatibility.  Otherwise the configure script will fail
+to detect vsnprintf support with future compilers which
+do not support implicit function declarations.
+--- a/configure.ac
++++ b/configure.ac
+@@ -133,6 +133,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_GETOPT_H
+ if test $ac_cv_func_vsnprintf = yes; then
+   AC_MSG_CHECKING(vsnprintf has C99 compatible return value)
+   AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdarg.h>
++#include <stdio.h>
+ int is_c99(char *s, ...) {
+   char buffer[32];
+   va_list args;
+

diff --git a/media-libs/flickcurl/files/flickcurl-1.26-c99.patch 
b/media-libs/flickcurl/files/flickcurl-1.26-c99.patch
new file mode 100644
index 000000000000..ef2d48ca7ea0
--- /dev/null
+++ b/media-libs/flickcurl/files/flickcurl-1.26-c99.patch
@@ -0,0 +1,261 @@
+https://github.com/dajobe/flickcurl/pull/44
+
+From 96f263150cf025bdcf969fc9884cc90a466f54fb Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Mon, 6 May 2024 09:28:24 +0100
+Subject: [PATCH] Fix -Wimplicit-function-declaration
+
+GCC 14 and Clang 16 make this fatal by default.
+
+Bug: https://bugs.gentoo.org/927191
+--- a/src/activity.c
++++ b/src/activity.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/args.c
++++ b/src/args.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/blog.c
++++ b/src/blog.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/category.c
++++ b/src/category.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/collection.c
++++ b/src/collection.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/comments.c
++++ b/src/comments.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/contacts.c
++++ b/src/contacts.c
+@@ -24,6 +24,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/context.c
++++ b/src/context.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/exif.c
++++ b/src/exif.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/gallery.c
++++ b/src/gallery.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/group.c
++++ b/src/group.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/legacy-auth.c
++++ b/src/legacy-auth.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/members.c
++++ b/src/members.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/method.c
++++ b/src/method.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/note.c
++++ b/src/note.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/oauth.c
++++ b/src/oauth.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/perms.c
++++ b/src/perms.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/photo.c
++++ b/src/photo.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ #include <ctype.h>
+ 
+ #ifdef HAVE_CONFIG_H
+--- a/src/photoset.c
++++ b/src/photoset.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/sha1.c
++++ b/src/sha1.c
+@@ -92,6 +92,7 @@ A million repetitions of "a"
+ #include <string.h>
+ #include <stdarg.h>
+ #include <stdint.h>
++#include <stdlib.h>
+ 
+ #include <flickcurl.h>
+ #include <flickcurl_internal.h>
+--- a/src/size.c
++++ b/src/size.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/stat.c
++++ b/src/stat.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/tags.c
++++ b/src/tags.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/ticket.c
++++ b/src/ticket.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+--- a/src/user_upload_status.c
++++ b/src/user_upload_status.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+

diff --git a/media-libs/flickcurl/flickcurl-1.26.ebuild 
b/media-libs/flickcurl/flickcurl-1.26-r1.ebuild
similarity index 81%
rename from media-libs/flickcurl/flickcurl-1.26.ebuild
rename to media-libs/flickcurl/flickcurl-1.26-r1.ebuild
index 12c6109fe72b..d9b5b56ddfec 100644
--- a/media-libs/flickcurl/flickcurl-1.26.ebuild
+++ b/media-libs/flickcurl/flickcurl-1.26-r1.ebuild
@@ -17,11 +17,18 @@ IUSE="raptor"
 RDEPEND="
        >=net-misc/curl-7.10.0
        >=dev-libs/libxml2-2.6.8:2
-       raptor? ( media-libs/raptor:2 )"
+       raptor? ( media-libs/raptor:2 )
+"
 DEPEND="${RDEPEND}"
 BDEPEND="
        dev-build/gtk-doc-am
-       virtual/pkgconfig"
+       virtual/pkgconfig
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.26-c99-configure.patch
+       "${FILESDIR}"/${PN}-1.26-c99.patch
+)
 
 src_prepare() {
        default

Reply via email to