nixpkgs/pkgs/development/tools/misc/linuxkit/default.nix
Boey Maun Suang 64faf2372d linuxkit: Fix Darwin runtime OS detection
The wrapper that linuxkit uses around the macOS Virtualization framework
tries to detect which OS it is running on, and aborts if it thinks that
the macOS version is not new enough to have the required framework
features.  This commit (mostly) fixes that macOS version detection when
the code is linked as if it is linked against the 10.12 SDK (as the
current Darwin ld wrapper does via the -platform_version switch), but is
then run on macOS 11 or later.
2023-02-15 20:24:20 +11:00

43 lines
1.1 KiB
Nix

{ lib, stdenv, buildGoModule, fetchFromGitHub, git, Cocoa, Virtualization, testers, linuxkit }:
buildGoModule rec {
pname = "linuxkit";
version = "1.0.1";
src = fetchFromGitHub {
owner = "linuxkit";
repo = "linuxkit";
rev = "v${version}";
sha256 = "sha256-8x9oJaYb/mN2TUaVrGOYi5/6TETD78jif0SwCSc0kyo=";
};
vendorSha256 = null;
modRoot = "./src/cmd/linuxkit";
patches = [ ./darwin-os-version.patch ./support-apple-11-sdk.patch ];
buildInputs = lib.optionals stdenv.isDarwin [ Cocoa Virtualization ];
ldflags = [
"-s"
"-w"
"-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=${version}"
];
nativeCheckInputs = [ git ];
passthru.tests.version = testers.testVersion {
package = linuxkit;
command = "linuxkit version";
};
meta = with lib; {
description = "A toolkit for building secure, portable and lean operating systems for containers";
license = licenses.asl20;
homepage = "https://github.com/linuxkit/linuxkit";
maintainers = with maintainers; [ nicknovitski ];
platforms = platforms.unix;
};
}