1{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libnl, iptables }:
2
3let
4 sourceAttrs = (import ./source.nix) { inherit fetchFromGitHub; };
5in
6
7stdenv.mkDerivation {
8 pname = "jool-cli";
9 version = sourceAttrs.version;
10
11 src = sourceAttrs.src;
12
13 outputs = [
14 "out"
15 "man"
16 ];
17
18 nativeBuildInputs = [ autoreconfHook pkg-config ];
19 buildInputs = [ libnl iptables ];
20
21 makeFlags = [ "-C" "src/usr" ];
22
23 prePatch = ''
24 sed -e 's%^XTABLES_SO_DIR = .*%XTABLES_SO_DIR = '"$out"'/lib/xtables%g' -i src/usr/iptables/Makefile
25 '';
26
27 meta = with lib; {
28 homepage = "https://www.jool.mx/";
29 description = "Fairly compliant SIIT and Stateful NAT64 for Linux - CLI tools";
30 platforms = platforms.linux;
31 license = licenses.gpl2;
32 maintainers = with maintainers; [ fpletz ];
33 };
34}