3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/networking/ppp/default.nix

77 lines
2.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, substituteAll, libpcap, openssl }:
stdenv.mkDerivation rec {
version = "2.4.7";
pname = "ppp";
src = fetchurl {
url = "mirror://samba/ppp/${pname}-${version}.tar.gz";
sha256 = "0c7vrjxl52pdwi4ckrvfjr08b31lfpgwf3pp0cqy76a77vfs7q02";
};
patches =
2020-01-08 08:03:22 +00:00
[
# fix for glibc>=2.28
(fetchurl {
url = "https://github.com/paulusmack/ppp/commit/3c7b86229f7bd2600d74db14b1fe5b3896be3875.patch";
sha256 = "0qlbi247lx3injpy8a1gcij9yilik0vfaibkpvdp88k3sa1rs69z";
})
( substituteAll {
src = ./nix-purity.patch;
inherit libpcap;
2016-03-11 15:12:39 +00:00
glibc = stdenv.cc.libc.dev or stdenv.cc.libc;
2020-01-08 08:03:22 +00:00
openssl = openssl.dev;
})
# Without nonpriv.patch, pppd --version doesn't work when not run as
# root.
./nonpriv.patch
2017-01-25 23:40:17 +00:00
(fetchurl {
name = "CVE-2015-3310.patch";
url = "https://salsa.debian.org/roam/ppp/raw/ef5d585aca6b1200a52c7109caa66ef97964d76e/debian/patches/rc_mksid-no-buffer-overflow";
2017-01-25 23:40:17 +00:00
sha256 = "1dk00j7bg9nfgskw39fagnwv1xgsmyv0xnkd6n1v5gy0psw0lvqh";
})
(fetchurl {
url = "https://salsa.debian.org/roam/ppp/raw/ef5d585aca6b1200a52c7109caa66ef97964d76e/debian/patches/0016-pppoe-include-netinet-in.h-before-linux-in.h.patch";
sha256 = "1xnmqn02kc6g5y84xynjwnpv9cvrfn3nyv7h7r8j8xi7qf2aj4q8";
})
(fetchurl {
url = https://www.nikhef.nl/~janjust/ppp/ppp-2.4.7-eaptls-mppe-1.102.patch;
sha256 = "04war8l5szql53l36043hvzgfwqp3v76kj8brbz7wlf7vs2mlkia";
})
./musl-fix-headers.patch
];
buildInputs = [ libpcap openssl ];
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
'';
2016-03-24 19:25:42 +00:00
installPhase = ''
runHook preInstall
2016-03-24 19:25:42 +00:00
mkdir -p $out/bin
make install
install -D -m 755 scripts/{pon,poff,plog} $out/bin
runHook postInstall
2016-03-24 19:25:42 +00:00
'';
postFixup = ''
for tgt in pon poff plog; do
substituteInPlace "$out/bin/$tgt" --replace "/usr/sbin" "$out/bin"
done
2016-03-24 19:25:42 +00:00
'';
2018-08-17 23:18:17 +01:00
meta = with stdenv.lib; {
homepage = https://ppp.samba.org/;
description = "Point-to-point implementation for Linux and Solaris";
2018-08-17 23:18:17 +01:00
license = with licenses; [ bsdOriginal publicDomain gpl2 lgpl2 ];
platforms = platforms.linux;
maintainers = [ ];
};
}