From 7105c088a186e8f95d03b920cbd4eaa74b895522 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 20 Nov 2022 12:37:10 +0100 Subject: 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 --- pkgs/os-specific/linux/openvswitch/lts.nix | 105 +++++++++++++++++++---------- 1 file changed, 71 insertions(+), 34 deletions(-) (limited to 'pkgs/os-specific/linux/openvswitch/lts.nix') 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; }; } -- cgit 1.4.1