2021-07-20 19:21:36 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libpcap
|
2022-09-27 13:43:01 +00:00
|
|
|
, libxcrypt
|
2023-02-19 11:48:52 +00:00
|
|
|
, pkg-config
|
|
|
|
, autoreconfHook
|
2021-07-20 19:21:36 +00:00
|
|
|
, openssl
|
2021-10-04 19:13:29 +00:00
|
|
|
, bash
|
2022-09-27 13:43:23 +00:00
|
|
|
, nixosTests
|
2021-07-20 19:21:36 +00:00
|
|
|
}:
|
2012-01-04 15:10:27 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2023-02-19 11:48:52 +00:00
|
|
|
version = "2.5.0";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "ppp";
|
2009-02-01 13:54:20 +00:00
|
|
|
|
2020-03-06 22:33:06 +00:00
|
|
|
src = fetchFromGitHub {
|
2021-07-20 19:21:36 +00:00
|
|
|
owner = "ppp-project";
|
|
|
|
repo = pname;
|
2023-02-19 11:48:52 +00:00
|
|
|
rev = "ppp-${version}";
|
|
|
|
sha256 = "sha256-J7udiLiJiJ1PzNxD+XYAUPXZ+ABGXt2U3hSFUWJXe94=";
|
2009-02-01 13:54:20 +00:00
|
|
|
};
|
|
|
|
|
2023-02-19 11:48:52 +00:00
|
|
|
configureFlags = [
|
2023-05-08 13:44:42 +00:00
|
|
|
"--localstatedir=/var"
|
2023-02-19 11:48:52 +00:00
|
|
|
"--sysconfdir=/etc"
|
2023-05-08 13:44:42 +00:00
|
|
|
"--with-openssl=${openssl.dev}"
|
2021-07-20 19:21:36 +00:00
|
|
|
];
|
2009-02-01 13:54:20 +00:00
|
|
|
|
2023-02-19 11:48:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
autoreconfHook
|
|
|
|
];
|
2023-05-08 13:44:42 +00:00
|
|
|
|
2021-07-20 19:21:36 +00:00
|
|
|
buildInputs = [
|
|
|
|
libpcap
|
2022-09-27 13:43:01 +00:00
|
|
|
libxcrypt
|
2021-07-20 19:21:36 +00:00
|
|
|
openssl
|
2021-10-04 19:13:29 +00:00
|
|
|
bash
|
2021-07-20 19:21:36 +00:00
|
|
|
];
|
2009-02-01 13:54:20 +00:00
|
|
|
|
2018-03-28 13:51:01 +00: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 13:51:01 +00:00
|
|
|
done
|
2021-10-04 19:13:29 +00:00
|
|
|
|
|
|
|
patchShebangs --host \
|
|
|
|
scripts/{pon,poff,plog}
|
2018-03-28 13:51:01 +00:00
|
|
|
'';
|
|
|
|
|
2023-05-08 13:44:42 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-10-04 19:13:29 +00:00
|
|
|
makeFlags = [
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
];
|
|
|
|
|
2022-09-27 13:43:01 +00:00
|
|
|
NIX_LDFLAGS = "-lcrypt";
|
|
|
|
|
2023-02-19 11:48:52 +00:00
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=$(out)/etc"
|
|
|
|
];
|
2023-01-31 11:41:14 +00:00
|
|
|
|
2023-02-19 11:48:52 +00:00
|
|
|
postInstall = ''
|
2023-05-08 13:44:42 +00:00
|
|
|
install -Dm755 -t $out/bin scripts/{pon,poff,plog}
|
2016-03-24 19:25:42 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2021-10-04 19:13:29 +00:00
|
|
|
substituteInPlace "$out/bin/pon" --replace "/usr/sbin" "$out/bin"
|
2016-03-24 19:25:42 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-27 13:43:23 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) pppd;
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-07-20 19:21:36 +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-04-26 11:35:31 +00:00
|
|
|
gpl2Only
|
2021-07-20 19:21:36 +00:00
|
|
|
lgpl2
|
|
|
|
];
|
2018-08-17 22:18:17 +00:00
|
|
|
platforms = platforms.linux;
|
2020-01-09 21:52:11 +00:00
|
|
|
maintainers = [ ];
|
2009-02-01 13:54:20 +00:00
|
|
|
};
|
|
|
|
}
|