From e5ae28681de47fa923496781d01e5a6522295a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sun, 11 Oct 2015 10:03:35 +0200 Subject: [PATCH] dhcpcd-dbus: unbreak musl --- .../dhcpcd-dbus/patches/musl-fcntl_h.patch | 88 +++++++++++++++++++ .../dhcpcd-dbus/patches/musl-sys_time_h.patch | 12 +++ srcpkgs/dhcpcd-dbus/template | 2 +- 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/dhcpcd-dbus/patches/musl-fcntl_h.patch create mode 100644 srcpkgs/dhcpcd-dbus/patches/musl-sys_time_h.patch diff --git a/srcpkgs/dhcpcd-dbus/patches/musl-fcntl_h.patch b/srcpkgs/dhcpcd-dbus/patches/musl-fcntl_h.patch new file mode 100644 index 00000000000..a87d34279ff --- /dev/null +++ b/srcpkgs/dhcpcd-dbus/patches/musl-fcntl_h.patch @@ -0,0 +1,88 @@ +The type ssize_t is required in the header, thus move +the include statements for system headers into dchpcd.h + +Both glibc and musl libc have strverscmp(3) and the +static version would conflict with the musl libc one. + +--- dhcpcd.h 2014-07-14 22:56:47.000000000 +0200 ++++ dhcpcd.h 2015-10-11 09:57:47.605604457 +0200 +@@ -28,6 +28,22 @@ + #ifndef DHCPCD_H + #define DHCPCD_H + ++// For strverscmp(3) ++#define _GNU_SOURCE ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ + extern char *dhcpcd_version; + extern const char *dhcpcd_status; + +--- dhcpcd.c 2014-07-14 22:56:47.000000000 +0200 ++++ dhcpcd.c 2015-10-11 09:57:11.545607270 +0200 +@@ -24,22 +24,6 @@ + * SUCH DAMAGE. + */ + +-// For strverscmp(3) +-#define _GNU_SOURCE +- +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- + #include "defs.h" + #include "dhcpcd.h" + #include "dhcpcd-dbus.h" +@@ -648,31 +648,6 @@ + return list; + } + +-#ifndef __GLIBC__ +-/* Good enough for our needs */ +-static int +-strverscmp(const char *s1, const char *s2) +-{ +- int s1maj, s1min, s1part; +- int s2maj, s2min, s2part; +- int r; +- +- s1min = s1part = 0; +- if (sscanf(s1, "%d.%d.%d", &s1maj, &s1min, &s1part) < 1) +- return -1; +- s2min = s2part = 0; +- if (sscanf(s2, "%d.%d.%d", &s2maj, &s2min, &s2part) < 1) +- return -1; +- r = s1maj - s2maj; +- if (r != 0) +- return r; +- r = s1min - s2min; +- if (r != 0) +- return r; +- return s1part - s2part; +-} +-#endif +- + void + dhcpcd_init(_unused void *data) + { diff --git a/srcpkgs/dhcpcd-dbus/patches/musl-sys_time_h.patch b/srcpkgs/dhcpcd-dbus/patches/musl-sys_time_h.patch new file mode 100644 index 00000000000..43126e910b1 --- /dev/null +++ b/srcpkgs/dhcpcd-dbus/patches/musl-sys_time_h.patch @@ -0,0 +1,12 @@ +The struct timeval is defined in sys/time.h + +--- eloop.h 2014-07-14 22:56:47.000000000 +0200 ++++ eloop.h 2015-10-11 09:49:29.563643314 +0200 +@@ -29,6 +29,7 @@ + #define ELOOP_H + + #include ++#include + + int add_event(int, void (*)(void *), void *); + int add_event_flags(int, short, void (*)(int, void *), void *); diff --git a/srcpkgs/dhcpcd-dbus/template b/srcpkgs/dhcpcd-dbus/template index 03491461b97..622418ec57a 100644 --- a/srcpkgs/dhcpcd-dbus/template +++ b/srcpkgs/dhcpcd-dbus/template @@ -1,7 +1,7 @@ # Template file for 'dhcpcd-dbus' pkgname=dhcpcd-dbus version=0.6.1 -revision=1 +revision=2 build_style=configure configure_args="--prefix=/usr --sysconfdir=/etc --rundir=/run" hostmakedepends="pkg-config"