about summary refs log tree commit diff
path: root/pkgs/tools/networking/ppp
diff options
context:
space:
mode:
authorRick van Schijndel <rol3517@gmail.com>2021-10-04 21:13:29 +0200
committerRick van Schijndel <rol3517@gmail.com>2021-10-11 19:36:18 +0200
commit5bb850a5b90b350a522d7820024adcd443447637 (patch)
tree26b8989c2c890e28a7167b82a6712c901a85b5ac /pkgs/tools/networking/ppp
parent1948e7cae91312ae3beff62adf756f61496c4ef5 (diff)
downloadnixlib-5bb850a5b90b350a522d7820024adcd443447637.tar
nixlib-5bb850a5b90b350a522d7820024adcd443447637.tar.gz
nixlib-5bb850a5b90b350a522d7820024adcd443447637.tar.bz2
nixlib-5bb850a5b90b350a522d7820024adcd443447637.tar.lz
nixlib-5bb850a5b90b350a522d7820024adcd443447637.tar.xz
nixlib-5bb850a5b90b350a522d7820024adcd443447637.tar.zst
nixlib-5bb850a5b90b350a522d7820024adcd443447637.zip
ppp: support cross-compilation, cleanup old code
Diffstat (limited to 'pkgs/tools/networking/ppp')
-rw-r--r--pkgs/tools/networking/ppp/default.nix17
1 files changed, 10 insertions, 7 deletions
diff --git a/pkgs/tools/networking/ppp/default.nix b/pkgs/tools/networking/ppp/default.nix
index 708932ac1c9d..5608b032ac50 100644
--- a/pkgs/tools/networking/ppp/default.nix
+++ b/pkgs/tools/networking/ppp/default.nix
@@ -4,6 +4,7 @@
 , substituteAll
 , libpcap
 , openssl
+, bash
 }:
 
 stdenv.mkDerivation rec {
@@ -31,18 +32,22 @@ stdenv.mkDerivation rec {
   buildInputs = [
     libpcap
     openssl
+    bash
   ];
 
   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)'
       substituteInPlace "$file" --replace '-m 4550' '-m 550'
     done
+
+    patchShebangs --host \
+      scripts/{pon,poff,plog}
   '';
 
+  makeFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ];
+
   installPhase = ''
     runHook preInstall
     mkdir -p $out/bin
@@ -52,9 +57,7 @@ stdenv.mkDerivation rec {
   '';
 
   postFixup = ''
-    for tgt in pon poff plog; do
-      substituteInPlace "$out/bin/$tgt" --replace "/usr/sbin" "$out/bin"
-    done
+    substituteInPlace "$out/bin/pon" --replace "/usr/sbin" "$out/bin"
   '';
 
   meta = with lib; {