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