nixpkgs/pkgs/applications/networking/sniffers/kismet/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

52 lines
1.7 KiB
Nix

{ lib, stdenv, fetchurl, pkgconfig, libpcap, pcre, libnl, zlib, libmicrohttpd
, sqlite, protobuf, protobufc, libusb1, libcap, binutils, elfutils
, withNetworkManager ? false, glib, networkmanager
, withPython ? false, python3
, withSensors ? false, lm_sensors}:
# couldn't get python modules to build correctly,
# waiting for some other volunteer to fix it
assert !withPython;
stdenv.mkDerivation rec {
pname = "kismet";
version = "2020-09-R2";
src = fetchurl {
url = "https://www.kismetwireless.net/code/${pname}-${version}.tar.xz";
sha256 = "1n6y6sgqf50bng8n0mhs2r1w0ak14mv654sqay72a78wh2s7ywzg";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [
libpcap pcre libmicrohttpd libnl zlib sqlite protobuf protobufc
libusb1 libcap binutils elfutils
] ++ stdenv.lib.optionals withNetworkManager [ networkmanager glib ]
++ stdenv.lib.optional withSensors lm_sensors
++ stdenv.lib.optional withPython (python3.withPackages(ps: [ ps.setuptools ps.protobuf
ps.numpy ps.pyserial ]));
configureFlags = []
++ stdenv.lib.optional (!withNetworkManager) "--disable-libnm"
++ stdenv.lib.optional (!withPython) "--disable-python-tools"
++ stdenv.lib.optional (!withSensors) "--disable-lmsensors";
postConfigure = ''
sed -e 's/-o $(INSTUSR)//' \
-e 's/-g $(INSTGRP)//' \
-e 's/-g $(MANGRP)//' \
-e 's/-g $(SUIDGROUP)//' \
-i Makefile
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Wireless network sniffer";
homepage = "https://www.kismetwireless.net/";
license = licenses.gpl3;
platforms = platforms.linux;
};
}