linuxkit-nix/hyperkit/default.nix
Nick Novitski fbfdf1fd80 hyperkit: set VERSION_SHA1 to rev
This fixes a runtime error: a failing assertion that the variable's content is 41 bytes long (40 characters plus a null terminator).
2019-07-30 11:27:12 -07:00

48 lines
1.3 KiB
Nix

{ stdenv, lib, fetchFromGitHub, Hypervisor, vmnet, SystemConfiguration, xpc, libobjc, dtrace }:
let
# Make sure to keep those in sync
version = "0.20180403";
rev = "06c3cf7ec253534b2d81f61ee3c85c5c9aafa4ee";
in
stdenv.mkDerivation rec {
name = "hyperkit-${version}";
src = fetchFromGitHub {
owner = "moby";
repo = "hyperkit";
inherit rev;
sha256 = "0c8fp03b65kk2lnjvg3fbcrnvxryy4f487l5l9r38r3j39aryzc2";
};
buildInputs = [ Hypervisor vmnet SystemConfiguration xpc libobjc dtrace ];
# Don't use git to determine version
prePatch = ''
substituteInPlace Makefile \
--replace 'shell git describe --abbrev=6 --dirty --always --tags' "$version" \
--replace 'shell git rev-parse HEAD' "${rev}" \
--replace 'PHONY: clean' 'PHONY:'
make src/include/xhyve/dtrace.h
'';
makeFlags = [
"CFLAGS+=-Wno-shift-sign-overflow"
''CFLAGS+=-DVERSION=\"${version}\"''
''CFLAGS+=-DVERSION_SHA1=\"${rev}\"''
];
installPhase = ''
mkdir -p $out/bin
cp build/hyperkit $out/bin
'';
meta = {
description = "A toolkit for embedding hypervisor capabilities in your application";
homepage = "https://github.com/moby/hyperkit";
maintainers = [ lib.maintainers.puffnfresh ];
platforms = lib.platforms.darwin;
license = lib.licenses.bsd3;
};
}