nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 cmake,
5 cmocka,
6 fetchFromGitHub,
7 jansson,
8 libdict,
9 libpcap,
10 ncurses,
11 openssl,
12}:
13
14stdenv.mkDerivation (finalAttrs: {
15 pname = "bngblaster";
16 version = "0.9.22";
17
18 src = fetchFromGitHub {
19 owner = "rtbrick";
20 repo = "bngblaster";
21 rev = finalAttrs.version;
22 hash = "sha256-vLvPiHwrFLqNV9ReeFAr0YBn8HUt6SazanpwZ1q09oU=";
23 };
24
25 nativeBuildInputs = [ cmake ];
26
27 buildInputs = [
28 libdict
29 ncurses
30 jansson
31 openssl
32 cmocka
33 ]
34 ++ lib.optionals finalAttrs.finalPackage.doCheck [ libpcap ];
35
36 cmakeFlags = [
37 "-DBNGBLASTER_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}"
38 "-DBNGBLASTER_VERSION=${finalAttrs.version}"
39 ];
40
41 doCheck = true;
42
43 meta = with lib; {
44 description = "Network tester for access and routing protocols";
45 homepage = "https://github.com/rtbrick/bngblaster/";
46 changelog = "https://github.com/rtbrick/bngblaster/releases/tag/${finalAttrs.version}";
47 license = licenses.bsd3;
48 teams = [ teams.wdz ];
49 badPlatforms = platforms.darwin;
50 };
51})