Merge pull request #275850 from adamcstephens/ovn-init-2

ovn/ovn-lts: init at 23.09.1/22.03.5, openvswitch*: improve checks
This commit is contained in:
Martin Weinelt 2023-12-23 18:19:09 +01:00 committed by GitHub
commit e57d206f0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 129 additions and 0 deletions

View file

@ -0,0 +1,96 @@
{
version,
hash,
updateScriptArgs ? "",
}:
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
gnused,
libbpf,
libcap_ng,
numactl,
openssl,
pkg-config,
procps,
python3,
unbound,
xdp-tools,
writeScript,
}:
stdenv.mkDerivation rec {
pname = "ovn";
inherit version;
src = fetchFromGitHub {
owner = "ovn-org";
repo = "ovn";
rev = "refs/tags/v${version}";
inherit hash;
fetchSubmodules = true;
};
nativeBuildInputs = [
autoreconfHook
pkg-config
python3
];
buildInputs = [
libbpf
libcap_ng
numactl
openssl
unbound
xdp-tools
];
# need to build the ovs submodule first
preConfigure = ''
pushd ovs
./boot.sh
./configure
make -j $NIX_BUILD_CORES
popd
'';
enableParallelBuilding = true;
doCheck = true;
nativeCheckInputs = [
gnused
procps
];
# https://docs.ovn.org/en/latest/topics/testing.html
preCheck = ''
export TESTSUITEFLAGS="-j$NIX_BUILD_CORES"
# allow rechecks to retry flaky tests
export RECHECK=yes
# hack to stop tests from trying to read /etc/resolv.conf
export OVS_RESOLV_CONF="$PWD/resolv.conf"
touch $OVS_RESOLV_CONF
'';
passthru.updateScript = writeScript "ovs-update.nu" ''
${./update.nu} ${updateScriptArgs}
'';
meta = with lib; {
description = "Open Virtual Network";
longDescription = ''
OVN (Open Virtual Network) is a series of daemons that translates virtual network configuration into OpenFlow, and installs them into Open vSwitch.
'';
homepage = "https://github.com/ovn-org/ovn";
changelog = "https://github.com/ovn-org/ovn/blob/${src.rev}/NEWS";
license = licenses.asl20;
maintainers = with maintainers; [ adamcstephens ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,5 @@
import ./generic.nix {
version = "22.03.5";
hash = "sha256-DMDWR7Dbgak0azPcVqDdFHGovTbLX8byp+jQ3rYvvX4=";
updateScriptArgs = "--lts=true --regex '22.03.*'";
}

View file

@ -0,0 +1,4 @@
import ./generic.nix {
version = "23.09.1";
hash = "sha256-t4DtV0wW/jQX7/TpsLFoDzzSPROrhUHHG09r9+lsdaQ=";
}

19
pkgs/by-name/ov/ovn/update.nu Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env nix-shell
#!nix-shell -i nu -p nushell common-updater-scripts
def main [--lts: bool = false, --regex: string] {
let tags = list-git-tags --url=https://github.com/ovn-org/ovn | lines | sort --natural | str replace v ''
let latest_tag = if $regex == null { $tags } else { $tags | find --regex $regex } | last
let current_version = nix eval --raw -f default.nix $"ovn(if $lts {"-lts"}).version" | str trim
if $latest_tag != $current_version {
if $lts {
update-source-version ovn-lts $latest_tag $"--file=(pwd)/pkgs/by-name/ov/ovn/lts.nix"
} else {
update-source-version ovn $latest_tag $"--file=(pwd)/pkgs/by-name/ov/ovn/package.nix"
}
}
{"lts?": $lts, before: $current_version, after: $latest_tag}
}

View file

@ -96,6 +96,9 @@ in stdenv.mkDerivation rec {
doCheck = true;
preCheck = ''
export TESTSUITEFLAGS="-j$NIX_BUILD_CORES"
export RECHECK=yes
patchShebangs tests/
'';

View file

@ -11748,6 +11748,8 @@ with pkgs;
openvswitch-lts = callPackage ../os-specific/linux/openvswitch/lts.nix { };
ovn-lts = callPackage ../by-name/ov/ovn/lts.nix { };
optifinePackages = callPackage ../tools/games/minecraft/optifine { };
optifine = optifinePackages.optifine-latest;