nixpkgs/pkgs/by-name/pp/ppp/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

88 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, libpcap
, libxcrypt
, pkg-config
, autoreconfHook
, openssl
, bash
, nixosTests
}:
stdenv.mkDerivation rec {
version = "2.5.1";
pname = "ppp";
src = fetchFromGitHub {
owner = "ppp-project";
repo = "ppp";
rev = "ppp-${version}";
hash = "sha256-sjaBFP/A63+ycuZm3bxOxAAxMrVHZZFED2Uq8rBapdo=";
};
configureFlags = [
"--localstatedir=/var"
"--sysconfdir=/etc"
"--with-openssl=${openssl.dev}"
];
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs = [
libpcap
libxcrypt
openssl
bash
];
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 = with lib; {
homepage = "https://ppp.samba.org";
description = "Point-to-point implementation to provide Internet connections over serial lines";
license = with licenses; [
bsdOriginal
publicDomain
gpl2Only
lgpl2
];
platforms = platforms.linux;
maintainers = [ ];
};
}