2021-07-24 12:14:16 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libpcap
|
2022-10-30 15:09:59 +00:00
|
|
|
, libxcrypt
|
2023-05-24 13:37:59 +00:00
|
|
|
, pkg-config
|
|
|
|
, autoreconfHook
|
2021-07-24 12:14:16 +00:00
|
|
|
, openssl
|
2021-12-06 16:07:01 +00:00
|
|
|
, bash
|
2022-10-30 15:09:59 +00:00
|
|
|
, nixosTests
|
2021-07-24 12:14:16 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "2.5.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "ppp";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-07-24 12:14:16 +00:00
|
|
|
owner = "ppp-project";
|
|
|
|
repo = pname;
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "ppp-${version}";
|
|
|
|
sha256 = "sha256-J7udiLiJiJ1PzNxD+XYAUPXZ+ABGXt2U3hSFUWJXe94=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-openssl=${openssl.dev}"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
autoreconfHook
|
2021-07-24 12:14:16 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
buildInputs = [
|
|
|
|
libpcap
|
2022-10-30 15:09:59 +00:00
|
|
|
libxcrypt
|
2021-07-24 12:14:16 +00:00
|
|
|
openssl
|
2021-12-06 16:07:01 +00:00
|
|
|
bash
|
2021-07-24 12:14:16 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
for file in $(find -name Makefile.linux); do
|
|
|
|
substituteInPlace "$file" --replace '-m 4550' '-m 550'
|
|
|
|
done
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
patchShebangs --host \
|
|
|
|
scripts/{pon,poff,plog}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
makeFlags = [
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
NIX_LDFLAGS = "-lcrypt";
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=$(out)/etc"
|
|
|
|
];
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm755 -t $out/bin scripts/{pon,poff,plog}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
substituteInPlace "$out/bin/pon" --replace "/usr/sbin" "$out/bin"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) pppd;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-07-24 12:14:16 +00:00
|
|
|
homepage = "https://ppp.samba.org";
|
|
|
|
description = "Point-to-point implementation to provide Internet connections over serial lines";
|
|
|
|
license = with licenses; [
|
|
|
|
bsdOriginal
|
|
|
|
publicDomain
|
2024-05-15 15:35:15 +00:00
|
|
|
gpl2Only
|
2021-07-24 12:14:16 +00:00
|
|
|
lgpl2
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ ];
|
|
|
|
};
|
|
|
|
}
|