evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / manuf / default.nix
blob2210f4a40fae9a8007b7a69d9521c527f0bc967c
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   runCommand,
6   wireshark-cli,
7   pytestCheckHook,
8   manuf, # remove when buildPythonPackage supports finalAttrs
9 }:
11 buildPythonPackage rec {
12   pname = "manuf";
13   version = "1.1.5";
14   format = "setuptools";
16   src = fetchFromGitHub {
17     owner = "coolbho3k";
18     repo = "manuf";
19     rev = "${version}";
20     hash = "sha256-3CFs3aqwE8rZPwU1QBqAGxNHT5jg7ymG12yBD56gTNI=";
21   };
23   nativeBuildInputs = [ wireshark-cli ];
25   patches = [
26     # Do update while building package from wireshark-cli
27     ./internal_db_update_nix.patch
28     # Fix MANUF_URL for external db update functionality (https://github.com/coolbho3k/manuf/issues/34)
29     ./fix_manuf_url.patch
30   ];
32   postPatch = ''
33     ${lib.getExe wireshark-cli} -G manuf > manuf/manuf
34     cat ${wireshark-cli}/share/wireshark/wka >> manuf/manuf
35   '';
37   nativeCheckInputs = [ pytestCheckHook ];
39   disabledTests = [ "test_update_update" ];
41   pythonImportsCheck = [ "manuf" ];
43   passthru.tests = {
44     testMacAddress = runCommand "${pname}-test" { } ''
45       ${lib.getExe manuf} BC:EE:7B:00:00:00 > $out
46       [ "$(cat $out | tr -d '\n')" = "Vendor(manuf='ASUSTekC', manuf_long='ASUSTek COMPUTER INC.', comment=None)" ]
47     '';
48   };
50   meta = with lib; {
51     homepage = "https://github.com/coolbho3k/manuf";
52     description = " Parser library for Wireshark's OUI database";
53     mainProgram = "manuf";
54     platforms = platforms.linux;
55     license = with licenses; [
56       lgpl3Plus
57       asl20
58     ];
59     maintainers = with maintainers; [ dsuetin ];
60   };