2024-12-10 19:26:33 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildGoModule,
|
|
|
|
fetchFromGitHub,
|
|
|
|
testers,
|
|
|
|
crc,
|
|
|
|
coreutils,
|
2022-05-19 21:59:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2024-05-15 16:13:48 +00:00
|
|
|
openShiftVersion = "4.15.12";
|
2024-04-08 12:44:45 +00:00
|
|
|
okdVersion = "4.15.0-0.okd-2024-02-23-163410";
|
2024-05-15 16:13:48 +00:00
|
|
|
microshiftVersion = "4.15.12";
|
2023-12-30 09:08:46 +00:00
|
|
|
podmanVersion = "4.4.4";
|
|
|
|
writeKey = "$(MODULEPATH)/pkg/crc/segment.WriteKey=cvpHsNcmGCJqVzf6YxrSnVlwFSAZaYtp";
|
2024-05-15 16:13:48 +00:00
|
|
|
gitCommit = "27c493c19b7f396931c3b94cc3367f572e6af04a";
|
|
|
|
gitHash = "sha256-uxp3DVYbbjKf1Cjj7GCf9QBxFq3K136k51eymD0U018=";
|
2022-05-19 21:59:13 +00:00
|
|
|
in
|
|
|
|
buildGoModule rec {
|
2024-05-15 16:13:48 +00:00
|
|
|
version = "2.36.0";
|
2022-05-19 21:59:13 +00:00
|
|
|
pname = "crc";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-01-03 02:39:10 +00:00
|
|
|
owner = "crc-org";
|
2022-05-19 21:59:13 +00:00
|
|
|
repo = "crc";
|
|
|
|
rev = "v${version}";
|
2023-03-20 15:51:38 +00:00
|
|
|
hash = gitHash;
|
2022-05-19 21:59:13 +00:00
|
|
|
};
|
|
|
|
|
2023-03-20 15:51:38 +00:00
|
|
|
vendorHash = null;
|
2022-05-19 21:59:13 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pkg/crc/oc/oc_linux_test.go \
|
|
|
|
--replace "/bin/echo" "${coreutils}/bin/echo"
|
|
|
|
'';
|
|
|
|
|
2023-12-30 10:04:05 +00:00
|
|
|
subPackages = [
|
|
|
|
"cmd/crc"
|
|
|
|
];
|
|
|
|
|
2022-05-19 21:59:13 +00:00
|
|
|
tags = [ "containers_image_openpgp" ];
|
|
|
|
|
|
|
|
ldflags = [
|
2023-12-30 09:08:46 +00:00
|
|
|
"-X github.com/crc-org/crc/v2/pkg/crc/version.crcVersion=${version}"
|
|
|
|
"-X github.com/crc-org/crc/v2/pkg/crc/version.ocpVersion=${openShiftVersion}"
|
|
|
|
"-X github.com/crc-org/crc/v2/pkg/crc/version.okdVersion=${okdVersion}"
|
|
|
|
"-X github.com/crc-org/crc/v2/pkg/crc/version.podmanVersion=${podmanVersion}"
|
|
|
|
"-X github.com/crc-org/crc/v2/pkg/crc/version.microshiftVersion=${microshiftVersion}"
|
|
|
|
"-X github.com/crc-org/crc/v2/pkg/crc/version.commitSha=${builtins.substring 0 8 gitCommit}"
|
|
|
|
"-X github.com/crc-org/crc/v2/pkg/crc/segment.WriteKey=${writeKey}"
|
2022-05-19 21:59:13 +00:00
|
|
|
];
|
|
|
|
|
2023-12-30 10:04:05 +00:00
|
|
|
preCheck = ''
|
2022-05-19 21:59:13 +00:00
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = crc;
|
|
|
|
command = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
crc version
|
|
|
|
'';
|
|
|
|
};
|
2023-01-16 09:34:00 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
2022-05-19 21:59:13 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-12-30 10:08:19 +00:00
|
|
|
description = "Manage a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes";
|
|
|
|
homepage = "https://crc.dev/crc/getting_started/getting_started/introducing/";
|
|
|
|
changelog = "https://github.com/crc-org/crc/releases/tag/v${version}";
|
2022-05-19 21:59:13 +00:00
|
|
|
license = licenses.asl20;
|
2023-12-30 10:08:19 +00:00
|
|
|
mainProgram = "crc";
|
2024-12-10 19:26:33 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
matthewpi
|
|
|
|
shikanime
|
|
|
|
tricktron
|
|
|
|
];
|
2022-05-19 21:59:13 +00:00
|
|
|
};
|
|
|
|
}
|