ppp: fix build with newer kernel headers

The package would build but with some components missing, see
https://github.com/NixOS/nixpkgs/issues/37926 and
https://hydra.nixos.org/build/70939248/nixlog/1 -> CTRL-F error:
This commit is contained in:
Piotr Bogdan 2018-03-28 14:51:01 +01:00 committed by obadz
parent e022366fb7
commit da9b564bed
2 changed files with 20 additions and 5 deletions

View File

@ -23,15 +23,30 @@ stdenv.mkDerivation rec {
url = "https://anonscm.debian.org/git/collab-maint/pkg-ppp.git/plain/debian/patches/rc_mksid-no-buffer-overflow?h=debian/2.4.7-1%2b4";
sha256 = "1dk00j7bg9nfgskw39fagnwv1xgsmyv0xnkd6n1v5gy0psw0lvqh";
})
(fetchurl {
url = "https://anonscm.debian.org/git/collab-maint/pkg-ppp.git/plain/debian/patches/0016-pppoe-include-netinet-in.h-before-linux-in.h.patch";
sha256 = "1xnmqn02kc6g5y84xynjwnpv9cvrfn3nyv7h7r8j8xi7qf2aj4q8";
})
./musl-fix-headers.patch
];
buildInputs = [ libpcap ];
postPatch = ''
# strip is not found when cross compiling with seemingly no way to point
# make to the right place, fixup phase will correctly strip
# everything anyway so we remove it from the Makefiles
for file in $(find -name Makefile.linux); do
substituteInPlace "$file" --replace '$(INSTALL) -s' '$(INSTALL)'
done
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
make install
install -D -m 755 scripts/{pon,poff,plog} $out/bin
runHook postInstall
'';
postFixup = ''

View File

@ -89,12 +89,12 @@ index 3d3bf4e..b5f82d3 100644
use different frame types... sigh... */
diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
index 9ab2eee..4d68147 100644
index c4aaa6e..70aef85 100644
--- a/pppd/plugins/rp-pppoe/pppoe.h
+++ b/pppd/plugins/rp-pppoe/pppoe.h
@@ -86,18 +86,6 @@ typedef unsigned long UINT32_t;
#include <netinet/in.h>
@@ -88,18 +88,6 @@ typedef unsigned long UINT32_t;
#include <linux/if_ether.h>
#endif
-#ifdef HAVE_NETINET_IF_ETHER_H
-#include <sys/types.h>
@ -108,9 +108,9 @@ index 9ab2eee..4d68147 100644
-#endif
-
-
/* Ethernet frame types according to RFC 2516 */
#define ETH_PPPOE_DISCOVERY 0x8863
#define ETH_PPPOE_SESSION 0x8864
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
index 6d71530..86d224e 100644
--- a/pppd/sys-linux.c