summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIsmael Luceno2022-04-18 19:33:59 +0200
committerIsmael Luceno2022-04-18 19:35:35 +0200
commitdc9f06448eb4895ceacdb1aa9d0979aa47103d31 (patch)
tree6e4be197d0975b6b4fde858191b5089bb9a60c88 /net
parentf7f5423ec2e27fa907ab83c831bb73c34b92e1e5 (diff)
vpnc: Fix build against musl
Diffstat (limited to 'net')
-rw-r--r--net/vpnc/HISTORY2
-rwxr-xr-xnet/vpnc/PRE_BUILD4
-rw-r--r--net/vpnc/patches/0001-Fix-build-against-musl-libc.patch58
3 files changed, 63 insertions, 1 deletions
diff --git a/net/vpnc/HISTORY b/net/vpnc/HISTORY
index 93afae0e41..c73f395ca9 100644
--- a/net/vpnc/HISTORY
+++ b/net/vpnc/HISTORY
@@ -1,5 +1,7 @@
2022-04-18 Ismael Luceno <ismael@sourcemage.org>
* PRE_BUILD: removed edit of Makefile, not needed
+ added apply_patch_dir
+ * patches/0001-Fix-build-against-musl-libc.patch: fixed musl build
2010-10-06 Eric Sandall <sandalle@sourcemage.org>
* PRE_BUILD: Fix sed to not mangle the Makefile
diff --git a/net/vpnc/PRE_BUILD b/net/vpnc/PRE_BUILD
index 2ff45ef8e4..c230ad14bf 100755
--- a/net/vpnc/PRE_BUILD
+++ b/net/vpnc/PRE_BUILD
@@ -1 +1,3 @@
-default_pre_build &&
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git a/net/vpnc/patches/0001-Fix-build-against-musl-libc.patch b/net/vpnc/patches/0001-Fix-build-against-musl-libc.patch
new file mode 100644
index 0000000000..b376fcd79a
--- /dev/null
+++ b/net/vpnc/patches/0001-Fix-build-against-musl-libc.patch
@@ -0,0 +1,58 @@
+From 82ec49cec5c78f1ba3d1b5dddedfa77804d9fe5d Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael@iodev.co.uk>
+Date: Mon, 18 Apr 2022 18:55:20 +0200
+Subject: [PATCH 1/4] Fix build against musl libc
+
+Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
+---
+ sysdep.h | 7 ++++++-
+ vpnc.c | 2 +-
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/sysdep.h b/sysdep.h
+index a5eafd6d87ea..d182e8340313 100644
+--- a/sysdep.h
++++ b/sysdep.h
+@@ -25,8 +25,11 @@
+ #if !defined(__CYGWIN__)
+ #include <net/if.h>
+ #include <net/if_arp.h>
++/* might conflict with <linux/if_ether.h> */
++#if defined(__linux__) && !defined(_LINUX_IF_ETHER_H)
+ #include <netinet/if_ether.h>
+ #endif
++#endif
+
+ #include "config.h"
+
+@@ -38,11 +41,13 @@ int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
+
+ /***************************************************************************/
+ #if defined(__linux__) || defined(__GLIBC__)
++#ifdef __GLIBC__
+ #include <error.h>
++#define HAVE_ERROR 1
++#endif
+
+ #define HAVE_VASPRINTF 1
+ #define HAVE_ASPRINTF 1
+-#define HAVE_ERROR 1
+ #define HAVE_GETLINE 1
+ #define HAVE_UNSETENV 1
+ #define HAVE_SETENV 1
+diff --git a/vpnc.c b/vpnc.c
+index 38dc17fcc171..39eb40e86fa5 100644
+--- a/vpnc.c
++++ b/vpnc.c
+@@ -24,7 +24,7 @@
+ #define _GNU_SOURCE
+ #include <assert.h>
+ #include <unistd.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+--
+2.35.3
+