2021-07-20 20:21:36 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, substituteAll
|
|
|
|
, libpcap
|
|
|
|
, openssl
|
2021-10-04 20:13:29 +01:00
|
|
|
, bash
|
2021-07-20 20:21:36 +01:00
|
|
|
}:
|
2012-01-04 15:10:27 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-07-20 20:21:36 +01:00
|
|
|
version = "2.4.9";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "ppp";
|
2009-02-01 13:54:20 +00:00
|
|
|
|
2020-03-06 22:33:06 +00:00
|
|
|
src = fetchFromGitHub {
|
2021-07-20 20:21:36 +01:00
|
|
|
owner = "ppp-project";
|
|
|
|
repo = pname;
|
|
|
|
rev = "${pname}-${version}";
|
|
|
|
sha256 = "sha256-8+nbqRNfKPLDx+wmuKSkv+BSeG72hKJI4dNqypqeEK4=";
|
2009-02-01 13:54:20 +00:00
|
|
|
};
|
|
|
|
|
2021-07-20 20:21:36 +01:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./nix-purity.patch;
|
|
|
|
glibc = stdenv.cc.libc.dev or stdenv.cc.libc;
|
|
|
|
openssl_dev = openssl.dev;
|
|
|
|
openssl_out = openssl.out;
|
|
|
|
})
|
|
|
|
# Without nonpriv.patch, pppd --version doesn't work when not run as root.
|
|
|
|
./nonpriv.patch
|
|
|
|
];
|
2009-02-01 13:54:20 +00:00
|
|
|
|
2021-07-20 20:21:36 +01:00
|
|
|
buildInputs = [
|
|
|
|
libpcap
|
|
|
|
openssl
|
2021-10-04 20:13:29 +01:00
|
|
|
bash
|
2021-07-20 20:21:36 +01:00
|
|
|
];
|
2009-02-01 13:54:20 +00:00
|
|
|
|
2018-03-28 14:51:01 +01:00
|
|
|
postPatch = ''
|
|
|
|
for file in $(find -name Makefile.linux); do
|
2020-03-06 22:33:06 +00:00
|
|
|
substituteInPlace "$file" --replace '-m 4550' '-m 550'
|
2018-03-28 14:51:01 +01:00
|
|
|
done
|
2021-10-04 20:13:29 +01:00
|
|
|
|
|
|
|
patchShebangs --host \
|
|
|
|
scripts/{pon,poff,plog}
|
2018-03-28 14:51:01 +01:00
|
|
|
'';
|
|
|
|
|
2021-10-04 20:13:29 +01:00
|
|
|
makeFlags = [
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
];
|
|
|
|
|
2016-03-24 19:25:42 +00:00
|
|
|
installPhase = ''
|
2018-03-28 14:51:01 +01:00
|
|
|
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
|
2018-03-28 14:51:01 +01:00
|
|
|
runHook postInstall
|
2016-03-24 19:25:42 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2021-10-04 20:13:29 +01:00
|
|
|
substituteInPlace "$out/bin/pon" --replace "/usr/sbin" "$out/bin"
|
2016-03-24 19:25:42 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-07-20 20:21:36 +01:00
|
|
|
homepage = "https://ppp.samba.org";
|
|
|
|
description = "Point-to-point implementation to provide Internet connections over serial lines";
|
|
|
|
license = with licenses; [
|
|
|
|
bsdOriginal
|
|
|
|
publicDomain
|
|
|
|
gpl2
|
|
|
|
lgpl2
|
|
|
|
];
|
2018-08-17 23:18:17 +01:00
|
|
|
platforms = platforms.linux;
|
2020-01-09 21:52:11 +00:00
|
|
|
maintainers = [ ];
|
2009-02-01 13:54:20 +00:00
|
|
|
};
|
|
|
|
}
|