nixpkgs/pkgs/tools/networking/wifite2/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

57 lines
1.6 KiB
Nix

{ stdenv, lib, fetchFromGitHub, fetchpatch, python3, wirelesstools
, aircrack-ng, wireshark-cli, reaverwps-t6x, cowpatty, hashcat, hcxtools
, hcxdumptool, pyrit, which }:
python3.pkgs.buildPythonApplication rec {
version = "2.5.5";
pname = "wifite2";
src = fetchFromGitHub {
owner = "kimocoder";
repo = "wifite2";
rev = version;
sha256 = "0rh54gj471dn8442imxwasjrrwzsx4m40nylkw3y6p8rbjmb92h4";
};
patches = [
(fetchpatch {
url = "https://salsa.debian.org/pkg-security-team/wifite/raw/debian/${version}-1/debian/patches/Disable-aircrack-failing-test.patch";
sha256 = "04qql8w27c1lqk59ghkr1n6r08jwdrb1dcam5k88szkk2bxv8yx1";
})
(fetchpatch {
url = "https://salsa.debian.org/pkg-security-team/wifite/raw/debian/${version}-1/debian/patches/Disable-two-failing-tests.patch";
sha256 = "1sixcqz1kbkhxf38yq55pwycm54adjx22bq46dfnl44mg69nx356";
})
];
propagatedBuildInputs = [
aircrack-ng
wireshark-cli
reaverwps-t6x
cowpatty
hashcat
hcxtools
hcxdumptool
wirelesstools
pyrit
which
];
postFixup = let
sitePackagesDir = "$out/lib/python3.${lib.versions.minor python3.version}/site-packages";
in ''
mv ${sitePackagesDir}/wifite/__main__.py ${sitePackagesDir}/wifite/wifite.py
'';
checkInputs = propagatedBuildInputs;
checkPhase = "python -m unittest discover tests -v";
meta = with lib; {
homepage = "https://github.com/derv82/wifite2";
description = "Rewrite of the popular wireless network auditor, wifite";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ lassulus danielfullmer ];
};
}