ovn/ovn-lts: init at 23.09.1/22.03.5

This commit is contained in:
Adam Stephens 2023-12-21 11:08:12 -05:00
parent bb67b22244
commit 32c6918ba5
No known key found for this signature in database
5 changed files with 126 additions and 0 deletions

@ -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;
};
}

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

@ -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

@ -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}
}

@ -11750,6 +11750,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;