commit:     7e2c66693ed08e55462f261140e9334398ea5c84
Author:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 12 13:49:46 2020 +0000
Commit:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
CommitDate: Sun Jul 12 14:14:38 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e2c6669

net-dialup/openl2tp: fix build with musl

Closes: https://bugs.gentoo.org/717064
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>

 net-dialup/openl2tp/files/openl2tp-1.8-musl.patch | 55 +++++++++++++++++++++++
 net-dialup/openl2tp/openl2tp-1.8-r1.ebuild        |  1 +
 2 files changed, 56 insertions(+)

diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-musl.patch 
b/net-dialup/openl2tp/files/openl2tp-1.8-musl.patch
new file mode 100644
index 00000000000..437f96f4d6f
--- /dev/null
+++ b/net-dialup/openl2tp/files/openl2tp-1.8-musl.patch
@@ -0,0 +1,55 @@
+diff -u openl2tp-1.8/cli/cli_readline.c openl2tp-1.8/cli/cli_readline.c
+--- openl2tp-1.8/cli/cli_readline.c    2020-07-12 11:16:13.583798412 +0300
++++ openl2tp-1.8/cli/cli_readline.c    2020-07-12 11:35:50.872615494 +0300
+@@ -18,12 +18,15 @@
+  *
+  
*****************************************************************************/
+ 
++#define _GNU_SOURCE
++
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/file.h>
+ #include <sys/stat.h>
+-#include <sys/errno.h>
++#include <fcntl.h>
++#include <errno.h>
+ #include <signal.h>
+ 
+ #include <readline/readline.h>
+@@ -633,7 +636,7 @@
+ 
+ static int cli_rl_install_signal_handlers(void)
+ {
+-      __sighandler_t handler;
++      sighandler_t handler;
+ 
+       rl_catch_signals = 0;
+       rl_clear_signals();
+unchanged:
+--- openl2tp-1.8.orig/usl/usl_pid.c    2008-05-08 00:44:20.000000000 +0400
++++ openl2tp-1.8/usl/usl_pid.c 2020-07-12 10:29:47.047052036 +0300
+@@ -26,6 +26,10 @@
+ 
+ #include "usl.h"
+ 
++#ifndef WAIT_ANY
++#define WAIT_ANY (-1)
++#endif
++
+ /* We maintain a list of child process pids and functions to call when
+  * they exit.
+  */
+unchanged:
+--- openl2tp-1.8.orig/l2tp_main.c      2010-02-12 22:09:23.000000000 +0300
++++ openl2tp-1.8/l2tp_main.c   2020-07-12 10:58:59.343655159 +0300
+@@ -42,7 +42,7 @@
+ #include <setjmp.h>
+ #include <sys/utsname.h>
+ 
+-#include <wait.h>
++#include <sys/wait.h>
+ 
+ #include "usl.h"
+ #include "l2tp_private.h"

diff --git a/net-dialup/openl2tp/openl2tp-1.8-r1.ebuild 
b/net-dialup/openl2tp/openl2tp-1.8-r1.ebuild
index 778f59179e2..8a763797d12 100644
--- a/net-dialup/openl2tp/openl2tp-1.8-r1.ebuild
+++ b/net-dialup/openl2tp/openl2tp-1.8-r1.ebuild
@@ -48,6 +48,7 @@ PATCHES=(
        "${FILESDIR}/${P}-cflags.patch"
        "${FILESDIR}/${P}-tirpc.patch"
        "${FILESDIR}/${P}-native-tc.patch"
+       "${FILESDIR}/${P}-musl.patch"
 )
 
 src_prepare() {

Reply via email to