commit:     cb95d9f7d0c6ac43c43ce470dabd2463a1462ce7
Author:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 17 13:59:15 2021 +0000
Commit:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
CommitDate: Fri Sep 17 14:00:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb95d9f7

app-i18n/ibus-fbterm: fix build with Clang

Closes: https://bugs.gentoo.org/734214
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Akinori Hattori <hattya <AT> gentoo.org>

 app-i18n/ibus-fbterm/files/ibus-fbterm-clang.patch | 48 ++++++++++++++++++++++
 app-i18n/ibus-fbterm/ibus-fbterm-1.0.1.ebuild      |  5 ++-
 2 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/app-i18n/ibus-fbterm/files/ibus-fbterm-clang.patch 
b/app-i18n/ibus-fbterm/files/ibus-fbterm-clang.patch
new file mode 100644
index 00000000000..797592c3240
--- /dev/null
+++ b/app-i18n/ibus-fbterm/files/ibus-fbterm-clang.patch
@@ -0,0 +1,48 @@
+--- a/backend/fbio.c
++++ b/backend/fbio.c
+@@ -204,7 +204,7 @@
+ int
+ fb_io_get_fd (FbIo *io)
+ {
+-    g_return_if_fail (FB_IS_IO (io));
++    g_return_val_if_fail (FB_IS_IO (io), -1);
+     return io->priv->fd;
+ }
+ 
+--- a/backend/fbshell.c
++++ b/backend/fbshell.c
+@@ -17,11 +17,11 @@
+  * You should have received a copy of the GNU General Public License
+  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  */
+-#include <glib.h>
+-
+-#define _XOPEN_SOURCE
++#define _XOPEN_SOURCE 600
+ #define __USE_XOPEN
+ 
++#include <glib.h>
++
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <pty.h>
+--- a/backend/fbshellman.c
++++ b/backend/fbshellman.c
+@@ -81,7 +81,7 @@
+     FbShellManagerPrivate *priv;
+     int index, temp, i;
+ 
+-    g_return_if_fail (FB_IS_SHELL_MANAGER (shell_manager));
++    g_return_val_if_fail (FB_IS_SHELL_MANAGER (shell_manager), NR_SHELLS);
+ 
+ #define STEP() do { \
+     if (forward) temp++; \
+@@ -267,7 +267,7 @@
+ FbShell *
+ fb_shell_manager_active_shell (FbShellManager *shell_manager)
+ {
+-    g_return_if_fail (FB_IS_SHELL_MANAGER (shell_manager));
++    g_return_val_if_fail (FB_IS_SHELL_MANAGER (shell_manager), NULL);
+ 
+     return shell_manager->priv->active_shell;
+ }

diff --git a/app-i18n/ibus-fbterm/ibus-fbterm-1.0.1.ebuild 
b/app-i18n/ibus-fbterm/ibus-fbterm-1.0.1.ebuild
index 1b6ae892c9c..148fb8ed475 100644
--- a/app-i18n/ibus-fbterm/ibus-fbterm-1.0.1.ebuild
+++ b/app-i18n/ibus-fbterm/ibus-fbterm-1.0.1.ebuild
@@ -20,7 +20,10 @@ RDEPEND="app-i18n/ibus
 DEPEND="${RDEPEND}"
 BDEPEND="virtual/pkgconfig"
 
-PATCHES=( "${FILESDIR}"/${PN}-man.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-clang.patch
+       "${FILESDIR}"/${PN}-man.patch
+)
 
 AT_M4DIR="m4"
 

Reply via email to