Files
nixpkgs/pkgs/by-name/pp/ppp/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

97 lines
1.8 KiB
Nix

{
autoreconfHook,
bash,
fetchFromGitHub,
lib,
libpcap,
libxcrypt,
linux-pam,
nixosTests,
openssl,
pkg-config,
stdenv,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal,
systemdMinimal,
}:
stdenv.mkDerivation rec {
version = "2.5.2";
pname = "ppp";
src = fetchFromGitHub {
owner = "ppp-project";
repo = "ppp";
tag = "v${version}";
hash = "sha256-NV8U0F8IhHXn0YuVbfFr992ATQZaXA16bb5hBIwm9Gs=";
};
configureFlags = [
"--localstatedir=/var"
"--sysconfdir=/etc"
"--with-openssl=${openssl.dev}"
(lib.enableFeature withSystemd "systemd")
];
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs = [
bash
libpcap
libxcrypt
linux-pam
openssl
]
++ lib.optionals withSystemd [
systemdMinimal
];
postPatch = ''
for file in $(find -name Makefile.linux); do
substituteInPlace "$file" --replace '-m 4550' '-m 550'
done
patchShebangs --host \
scripts/{pon,poff,plog}
'';
enableParallelBuilding = true;
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
];
NIX_LDFLAGS = "-lcrypt";
installFlags = [
"sysconfdir=$(out)/etc"
];
postInstall = ''
install -Dm755 -t $out/bin scripts/{pon,poff,plog}
'';
postFixup = ''
substituteInPlace "$out/bin/pon" --replace "/usr/sbin" "$out/bin"
'';
passthru.tests = {
inherit (nixosTests) pppd;
};
meta = {
homepage = "https://ppp.samba.org";
description = "Point-to-point implementation to provide Internet connections over serial lines";
license = with lib.licenses; [
bsdOriginal
publicDomain
gpl2Only
lgpl2
];
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ stv0g ];
};
}