depot/third_party/nixpkgs/pkgs/by-name/cl/clatd/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

66 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, perl
, perlPackages
, tayga
, iproute2
, iptables
, nixosTests
}:
stdenv.mkDerivation rec {
pname = "clatd";
version = "1.6";
src = fetchFromGitHub {
owner = "toreanderson";
repo = "clatd";
rev = "v${version}";
hash = "sha256-ZUGWQTXXgATy539NQxkZSvQA7HIWkIPsw1NJrz0xKEg=";
};
strictDeps = true;
nativeBuildInputs = [
makeWrapper
perl # for pod2man
];
buildInputs = with perlPackages; [
perl
NetIP
NetDNS
];
makeFlags = [ "PREFIX=$(out)" ];
preBuild = ''
mkdir -p $out/{sbin,share/man/man8}
'';
postFixup = ''
patchShebangs $out/bin/clatd
wrapProgram $out/bin/clatd \
--set PERL5LIB $PERL5LIB \
--prefix PATH : ${
lib.makeBinPath [
tayga
iproute2
iptables
]
}
'';
passthru.tests.clatd = nixosTests.clatd;
meta = with lib; {
description = "464XLAT CLAT implementation for Linux";
homepage = "https://github.com/toreanderson/clatd";
license = licenses.mit;
maintainers = with maintainers; [ jmbaur ];
mainProgram = "clatd";
platforms = platforms.linux;
};
}