1{ version
2, hash
3}:
4
5{ lib
6, stdenv
7, fetchurl
8, autoconf
9, automake
10, installShellFiles
11, iproute2
12, kernel ? null
13, libcap_ng
14, libtool
15, openssl
16, perl
17, pkg-config
18, procps
19, python3
20, sphinxHook
21, util-linux
22, which
23}:
24
25let
26 _kernel = kernel;
27in stdenv.mkDerivation rec {
28 pname = "openvswitch";
29 inherit version;
30
31 kernel = lib.optional (_kernel != null) _kernel.dev;
32
33 src = fetchurl {
34 url = "https://www.openvswitch.org/releases/${pname}-${version}.tar.gz";
35 inherit hash;
36 };
37
38 outputs = [
39 "out"
40 "man"
41 ];
42
43 patches = [
44 # 8: vsctl-bashcomp - argument completion FAILED (completion.at:664)
45 ./patches/disable-bash-arg-completion-test.patch
46 ];
47
48 nativeBuildInputs = [
49 autoconf
50 automake
51 installShellFiles
52 libtool
53 pkg-config
54 sphinxHook
55 ];
56
57 sphinxBuilders = [
58 "man"
59 ];
60
61 sphinxRoot = "./Documentation";
62
63 buildInputs = [
64 libcap_ng
65 openssl
66 perl
67 procps
68 python3
69 util-linux
70 which
71 ];
72
73 preConfigure = "./boot.sh";
74
75 configureFlags = [
76 "--localstatedir=/var"
77 "--sharedstatedir=/var"
78 "--sbindir=$(out)/bin"
79 ] ++ (lib.optionals (_kernel != null) ["--with-linux"]);
80
81 # Leave /var out of this!
82 installFlags = [
83 "LOGDIR=$(TMPDIR)/dummy"
84 "RUNDIR=$(TMPDIR)/dummy"
85 "PKIDIR=$(TMPDIR)/dummy"
86 ];
87
88 enableParallelBuilding = true;
89
90 postInstall = ''
91 installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash
92 installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash
93 '';
94
95 doCheck = true;
96
97 checkInputs = [
98 iproute2
99 ] ++ (with python3.pkgs; [
100 netaddr
101 pyparsing
102 pytest
103 ]);
104
105 meta = with lib; {
106 changelog = "https://www.openvswitch.org/releases/NEWS-${version}.txt";
107 description = "A multilayer virtual switch";
108 longDescription = ''
109 Open vSwitch is a production quality, multilayer virtual switch
110 licensed under the open source Apache 2.0 license. It is
111 designed to enable massive network automation through
112 programmatic extension, while still supporting standard
113 management interfaces and protocols (e.g. NetFlow, sFlow, SPAN,
114 RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to
115 support distribution across multiple physical servers similar
116 to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V.
117 '';
118 homepage = "https://www.openvswitch.org/";
119 license = licenses.asl20;
120 maintainers = with maintainers; [ netixx kmcopper ];
121 platforms = platforms.linux;
122 };
123}