mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
vfkit: build from source
Co-authored-by: Mario Rodas <marsam@users.noreply.github.com>
(cherry picked from commit cd1ee59b41
)
This commit is contained in:
parent
d669d3087f
commit
31453d3f16
@ -1,31 +1,50 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
fetchurl,
|
apple-sdk_14,
|
||||||
stdenvNoCC,
|
buildGoModule,
|
||||||
|
darwin,
|
||||||
|
darwinMinVersionHook,
|
||||||
|
fetchFromGitHub,
|
||||||
testers,
|
testers,
|
||||||
|
vfkit,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
buildGoModule rec {
|
||||||
pname = "vfkit";
|
pname = "vfkit";
|
||||||
version = "0.5.1";
|
version = "0.5.1";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchFromGitHub {
|
||||||
url = "https://github.com/crc-org/vfkit/releases/download/v${finalAttrs.version}/vfkit";
|
owner = "crc-org";
|
||||||
hash = "sha256-at+KsvsKO359d4VUvcSuio2ej5hM6//U4Mj/jqXwhEc=";
|
repo = "vfkit";
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-9iPr9VhN60B6kBikdEIFAs5mMH+VcmnjGhLuIa3A2JU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
dontUnpack = true;
|
vendorHash = "sha256-6O1T9aOCymYXGAIR/DQBWfjc2sCyU/nZu9b1bIuXEps=";
|
||||||
|
|
||||||
installPhase = ''
|
subPackages = [ "cmd/vfkit" ];
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
install -Dm755 $src $out/bin/vfkit
|
ldflags = [
|
||||||
|
"-s"
|
||||||
|
"-w"
|
||||||
|
"-X github.com/crc-org/vfkit/pkg/cmdline.gitVersion=${src.rev}"
|
||||||
|
];
|
||||||
|
|
||||||
runHook postInstall
|
nativeBuildInputs = [
|
||||||
|
darwin.sigtool
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
apple-sdk_14
|
||||||
|
(darwinMinVersionHook "11")
|
||||||
|
];
|
||||||
|
|
||||||
|
postFixup = ''
|
||||||
|
codesign --entitlements vf.entitlements -f -s - $out/bin/vfkit
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests = {
|
passthru.tests = {
|
||||||
version = testers.testVersion { package = finalAttrs.finalPackage; };
|
version = testers.testVersion { package = vfkit; };
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
@ -34,9 +53,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
|||||||
license = lib.licenses.asl20;
|
license = lib.licenses.asl20;
|
||||||
maintainers = with lib.maintainers; [ sarcasticadmin ];
|
maintainers = with lib.maintainers; [ sarcasticadmin ];
|
||||||
platforms = lib.platforms.darwin;
|
platforms = lib.platforms.darwin;
|
||||||
# Source build will be possible after darwin SDK 12.0 bump
|
sourceProvenance = [ lib.sourceTypes.fromSource ];
|
||||||
# https://github.com/NixOS/nixpkgs/pull/229210
|
|
||||||
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
|
||||||
mainProgram = "vfkit";
|
mainProgram = "vfkit";
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user