diff --git a/pkgs/tools/networking/snabbswitch/default.nix b/pkgs/tools/networking/snabb/default.nix similarity index 61% rename from pkgs/tools/networking/snabbswitch/default.nix rename to pkgs/tools/networking/snabb/default.nix index f7cd1a4300ac..8ba9cfa6dad8 100644 --- a/pkgs/tools/networking/snabbswitch/default.nix +++ b/pkgs/tools/networking/snabb/default.nix @@ -1,12 +1,14 @@ -{ stdenv, lib, fetchurl, bash, makeWrapper, git, mariadb, diffutils }: +{ stdenv, lib, fetchFromGitHub, bash, makeWrapper, git, mariadb, diffutils, which, coreutils, procps, nettools }: stdenv.mkDerivation rec { name = "snabb-${version}"; - version = "2015.12"; + version = "2016.04"; - src = fetchurl { - url = "https://github.com/SnabbCo/snabbswitch/archive/v${version}.tar.gz"; - sha256 = "1949a6d3hqdr2hdfmrr1na9gvjdwdahadbhmvz2pg7azmpq6ssmr"; + src = fetchFromGitHub { + owner = "snabbco"; + repo = "snabb"; + rev = "v${version}"; + sha256 = "1b5g477zy6cr5d9171xf8zrhhq6wxshg4cn78i5bki572q86kwlx"; }; buildInputs = [ makeWrapper ]; @@ -18,13 +20,15 @@ stdenv.mkDerivation rec { for f in $(find src/program/snabbnfv/ -type f); do substituteInPlace $f --replace "/bin/bash" "${bash}/bin/bash" done + + # We need a way to pass $PATH to the scripts + sed -i '2iexport PATH=${git}/bin:${mariadb}/bin:${which}/bin:${procps}/bin:${coreutils}/bin' src/program/snabbnfv/neutron_sync_master/neutron_sync_master.sh.inc + sed -i '2iexport PATH=${git}/bin:${coreutils}/bin:${diffutils}/bin:${nettools}/bin' src/program/snabbnfv/neutron_sync_agent/neutron_sync_agent.sh.inc ''; installPhase = '' mkdir -p $out/bin cp src/snabb $out/bin - - wrapProgram $out/bin/snabb --prefix PATH : "${ lib.makeBinPath [ git mariadb diffutils ]}" ''; meta = with stdenv.lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f8a5bdb8605f..e82b388eb739 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3202,7 +3202,7 @@ in smbnetfs = callPackage ../tools/filesystems/smbnetfs {}; - snabbswitch = callPackage ../tools/networking/snabbswitch { } ; + snabb = callPackage ../tools/networking/snabb { } ; sng = callPackage ../tools/graphics/sng { libpng = libpng12;