nixpkgs-suyu/pkgs/tools/networking/ppp/default.nix

73 lines
1.7 KiB
Nix
Raw Normal View History

2021-07-20 21:21:36 +02:00
{ lib
, stdenv
, fetchFromGitHub
, substituteAll
, libpcap
, openssl
}:
stdenv.mkDerivation rec {
2021-07-20 21:21:36 +02:00
version = "2.4.9";
pname = "ppp";
2020-03-06 23:33:06 +01:00
src = fetchFromGitHub {
2021-07-20 21:21:36 +02:00
owner = "ppp-project";
repo = pname;
rev = "${pname}-${version}";
sha256 = "sha256-8+nbqRNfKPLDx+wmuKSkv+BSeG72hKJI4dNqypqeEK4=";
};
2021-07-20 21:21:36 +02: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
];
2021-07-20 21:21:36 +02:00
buildInputs = [
libpcap
openssl
];
postPatch = ''
# strip is not found when cross compiling with seemingly no way to point
# make to the right place, fixup phase will correctly strip
# everything anyway so we remove it from the Makefiles
for file in $(find -name Makefile.linux); do
substituteInPlace "$file" --replace '$(INSTALL) -s' '$(INSTALL)'
2020-03-06 23:33:06 +01:00
substituteInPlace "$file" --replace '-m 4550' '-m 550'
done
'';
2016-03-24 20:25:42 +01:00
installPhase = ''
runHook preInstall
2016-03-24 20:25:42 +01:00
mkdir -p $out/bin
make install
install -D -m 755 scripts/{pon,poff,plog} $out/bin
runHook postInstall
2016-03-24 20:25:42 +01:00
'';
postFixup = ''
for tgt in pon poff plog; do
substituteInPlace "$out/bin/$tgt" --replace "/usr/sbin" "$out/bin"
done
2016-03-24 20:25:42 +01:00
'';
meta = with lib; {
2021-07-20 21:21:36 +02: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-18 00:18:17 +02:00
platforms = platforms.linux;
maintainers = [ ];
};
}