nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 pkg-config,
7 ncurses,
8 libnl,
9}:
10
11stdenv.mkDerivation rec {
12 pname = "horst";
13 version = "5.1";
14
15 src = fetchFromGitHub {
16 owner = "br101";
17 repo = "horst";
18 rev = "v${version}";
19 sha256 = "140pyv6rlsh4c745w4b59pz3hrarr39qq3mz9z1lsd3avc12nx1a";
20 };
21
22 patches = [
23 # Fix pending upstream inclusion for ncurses-6.3:
24 # https://github.com/br101/horst/pull/110
25 (fetchpatch {
26 name = "ncurses-6.3.patch";
27 url = "https://github.com/br101/horst/commit/c9e9b6cc1f97edb9c53f3a67b43f3588f3ac6ea7.patch";
28 sha256 = "15pahbnql44d5zzxmkd5ky8bl3c3hh3lh5190wynd90jrrhf1a26";
29 # collides for context change, well apply this part in postPatch
30 excludes = [ "display-main.c" ];
31 })
32 ];
33 postPatch = ''
34 # Apply second part of ncurses-6.3.patch:
35 substituteInPlace display-main.c --replace 'wprintw(dump_win, str);' 'wprintw(dump_win, "%s", str);'
36 '';
37
38 nativeBuildInputs = [ pkg-config ];
39 buildInputs = [
40 ncurses
41 libnl
42 ];
43
44 installFlags = [ "DESTDIR=${placeholder "out"}" ];
45
46 meta = with lib; {
47 description = "Small and lightweight IEEE802.11 wireless LAN analyzer with a text interface";
48 homepage = "https://github.com/br101/horst";
49 maintainers = [ maintainers.fpletz ];
50 license = licenses.gpl2Plus;
51 platforms = platforms.linux;
52 mainProgram = "horst";
53 };
54}