1 { lib, stdenv, fetchurl, libpcap, sqlite, makeWrapper }:
3 stdenv.mkDerivation rec {
6 confdir = "/var/db/${pname}-${version}"; # the sqlite database is at "${confdir}/reaver/reaver.db"
9 url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/reaver-wps/reaver-${version}.tar.gz";
10 sha256 = "0bdjai4p8xbsw8zdkkk43rgsif79x0nyx4djpyv0mzh59850blxd";
13 nativeBuildInputs = [ makeWrapper ];
14 buildInputs = [ libpcap sqlite ];
16 # Workaround build failure on -fno-common toolchains:
17 # ld: crypto/dh_groups.o:src/crypto/../globule.h:141: multiple definition of
18 # `globule'; /build/ccrzO6vA.o:src/globule.h:141: first defined here
19 env.NIX_CFLAGS_COMPILE = "-fcommon";
22 sourceRoot=$(echo */src)
25 configureFlags = [ "--sysconfdir=${confdir}" ];
28 mkdir -p $out/{bin,etc}
29 cp reaver.db $out/etc/
30 cp reaver wash $out/bin/
32 wrapProgram $out/bin/reaver --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db"
33 wrapProgram $out/bin/wash --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db"
36 enableParallelBuilding = true;
38 patches = [ ./parallel-build.patch ];
41 description = "Brute force attack against Wifi Protected Setup";
42 homepage = "https://code.google.com/archive/p/reaver-wps/";
43 license = licenses.gpl2Plus;
44 platforms = platforms.linux;
45 maintainers = with maintainers; [ nico202 ];