From 7b78276d390c0a52d056ff045cfa71c41c2328b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 23 Apr 2023 12:24:03 +0200
Subject: [PATCH] community/vorbisgain: fix implicit isatty(3) declaration

Technically a warning and not an error but still good to fix.
---
 community/vorbisgain/APKBUILD           |  4 +++-
 community/vorbisgain/fix-implicit.patch | 13 +++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 community/vorbisgain/fix-implicit.patch

diff --git a/community/vorbisgain/APKBUILD b/community/vorbisgain/APKBUILD
index 51c77b33c729..20a8dca6805d 100644
--- a/community/vorbisgain/APKBUILD
+++ b/community/vorbisgain/APKBUILD
@@ -10,7 +10,8 @@ license="GPL-2.0-only"
 makedepends="libvorbis-dev"
 subpackages="$pkgname-doc"
 source="https://sjeng.org/ftp/vorbis/vorbisgain-$pkgver.tar.gz
-	fix-format-string.patch"
+	fix-format-string.patch
+	fix-implicit.patch"
 
 build() {
 	./configure \
@@ -35,4 +36,5 @@ package() {
 sha512sums="
 67181834e1a0d7c6e1ccd984e2d30ebf1dcdff84caa77f75e5e771de8414904810e966a43852b7184e075d2428fd8b431124835efc370ce6504b8b2756746e04  vorbisgain-0.37.tar.gz
 205213d2600c1e54972f06b13d91ca5d2ca482a83051d6264e6cf59fceca03daf95997acc06ed7e4f3b3e2d8d542f6196ff3812681e8ccf7a53b5da33a093060  fix-format-string.patch
+1589f8f281f636386e224da18915da368d3662a7620a08c9770623511f6a1a51f4083ae6e797cc5a732d44046e0480bbe875eeabb020d995ef9c1bfe583820d2  fix-implicit.patch
 "
diff --git a/community/vorbisgain/fix-implicit.patch b/community/vorbisgain/fix-implicit.patch
new file mode 100644
index 000000000000..d31d0bc74aae
--- /dev/null
+++ b/community/vorbisgain/fix-implicit.patch
@@ -0,0 +1,13 @@
+Fix implicit declaration of isatty(3) by including unistd.h
+
+diff -upr vorbisgain-0.37.orig/misc.c vorbisgain-0.37/misc.c
+--- vorbisgain-0.37.orig/misc.c	2023-04-23 10:30:54.226230204 +0200
++++ vorbisgain-0.37/misc.c	2023-04-23 10:31:16.529594158 +0200
+@@ -14,6 +14,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <vorbis/codec.h>
+ #include "i18n.h"
+ #include "misc.h"
-- 
GitLab