diff --git a/srcpkgs/ppp/patches/musl.patch b/srcpkgs/ppp/patches/musl.patch new file mode 100644 index 00000000000..8755212b67e --- /dev/null +++ b/srcpkgs/ppp/patches/musl.patch @@ -0,0 +1,126 @@ +--- pppd/Makefile.linux ++++ pppd/Makefile.linux +@@ -126,7 +126,7 @@ LIBS += -lcrypt + endif + + ifdef USE_LIBUTIL +-CFLAGS += -DHAVE_LOGWTMP=1 ++#CFLAGS += -DHAVE_LOGWTMP=1 + LIBS += -lutil + endif + +--- pppd/plugins/rp-pppoe/if.c ++++ pppd/plugins/rp-pppoe/if.c +@@ -30,10 +30,6 @@ static char const RCSID[] = + #include + #endif + +-#ifdef HAVE_NET_ETHERNET_H +-#include +-#endif +- + #ifdef HAVE_ASM_TYPES_H + #include + #endif +--- pppd/plugins/rp-pppoe/plugin.c ++++ pppd/plugins/rp-pppoe/plugin.c +@@ -46,7 +46,6 @@ static char const RCSID[] = + #include + #include + #include +-#include + #include + #include + #include +--- pppd/plugins/rp-pppoe/pppoe-discovery.c ++++ pppd/plugins/rp-pppoe/pppoe-discovery.c +@@ -27,10 +27,6 @@ + #include + #endif + +-#ifdef HAVE_NET_ETHERNET_H +-#include +-#endif +- + #ifdef HAVE_ASM_TYPES_H + #include + #endif +@@ -55,6 +51,8 @@ void die(int status) + exit(status); + } + ++#define error(x...) fprintf(stderr, x) ++ + /* Initialize frame types to RFC 2516 values. Some broken peers apparently + use different frame types... sigh... */ + +--- pppd/plugins/rp-pppoe/pppoe.h ++++ pppd/plugins/rp-pppoe/pppoe.h +@@ -86,18 +86,6 @@ typedef unsigned long UINT32_t; + + #include + +-#ifdef HAVE_NETINET_IF_ETHER_H +-#include +- +-#ifdef HAVE_SYS_SOCKET_H +-#include +-#endif +-#ifndef HAVE_SYS_DLPI_H +-#include +-#endif +-#endif +- +- + + /* Ethernet frame types according to RFC 2516 */ + #define ETH_PPPOE_DISCOVERY 0x8863 +--- pppd/sys-linux.c ++++ pppd/sys-linux.c +@@ -102,19 +102,11 @@ + #define MAX_ADDR_LEN 7 + #endif + +-#if __GLIBC__ >= 2 + #include /* glibc 2 conflicts with linux/types.h */ + #include + #include + #include + #include +-#else +-#include +-#include +-#include +-#include +-#include +-#endif + #include + #include + + +--- include/linux/ppp_defs.h.orig 2015-05-10 10:59:27.959155977 +0200 ++++ include/linux/ppp_defs.h 2015-05-10 10:59:50.190403246 +0200 +@@ -50,6 +50,10 @@ + #ifndef _PPP_DEFS_H_ + #define _PPP_DEFS_H_ + ++#include ++#ifndef __P ++# define __P(x) x ++#endif + /* + * The basic PPP frame. + */ +--- pppd/magic.h.orig 2015-05-10 11:00:16.687697962 +0200 ++++ pppd/magic.h 2015-05-10 11:00:34.030890864 +0200 +@@ -42,6 +42,10 @@ + * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $ + */ + ++#ifndef __P ++# define __P(x) x ++#endif ++ + void magic_init __P((void)); /* Initialize the magic number generator */ + u_int32_t magic __P((void)); /* Returns the next magic number */ + diff --git a/srcpkgs/ppp/template b/srcpkgs/ppp/template index 7c4920ed796..37d36b81b3b 100644 --- a/srcpkgs/ppp/template +++ b/srcpkgs/ppp/template @@ -1,7 +1,7 @@ # Template file for 'ppp' pkgname=ppp version=2.4.7 -revision=2 +revision=3 short_desc="PPP (Point-to-Point Protocol) daemon" homepage="https://ppp.samba.org/" license="BSD, LGPLv2+, GPLv2+, Public Domain" @@ -19,6 +19,8 @@ conf_files=" /etc/ppp/chap-secrets /etc/ppp/pap-secrets" +CFLAGS="-D_GNU_SOURCE" + do_configure() { # Custom CFLAGS. sed -i "s:-O2 -pipe -Wall -g:${CFLAGS}:" pppd/Makefile.linux @@ -33,18 +35,12 @@ do_configure() { # Enable Microsoft Proprietary Callback Control Protocol sed -i "s:^#CBCP=y:CBCP=y:" pppd/Makefile.linux - ./configure --prefix=/usr + ./configure ${configure_args} } - do_build() { - make ${makejobs} + make COPTS="${CFLAGS}" ${makejobs} } - do_install() { - for f in $(find ${wrksrc} -type f -name Makefile); do - sed -i -e "s|\$(INSTALL) -s|\$(INSTALL|g" ${f} - done - make DESTDIR=${DESTDIR}/usr install chmod 755 ${DESTDIR}/usr/lib/pppd/${version}/*.so