Skip to content

Commit

Permalink
ppp: fix build with newer kernel headers
Browse files Browse the repository at this point in the history
The package would build but with some components missing, see
#37926 and
https://hydra.nixos.org/build/70939248/nixlog/1 -> CTRL-F error:
  • Loading branch information
pbogdan authored and obadz committed Mar 28, 2018
1 parent e022366 commit da9b564
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
15 changes: 15 additions & 0 deletions pkgs/tools/networking/ppp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
10 changes: 5 additions & 5 deletions pkgs/tools/networking/ppp/musl-fix-headers.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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
Expand Down

0 comments on commit da9b564

Please sign in to comment.