summary refs log tree commit diff
path: root/pkgs/os-specific/linux/openvswitch/lts.nix
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2022-11-20 12:37:10 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-11-20 15:39:53 +0100
commit7105c088a186e8f95d03b920cbd4eaa74b895522 (patch)
tree80b4a3994674d621e38e6853a4b4ed5e860038f7 /pkgs/os-specific/linux/openvswitch/lts.nix
parent18ab6d062bbaa2af7b99e4493d4baff85b6c8f09 (diff)
downloadnixpkgs-7105c088a186e8f95d03b920cbd4eaa74b895522.tar
nixpkgs-7105c088a186e8f95d03b920cbd4eaa74b895522.tar.gz
nixpkgs-7105c088a186e8f95d03b920cbd4eaa74b895522.tar.bz2
nixpkgs-7105c088a186e8f95d03b920cbd4eaa74b895522.tar.lz
nixpkgs-7105c088a186e8f95d03b920cbd4eaa74b895522.tar.xz
nixpkgs-7105c088a186e8f95d03b920cbd4eaa74b895522.tar.zst
nixpkgs-7105c088a186e8f95d03b920cbd4eaa74b895522.zip
openvswitch-lts: 2.5.12 -> 2.17.3
https://www.openvswitch.org/releases/NEWS-2.17.3.txt

- Generate manpages into separate output
- Enable test suite
  - Disables a test re bash arg completion that I can't get to work
- Set up meta.changelog
- Some reformatting
Diffstat (limited to 'pkgs/os-specific/linux/openvswitch/lts.nix')
-rw-r--r--pkgs/os-specific/linux/openvswitch/lts.nix105
1 files changed, 71 insertions, 34 deletions
diff --git a/pkgs/os-specific/linux/openvswitch/lts.nix b/pkgs/os-specific/linux/openvswitch/lts.nix
index 15c6c05b061..fba63a338da 100644
--- a/pkgs/os-specific/linux/openvswitch/lts.nix
+++ b/pkgs/os-specific/linux/openvswitch/lts.nix
@@ -1,26 +1,70 @@
-{ lib, stdenv, fetchurl, makeWrapper, pkg-config, util-linux, which
-, procps, libcap_ng, openssl, python2, perl
-, automake, autoconf, libtool, kernel ? null }:
-
-with lib;
+{ lib
+, stdenv
+, fetchurl
+, autoconf
+, automake
+, installShellFiles
+, iproute2
+, kernel ? null
+, libcap_ng
+, libtool
+, openssl
+, perl
+, pkg-config
+, procps
+, python3
+, sphinxHook
+, util-linux
+, which
+}:
 
 let
   _kernel = kernel;
 in stdenv.mkDerivation rec {
-  version = "2.5.12";
+  version = "2.17.3";
   pname = "openvswitch";
 
+  kernel = lib.optional (_kernel != null) _kernel.dev;
+
   src = fetchurl {
     url = "https://www.openvswitch.org/releases/${pname}-${version}.tar.gz";
-    sha256 = "0a8wa1lj5p28x3vq0yaxjhqmppp4hvds6hhm0j3czpp8mc09fsfq";
+    hash = "sha256-RGgR/JGuJFzDGQSmk3H7C/BEb3sk6yOaA320ADUwEcA=";
   };
 
-  patches = [ ./patches/lts-ssl.patch ];
+  outputs = [
+    "out"
+    "man"
+  ];
+
+  patches = [
+    # 8: vsctl-bashcomp - argument completion FAILED (completion.at:664)
+    ./patches/disable-bash-arg-completion-test.patch
+  ];
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    installShellFiles
+    libtool
+    pkg-config
+    sphinxHook
+  ];
 
-  kernel = optional (_kernel != null) _kernel.dev;
+  sphinxBuilders = [
+    "man"
+  ];
 
-  nativeBuildInputs = [ autoconf libtool automake pkg-config makeWrapper ];
-  buildInputs = [ util-linux openssl libcap_ng python2 perl procps which ];
+  sphinxRoot = "./Documentation";
+
+  buildInputs = [
+    libcap_ng
+    openssl
+    perl
+    procps
+    python3
+    util-linux
+    which
+  ];
 
   preConfigure = "./boot.sh";
 
@@ -28,7 +72,7 @@ in stdenv.mkDerivation rec {
     "--localstatedir=/var"
     "--sharedstatedir=/var"
     "--sbindir=$(out)/bin"
-  ] ++ (optionals (_kernel != null) ["--with-linux"]);
+  ] ++ (lib.optionals (_kernel != null) ["--with-linux"]);
 
   # Leave /var out of this!
   installFlags = [
@@ -37,34 +81,26 @@ in stdenv.mkDerivation rec {
     "PKIDIR=$(TMPDIR)/dummy"
   ];
 
-  postBuild = ''
-    # fix tests
-    substituteInPlace xenserver/opt_xensource_libexec_interface-reconfigure --replace '/usr/bin/env python' '${python2.interpreter}'
-    substituteInPlace vtep/ovs-vtep --replace '/usr/bin/env python' '${python2.interpreter}'
-  '';
-
   enableParallelBuilding = true;
-  doCheck = false; # bash-completion test fails with "compgen: command not found"
 
   postInstall = ''
-    cp debian/ovs-monitor-ipsec $out/share/openvswitch/scripts
-    makeWrapper \
-      $out/share/openvswitch/scripts/ovs-monitor-ipsec \
-      $out/bin/ovs-monitor-ipsec \
-      --prefix PYTHONPATH : "$out/share/openvswitch/python"
-    substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
-      --replace "UnixctlServer.create(None)" "UnixctlServer.create(os.environ['UNIXCTLPATH'])"
-    substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
-      --replace "self.psk_file" "root_prefix + self.psk_file"
-    substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
-      --replace "self.cert_dir" "root_prefix + self.cert_dir"
+    installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash
+    installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash
   '';
 
+  doCheck = true;
+  checkInputs = [
+    iproute2
+  ] ++ (with python3.pkgs; [
+    netaddr
+    pyparsing
+    pytest
+  ]);
+
   meta = with lib; {
-    platforms = platforms.linux;
+    changelog = "https://www.openvswitch.org/releases/NEWS-${version}.txt";
     description = "A multilayer virtual switch";
-    longDescription =
-      ''
+    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
@@ -73,9 +109,10 @@ in stdenv.mkDerivation rec {
       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;
     maintainers = with maintainers; [ netixx kmcopper ];
+    platforms = platforms.linux;
   };
 }