Merge pull request #306277 from adamcstephens/ovs/fix-python313

openvswitch*: fix 3.13 compatibility, apply RFCs, add self
This commit is contained in:
Adam C. Stephens 2024-04-26 16:29:51 -04:00 committed by GitHub
commit 0b868df4ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 59 additions and 41 deletions

View file

@ -1,32 +1,35 @@
{ version {
, hash version,
, updateScriptArgs ? "" hash,
updateScriptArgs ? "",
}: }:
{ lib {
, stdenv lib,
, fetchurl stdenv,
, autoconf fetchurl,
, automake autoconf,
, installShellFiles automake,
, iproute2 installShellFiles,
, kernel ? null iproute2,
, libcap_ng kernel ? null,
, libtool libcap_ng,
, openssl libtool,
, perl openssl,
, pkg-config perl,
, procps pkg-config,
, python3 procps,
, sphinxHook python3,
, util-linux sphinxHook,
, which util-linux,
, writeScript which,
writeScript,
}: }:
let let
_kernel = kernel; _kernel = kernel;
in stdenv.mkDerivation rec { in
stdenv.mkDerivation rec {
pname = "openvswitch"; pname = "openvswitch";
inherit version; inherit version;
@ -45,6 +48,9 @@ in stdenv.mkDerivation rec {
patches = [ patches = [
# 8: vsctl-bashcomp - argument completion FAILED (completion.at:664) # 8: vsctl-bashcomp - argument completion FAILED (completion.at:664)
./patches/disable-bash-arg-completion-test.patch ./patches/disable-bash-arg-completion-test.patch
# https://github.com/openvswitch/ovs/commit/9185793e75435d890f18d391eaaeab0ade6f1415
./patches/fix-python313.patch
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
@ -56,9 +62,7 @@ in stdenv.mkDerivation rec {
sphinxHook sphinxHook
]; ];
sphinxBuilders = [ sphinxBuilders = [ "man" ];
"man"
];
sphinxRoot = "./Documentation"; sphinxRoot = "./Documentation";
@ -78,7 +82,7 @@ in stdenv.mkDerivation rec {
"--localstatedir=/var" "--localstatedir=/var"
"--sharedstatedir=/var" "--sharedstatedir=/var"
"--sbindir=$(out)/bin" "--sbindir=$(out)/bin"
] ++ (lib.optionals (_kernel != null) ["--with-linux"]); ] ++ (lib.optionals (_kernel != null) [ "--with-linux" ]);
# Leave /var out of this! # Leave /var out of this!
installFlags = [ installFlags = [
@ -102,13 +106,13 @@ in stdenv.mkDerivation rec {
patchShebangs tests/ patchShebangs tests/
''; '';
nativeCheckInputs = [ nativeCheckInputs =
iproute2 [ iproute2 ]
] ++ (with python3.pkgs; [ ++ (with python3.pkgs; [
netaddr netaddr
pyparsing pyparsing
pytest pytest
]); ]);
passthru.updateScript = writeScript "ovs-update.nu" '' passthru.updateScript = writeScript "ovs-update.nu" ''
${./update.nu} ${updateScriptArgs} ${./update.nu} ${updateScriptArgs}
@ -129,7 +133,11 @@ in stdenv.mkDerivation rec {
''; '';
homepage = "https://www.openvswitch.org/"; homepage = "https://www.openvswitch.org/";
license = licenses.asl20; license = licenses.asl20;
maintainers = with maintainers; [ netixx kmcopper ]; maintainers = with maintainers; [
adamcstephens
kmcopper
netixx
];
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }

View file

@ -0,0 +1,12 @@
diff --git a/tests/vlog.at b/tests/vlog.at
index 785014956e7..efe91479a63 100644
--- a/tests/vlog.at
+++ b/tests/vlog.at
@@ -8,6 +8,7 @@ AT_CHECK([$PYTHON3 $srcdir/test-vlog.py --log-file log_file \
AT_CHECK([sed -e 's/.*-.*-.*T..:..:..Z |//' \
-e 's/File ".*", line [[0-9]][[0-9]]*,/File <name>, line <number>,/' \
+-e '/\^\+/d' \
stderr_log], [0], [dnl
0 | module_0 | EMER | emergency
1 | module_0 | ERR | error

View file

@ -1,7 +1,7 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i nu -p nushell common-updater-scripts #!nix-shell -i nu -p nushell common-updater-scripts
def main [--lts: bool = false, --regex: string] { def main [--lts = false, --regex: string] {
let tags = list-git-tags --url=https://github.com/openvswitch/ovs | lines | sort --natural | str replace v '' let tags = list-git-tags --url=https://github.com/openvswitch/ovs | lines | sort --natural | str replace v ''
let latest_tag = if $regex == null { $tags } else { $tags | find --regex $regex } | last let latest_tag = if $regex == null { $tags } else { $tags | find --regex $regex } | last
@ -9,9 +9,9 @@ def main [--lts: bool = false, --regex: string] {
if $latest_tag != $current_version { if $latest_tag != $current_version {
if $lts { if $lts {
update-source-version openvswitch-lts $latest_tag $"--file=(pwd)/pkgs/os-specific/linux/openvswitch/lts.nix" update-source-version openvswitch-lts $latest_tag $"--file=(pwd)/pkgs/by-name/op/openvswitch/lts.nix"
} else { } else {
update-source-version openvswitch $latest_tag $"--file=(pwd)/pkgs/os-specific/linux/openvswitch/default.nix" update-source-version openvswitch $latest_tag $"--file=(pwd)/pkgs/by-name/op/openvswitch/default.nix"
} }
} }

View file

@ -11543,9 +11543,7 @@ with pkgs;
opentelemetry-collector = callPackage ../tools/misc/opentelemetry-collector { }; opentelemetry-collector = callPackage ../tools/misc/opentelemetry-collector { };
opentelemetry-collector-contrib = callPackage ../tools/misc/opentelemetry-collector/contrib.nix { }; opentelemetry-collector-contrib = callPackage ../tools/misc/opentelemetry-collector/contrib.nix { };
openvswitch = callPackage ../os-specific/linux/openvswitch { }; openvswitch-lts = callPackage ../by-name/op/openvswitch/lts.nix { };
openvswitch-lts = callPackage ../os-specific/linux/openvswitch/lts.nix { };
ovn-lts = callPackage ../by-name/ov/ovn/lts.nix { }; ovn-lts = callPackage ../by-name/ov/ovn/lts.nix { };