nixpkgs/pkgs/tools/security/yersinia/default.nix
Rick van Schijndel 9833d56c24 treewide: mark packages broken that never built on PLATFORM
Done with the help of https://github.com/Mindavi/nixpkgs-mark-broken
Tool is still WIP but this is one of the first results.

I manually audited the results and removed some results that were not valid.

Note that some of these packages maybe should have more constrained platforms set
instead of broken set, but I think not being perfectly correct is better than
just keep trying to build all these things and never succeeding.

Some observations:

- Some darwin builds require XCode tools
- aarch64-linux builds sometimes suffer from using gcc9
  - gcc9 is getting older and misses some new libraries/features
- Sometimes tools try to do system detection or expect some explicit settings for
  platforms that are not x86_64-linux
2022-12-13 21:40:12 +01:00

65 lines
2.0 KiB
Nix

{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkg-config, fetchpatch
, ncurses, libpcap, libnet
# alpha version of GTK interface
, withGtk ? false, gtk2
# enable remote admin interface
, enableAdmin ? false
}:
stdenv.mkDerivation rec {
pname = "yersinia";
version = "0.8.2";
src = fetchFromGitHub {
owner = "tomac";
repo = pname;
rev = "v${version}";
sha256 = "06yfpf9iyi525rly1ychsihzvw3sas8kp0nxxr99xkwiqp5dc78b";
};
patches = [
# ncurses-6.3 support, included in next release
(fetchpatch {
name = "ncurses-6.3.patch";
url = "https://github.com/tomac/yersinia/commit/d91bbf6f475e7ea39f131b77ce91b2de9646d5ca.patch";
sha256 = "fl1pZKWA+nLtBm9+3FBFqaeuVZjszQCNkNl6Cf++BAI=";
})
# Pull upstream fix for -fno-common toolchain support:
# https://github.com/tomac/yersinia/pull/66
(fetchpatch {
name = "fno-common.patch";
url = "https://github.com/tomac/yersinia/commit/36247225dc7a6f38c4ba70537e20351f04762749.patch";
sha256 = "KHaN8gfgNROEico27gWnYiP9ZVhpWz0KjFYy2t5tPBo=";
})
];
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ libpcap libnet ncurses ]
++ lib.optional withGtk gtk2;
autoreconfPhase = "./autogen.sh";
configureFlags = [
"--with-pcap-includes=${libpcap}/include"
"--with-libnet-includes=${libnet}/include"
]
++ lib.optional (!enableAdmin) "--disable-admin"
++ lib.optional (!withGtk) "--disable-gtk";
makeFlags = [ "LDFLAGS=-lncurses" ];
meta = with lib; {
description = "A framework for layer 2 attacks";
homepage = "https://github.com/tomac/yersinia";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ vdot0x23 ];
# INSTALL and FAQ in this package seem a little outdated
# so not sure, but it could work on openbsd, illumos, and freebsd
# if you have a machine to test with, feel free to add these
platforms = with platforms; linux;
# never built on aarch64-linux since first introduction in nixpkgs
broken = stdenv.isLinux && stdenv.isAarch64;
};
}