nixpkgs/pkgs/by-name/op/openvswitch/generic.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

144 lines
2.9 KiB
Nix
Raw Normal View History

2024-04-23 15:02:00 +02:00
{
version,
hash,
updateScriptArgs ? "",
2022-11-20 13:42:11 +01:00
}:
2024-04-23 15:02:00 +02:00
{
lib,
stdenv,
fetchurl,
autoconf,
automake,
installShellFiles,
iproute2,
kernel ? null,
libcap_ng,
libtool,
openssl,
perl,
pkg-config,
procps,
python3,
sphinxHook,
util-linux,
which,
writeScript,
2022-11-20 13:42:11 +01:00
}:
let
_kernel = kernel;
2024-04-23 15:02:00 +02:00
in
stdenv.mkDerivation rec {
2022-11-20 13:42:11 +01:00
pname = "openvswitch";
inherit version;
kernel = lib.optional (_kernel != null) _kernel.dev;
src = fetchurl {
url = "https://www.openvswitch.org/releases/${pname}-${version}.tar.gz";
inherit hash;
};
outputs = [
"out"
"man"
];
patches = [
# 8: vsctl-bashcomp - argument completion FAILED (completion.at:664)
./patches/disable-bash-arg-completion-test.patch
2024-04-23 14:53:51 +02:00
# https://github.com/openvswitch/ovs/commit/9185793e75435d890f18d391eaaeab0ade6f1415
./patches/fix-python313.patch
2022-11-20 13:42:11 +01:00
];
nativeBuildInputs = [
autoconf
automake
installShellFiles
libtool
pkg-config
sphinxHook
];
2024-04-23 15:02:00 +02:00
sphinxBuilders = [ "man" ];
2022-11-20 13:42:11 +01:00
sphinxRoot = "./Documentation";
buildInputs = [
libcap_ng
openssl
perl
procps
python3
util-linux
which
];
preConfigure = "./boot.sh";
configureFlags = [
"--localstatedir=/var"
"--sharedstatedir=/var"
"--sbindir=$(out)/bin"
2024-04-23 15:02:00 +02:00
] ++ (lib.optionals (_kernel != null) [ "--with-linux" ]);
2022-11-20 13:42:11 +01:00
# Leave /var out of this!
installFlags = [
"LOGDIR=$(TMPDIR)/dummy"
"RUNDIR=$(TMPDIR)/dummy"
"PKIDIR=$(TMPDIR)/dummy"
];
enableParallelBuilding = true;
postInstall = ''
installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash
installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash
'';
doCheck = true;
2023-04-25 23:48:34 +02:00
preCheck = ''
export TESTSUITEFLAGS="-j$NIX_BUILD_CORES"
export RECHECK=yes
2023-04-25 23:48:34 +02:00
patchShebangs tests/
'';
2022-11-20 13:42:11 +01:00
2024-04-23 15:02:00 +02:00
nativeCheckInputs =
[ iproute2 ]
++ (with python3.pkgs; [
netaddr
pyparsing
pytest
]);
2022-11-20 13:42:11 +01:00
2023-12-15 02:53:55 +01:00
passthru.updateScript = writeScript "ovs-update.nu" ''
${./update.nu} ${updateScriptArgs}
'';
2022-11-20 13:42:11 +01:00
meta = with lib; {
changelog = "https://www.openvswitch.org/releases/NEWS-${version}.txt";
description = "A multilayer virtual switch";
longDescription = ''
Open vSwitch is a production quality, multilayer virtual switch
licensed under the open source Apache 2.0 license. It is
designed to enable massive network automation through
programmatic extension, while still supporting standard
management interfaces and protocols (e.g. NetFlow, sFlow, SPAN,
RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to
support distribution across multiple physical servers similar
to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V.
'';
homepage = "https://www.openvswitch.org/";
license = licenses.asl20;
2024-04-23 15:02:00 +02:00
maintainers = with maintainers; [
adamcstephens
2024-04-23 15:02:00 +02:00
kmcopper
netixx
2024-04-23 15:02:00 +02:00
];
2022-11-20 13:42:11 +01:00
platforms = platforms.linux;
};
}