yafc-ce: 2.6.0 -> 2.7.0 (#378873)
[NixPkgs.git] / pkgs / by-name / op / openvswitch / package.nix
bloba128f77044c0e449187626555c4f84971f6555d7
2   withDPDK ? false,
4   lib,
5   stdenv,
7   autoconf,
8   automake,
9   dpdk,
10   fetchFromGitHub,
11   installShellFiles,
12   iproute2,
13   libcap_ng,
14   libpcap,
15   libtool,
16   makeWrapper,
17   nix-update-script,
18   nixosTests,
19   numactl,
20   openssl,
21   perl,
22   pkg-config,
23   procps,
24   python3,
25   sphinxHook,
26   tcpdump,
27   util-linux,
28   which,
31 stdenv.mkDerivation rec {
32   pname = if withDPDK then "openvswitch-dpdk" else "openvswitch";
33   version = "3.4.1";
35   src = fetchFromGitHub {
36     owner = "openvswitch";
37     repo = "ovs";
38     tag = "v${version}";
39     hash = "sha256-EudcANZ0aUImQ/HWSX1PRklvhP2D5L3ugXaC0GKyF0Q=";
40   };
42   outputs = [
43     "out"
44     "man"
45   ];
47   patches = [
48     # 8: vsctl-bashcomp - argument completion FAILED (completion.at:664)
49     ./patches/disable-bash-arg-completion-test.patch
50   ];
52   nativeBuildInputs = [
53     autoconf
54     automake
55     installShellFiles
56     libtool
57     pkg-config
58     sphinxHook
59     makeWrapper
60   ];
62   sphinxBuilders = [ "man" ];
64   sphinxRoot = "./Documentation";
66   buildInputs =
67     [
68       libcap_ng
69       openssl
70       perl
71       procps
72       python3
73       util-linux
74       which
75     ]
76     ++ (lib.optionals withDPDK [
77       dpdk
78       numactl
79       libpcap
80     ]);
82   preConfigure = "./boot.sh";
84   configureFlags = [
85     "--localstatedir=/var"
86     "--sharedstatedir=/var"
87     "--sbindir=$(out)/bin"
88   ] ++ (lib.optionals withDPDK [ "--with-dpdk=shared" ]);
90   # Leave /var out of this!
91   installFlags = [
92     "LOGDIR=$(TMPDIR)/dummy"
93     "RUNDIR=$(TMPDIR)/dummy"
94     "PKIDIR=$(TMPDIR)/dummy"
95   ];
97   enableParallelBuilding = true;
99   postInstall = ''
100     installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash
101     installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash
103     wrapProgram $out/bin/ovs-l3ping \
104       --prefix PYTHONPATH : $out/share/openvswitch/python
106     wrapProgram $out/bin/ovs-tcpdump \
107       --prefix PATH : ${lib.makeBinPath [ tcpdump ]} \
108       --prefix PYTHONPATH : $out/share/openvswitch/python
109   '';
111   doCheck = true;
112   preCheck = ''
113     export TESTSUITEFLAGS="-j$NIX_BUILD_CORES"
114     export RECHECK=yes
116     patchShebangs tests/
117   '';
119   nativeCheckInputs =
120     [ iproute2 ]
121     ++ (with python3.pkgs; [
122       netaddr
123       pyparsing
124       pytest
125       setuptools
126     ]);
128   passthru = {
129     tests = {
130       default = nixosTests.openvswitch;
131       incus = nixosTests.incus-lts.openvswitch;
132     };
134     updateScript = nix-update-script { };
135   };
137   meta = with lib; {
138     changelog = "https://www.openvswitch.org/releases/NEWS-${version}.txt";
139     description = "Multilayer virtual switch";
140     longDescription = ''
141       Open vSwitch is a production quality, multilayer virtual switch
142       licensed under the open source Apache 2.0 license. It is
143       designed to enable massive network automation through
144       programmatic extension, while still supporting standard
145       management interfaces and protocols (e.g. NetFlow, sFlow, SPAN,
146       RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to
147       support distribution across multiple physical servers similar
148       to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V.
149     '';
150     homepage = "https://www.openvswitch.org/";
151     license = licenses.asl20;
152     maintainers = with maintainers; [
153       adamcstephens
154       kmcopper
155       netixx
156       xddxdd
157     ];
158     platforms = platforms.linux;
159   };