2022-05-19 23:59:13 +02:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
|
|
|
, stdenv
|
|
|
|
, testers
|
|
|
|
, crc
|
|
|
|
, runtimeShell
|
|
|
|
, coreutils
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-01-03 03:39:10 +01:00
|
|
|
openShiftVersion = "4.11.13";
|
|
|
|
okdVersion = "4.11.0-0.okd-2022-11-05-030711";
|
|
|
|
podmanVersion = "4.2.0";
|
2022-05-19 23:59:13 +02:00
|
|
|
writeKey = "cvpHsNcmGCJqVzf6YxrSnVlwFSAZaYtp";
|
|
|
|
in
|
|
|
|
buildGoModule rec {
|
2023-01-03 03:39:10 +01:00
|
|
|
version = "2.11.0";
|
2022-05-19 23:59:13 +02:00
|
|
|
pname = "crc";
|
2023-01-03 03:39:10 +01:00
|
|
|
gitCommit = "a5f90a25abcacd4aa334490f0d204329abeaa691";
|
|
|
|
modRoot = "cmd/crc";
|
2022-05-19 23:59:13 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-01-03 03:39:10 +01:00
|
|
|
owner = "crc-org";
|
2022-05-19 23:59:13 +02:00
|
|
|
repo = "crc";
|
|
|
|
rev = "v${version}";
|
2023-01-03 03:39:10 +01:00
|
|
|
sha256 = "sha256-0e62mQ01pt0kClrEx4ss2T8BN1+0aQiCFPyDg5agbTU";
|
2022-05-19 23:59:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ git ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pkg/crc/oc/oc_linux_test.go \
|
|
|
|
--replace "/bin/echo" "${coreutils}/bin/echo"
|
|
|
|
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "/bin/bash" "${runtimeShell}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
tags = [ "containers_image_openpgp" ];
|
|
|
|
|
|
|
|
ldflags = [
|
2023-01-03 03:39:10 +01:00
|
|
|
"-X github.com/crc-org/crc/pkg/crc/version.crcVersion=${version}"
|
|
|
|
"-X github.com/crc-org/crc/pkg/crc/version.ocpVersion=${openShiftVersion}"
|
|
|
|
"-X github.com/crc-org/crc/pkg/crc/version.okdVersion=${okdVersion}"
|
|
|
|
"-X github.com/crc-org/crc/pkg/crc/version.podmanVersion=${podmanVersion}"
|
|
|
|
"-X github.com/crc-org/crc/pkg/crc/version.commitSha=${builtins.substring 0 8 gitCommit}"
|
|
|
|
"-X github.com/crc-org/crc/pkg/crc/segment.WriteKey=${writeKey}"
|
2022-05-19 23:59:13 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = crc;
|
|
|
|
command = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
crc version
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Manages a local OpenShift 4.x cluster or a Podman VM optimized for testing and development purposes";
|
|
|
|
homepage = "https://crc.dev";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ shikanime tricktron ];
|
|
|
|
};
|
|
|
|
}
|