depot/third_party/nixpkgs/pkgs/applications/virtualization/xhyve/default.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

39 lines
1.1 KiB
Nix

{ stdenv, lib, fetchFromGitHub, Hypervisor, vmnet, xpc, libobjc, zlib }:
stdenv.mkDerivation rec {
pname = "xhyve";
version = "20210203";
src = fetchFromGitHub {
owner = "machyve";
repo = "xhyve";
rev = "83516a009c692ea5d2993d1071e68d05d359b11e";
sha256 = "1pjdg4ppy6qh3vr1ls5zyw3jzcvwny9wydnmfpadwij1hvns7lj3";
};
buildInputs = [ Hypervisor vmnet xpc libobjc zlib ];
# Don't use git to determine version
prePatch = ''
substituteInPlace Makefile \
--replace 'shell git describe --abbrev=6 --dirty --always --tags' "$version"
'';
makeFlags = [ "CFLAGS+=-Wno-shift-sign-overflow" ''CFLAGS+=-DVERSION=\"${version}\"'' ];
installPhase = ''
mkdir -p $out/bin
cp build/xhyve $out/bin
'';
meta = with lib; {
description = "Lightweight Virtualization on macOS Based on bhyve";
homepage = "https://github.com/mist64/xhyve";
maintainers = [ maintainers.lnl7 ];
license = licenses.bsd2;
platforms = platforms.darwin;
# never built on aarch64-darwin since first introduction in nixpkgs
broken = stdenv.isDarwin && stdenv.isAarch64;
};
}