1{ lib, stdenv, fetchurl, pkg-config, libnl }:
2
3let cfg = import ./version.nix; in
4
5stdenv.mkDerivation rec {
6 pname = "batctl";
7 inherit (cfg) version;
8
9 src = fetchurl {
10 url = "https://downloads.open-mesh.org/batman/releases/batman-adv-${version}/${pname}-${version}.tar.gz";
11 sha256 = cfg.sha256.${pname};
12 };
13
14 nativeBuildInputs = [ pkg-config ];
15 buildInputs = [ libnl ];
16
17 preBuild = ''
18 makeFlags="PREFIX=$out PKG_CONFIG=${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config"
19 '';
20
21 meta = {
22 homepage = "https://www.open-mesh.org/projects/batman-adv/wiki/Wiki";
23 description = "B.A.T.M.A.N. routing protocol in a linux kernel module for layer 2, control tool";
24 license = lib.licenses.gpl2;
25 maintainers = with lib.maintainers; [ fpletz ];
26 platforms = with lib.platforms; linux;
27 };
28}