1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pbkdf2,
6 pytestCheckHook,
7 pythonOlder,
8 wirelesstools,
9}:
10
11buildPythonPackage rec {
12 pname = "wifi";
13 version = "0.3.5";
14 format = "setuptools";
15
16 src = fetchFromGitHub {
17 owner = "rockymeza";
18 repo = "wifi";
19 rev = "v${version}";
20 hash = "sha256-scg/DvApvyQZtzDgkHFJzf9gCRfJgBvZ64CG/c2Cx8E=";
21 };
22
23 disabled = pythonOlder "2.6";
24
25 postPatch = ''
26 substituteInPlace wifi/scan.py \
27 --replace "/sbin/iwlist" "${wirelesstools}/bin/iwlist"
28 '';
29
30 nativeCheckInputs = [ pytestCheckHook ];
31
32 propagatedBuildInputs = [ pbkdf2 ];
33
34 pythonImportsCheck = [ "wifi" ];
35
36 meta = with lib; {
37 description = "Provides a command line wrapper for iwlist and /etc/network/interfaces";
38 mainProgram = "wifi";
39 homepage = "https://github.com/rockymeza/wifi";
40 maintainers = with maintainers; [ rhoriguchi ];
41 license = licenses.bsd2;
42 };
43}