2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub
|
|
|
|
, which
|
2021-10-11 16:52:03 +00:00
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, help2man
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-10-11 16:52:03 +00:00
|
|
|
pyEnv = python3.withPackages(ps: [ ps.setuptools ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mininet";
|
2021-10-11 16:52:03 +00:00
|
|
|
version = "2.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "py" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mininet";
|
|
|
|
repo = "mininet";
|
|
|
|
rev = version;
|
2021-10-11 16:52:03 +00:00
|
|
|
sha256 = "sha256-bCppmeB+zQMKTptnzhsXtl72XJXU3USo7cQgP1Z6SrY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildFlags = [ "mnexec" ];
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2021-10-11 16:52:03 +00:00
|
|
|
pythonPath = [ python3.pkgs.setuptools ];
|
|
|
|
nativeBuildInputs = [ help2man ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ python3 which ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installTargets = [ "install-mnexec" "install-manpages" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out $py
|
|
|
|
# without --root, install fails
|
|
|
|
${pyEnv.interpreter} setup.py install --root="/" --prefix=$py
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Emulator for rapid prototyping of Software Defined Networks";
|
|
|
|
license = {
|
2021-10-11 16:52:03 +00:00
|
|
|
fullName = "Mininet 2.3.0 License";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
platforms = platforms.linux;
|
|
|
|
homepage = "https://github.com/mininet/mininet";
|
|
|
|
maintainers = with maintainers; [ teto ];
|
|
|
|
};
|
|
|
|
}
|