Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
snabb/default.nix
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
39 lines (30 sloc)
970 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run like this: | |
# nix-build /path/to/this/directory | |
# ... and the files are produced in ./result/bin/snabb | |
{ pkgs ? (import <nixpkgs> {}) | |
, source ? ./. | |
, version ? "dev" | |
, supportOpenstack ? true | |
}: | |
with pkgs; | |
stdenv.mkDerivation rec { | |
name = "snabb-${version}"; | |
inherit version; | |
src = lib.cleanSource source; | |
buildInputs = [ makeWrapper ]; | |
patchPhase = '' | |
patchShebangs . | |
'' + lib.optionalString supportOpenstack '' | |
# 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 | |
''; | |
preBuild = '' | |
make clean | |
''; | |
installPhase = '' | |
mkdir -p $out/bin | |
cp src/snabb $out/bin | |
''; | |
enableParallelBuilding = true; | |
} |