about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/wifi/default.nix
blob: 260f7e8a937f38831c37c4c0113f3c1001be788e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, buildPythonPackage
, fetchFromGitHub
, pbkdf2
, pytestCheckHook
, pythonOlder
, substituteAll
, wirelesstools
}:

buildPythonPackage rec {
  pname = "wifi";
  version = "0.3.5";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "rockymeza";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-scg/DvApvyQZtzDgkHFJzf9gCRfJgBvZ64CG/c2Cx8E=";
  };

  disabled = pythonOlder "2.6";

  postPatch = ''
    substituteInPlace wifi/scan.py \
      --replace "/sbin/iwlist" "${wirelesstools}/bin/iwlist"
  '';

  nativeCheckInputs = [
    pytestCheckHook
  ];

  propagatedBuildInputs = [
    pbkdf2
  ];

  pythonImportsCheck = [ "wifi" ];

  meta = with lib; {
    description = "Provides a command line wrapper for iwlist and /etc/network/interfaces";
    mainProgram = "wifi";
    homepage = "https://github.com/rockymeza/wifi";
    maintainers = with maintainers; [ rhoriguchi ];
    license = licenses.bsd2;
  };
}