commit:     ca305be17ae525e1b4ed7ba9bf87dba5f9d5c326
Author:     Jan-Espen Oversand <sigsegv <AT> radiotube <DOT> org>
AuthorDate: Tue Dec 13 18:31:51 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 16 05:20:05 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca305be1

net-vpn/vtun: fix implicit function decls

Fix implicit setproctitle, also this is libbsd so libbsd is a runtime 
depencency.

Also fix implicit getpt, grantpt, ptsname, by enabling nonstandard (_GNU_SOURCE)
gnu extensions and extra open/posix (_XOPEN_SOURCE).

Closes: https://bugs.gentoo.org/875443
Signed-off-by: Jan-Espen Oversand <sigsegv <AT> radiotube.org>
Closes: https://github.com/gentoo/gentoo/pull/28656
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-vpn/vtun/files/vtun-3.0.3-includes.patch       | 12 ++++++++++-
 net-vpn/vtun/files/vtun-3.0.4-includes.patch       | 24 +++++++++++++++++++++-
 .../{vtun-3.0.3-r2.ebuild => vtun-3.0.3-r3.ebuild} |  5 +++--
 .../{vtun-3.0.4.ebuild => vtun-3.0.4-r1.ebuild}    |  3 ++-
 4 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/net-vpn/vtun/files/vtun-3.0.3-includes.patch 
b/net-vpn/vtun/files/vtun-3.0.3-includes.patch
index 46ff5eca90a4..517ddf3cbb9c 100644
--- a/net-vpn/vtun/files/vtun-3.0.3-includes.patch
+++ b/net-vpn/vtun/files/vtun-3.0.3-includes.patch
@@ -20,14 +20,24 @@
  #include "linkfd.h"
 --- a/lib.h
 +++ b/lib.h
-@@ -26,6 +26,7 @@
+@@ -26,6 +26,8 @@
  #include <sys/types.h>
  #include <signal.h>
  #include <errno.h>
 +#include <unistd.h> /* read(), write() */
++#include <bsd/unistd.h> /* setproctitle(), see man libbsd(7) */
  
  #ifdef HAVE_LIBUTIL_H
  #include <libutil.h>
+@@ -35,7 +37,7 @@
+   void init_title(int argc,char *argv[],char *env[], char *name);
+   void set_title(const char *ftm, ...);
+ #else
+-  #define init_title( a... ) 
++  #define init_title(argc, argv, env, name) setproctitle_init(argc, argv, env)
+   #define set_title setproctitle
+ #endif /* HAVE_SETPROC_TITLE */
+ 
 --- a/vtun.h
 +++ b/vtun.h
 @@ -232,5 +232,9 @@

diff --git a/net-vpn/vtun/files/vtun-3.0.4-includes.patch 
b/net-vpn/vtun/files/vtun-3.0.4-includes.patch
index d17e4acbc5c4..06546c6bd815 100644
--- a/net-vpn/vtun/files/vtun-3.0.4-includes.patch
+++ b/net-vpn/vtun/files/vtun-3.0.4-includes.patch
@@ -20,14 +20,24 @@
  #include "linkfd.h"
 --- a/lib.h
 +++ b/lib.h
-@@ -26,6 +26,7 @@
+@@ -26,6 +26,8 @@
  #include <sys/types.h>
  #include <signal.h>
  #include <errno.h>
 +#include <unistd.h> /* read(), write() */
++#include <bsd/unistd.h> /* setproctitle(), see man libbsd(7) */
  
  #ifdef HAVE_LIBUTIL_H
  #include <libutil.h>
+@@ -35,7 +37,7 @@
+   void init_title(int argc,char *argv[],char *env[], char *name);
+   void set_title(const char *ftm, ...);
+ #else
+-  #define init_title( a... ) 
++  #define init_title(argc, argv, env, name) setproctitle_init(argc, argv, env)
+   #define set_title setproctitle
+ #endif /* HAVE_SETPROC_TITLE */
+ 
 --- a/lock.c
 +++ b/lock.c
 @@ -32,6 +32,7 @@
@@ -48,3 +58,15 @@
  
  #include "vtun.h"
  #include "linkfd.h"
+--- a/generic/pty_dev.c
++++ b/generic/pty_dev.c
+@@ -22,6 +22,8 @@
+ 
+ #include "config.h"
+ 
++#define _GNU_SOURCE // getpt, grantpt 
++#define _XOPEN_SOURCE // unlockpt
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+

diff --git a/net-vpn/vtun/vtun-3.0.3-r2.ebuild 
b/net-vpn/vtun/vtun-3.0.3-r3.ebuild
similarity index 94%
rename from net-vpn/vtun/vtun-3.0.3-r2.ebuild
rename to net-vpn/vtun/vtun-3.0.3-r3.ebuild
index 2152bb74e3ce..aeebc636d14f 100644
--- a/net-vpn/vtun/vtun-3.0.3-r2.ebuild
+++ b/net-vpn/vtun/vtun-3.0.3-r3.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
@@ -18,7 +18,8 @@ RDEPEND="
        lzo? ( dev-libs/lzo:2 )
        socks5? ( net-proxy/dante )
        ssl? ( dev-libs/openssl:0= )
-       zlib? ( sys-libs/zlib )"
+       zlib? ( sys-libs/zlib )
+       dev-libs/libbsd"
 DEPEND="${RDEPEND}"
 BDEPEND="sys-devel/bison"
 

diff --git a/net-vpn/vtun/vtun-3.0.4.ebuild b/net-vpn/vtun/vtun-3.0.4-r1.ebuild
similarity index 96%
rename from net-vpn/vtun/vtun-3.0.4.ebuild
rename to net-vpn/vtun/vtun-3.0.4-r1.ebuild
index a1c1e76bb471..800d5d0feb11 100644
--- a/net-vpn/vtun/vtun-3.0.4.ebuild
+++ b/net-vpn/vtun/vtun-3.0.4-r1.ebuild
@@ -18,7 +18,8 @@ RDEPEND="
        lzo? ( dev-libs/lzo:2 )
        socks5? ( net-proxy/dante )
        ssl? ( dev-libs/openssl:0= )
-       zlib? ( sys-libs/zlib )"
+       zlib? ( sys-libs/zlib )
+       dev-libs/libbsd"
 DEPEND="${RDEPEND}"
 BDEPEND="sys-devel/bison"
 

Reply via email to