nixpkgs/pkgs/by-name/cr/crc/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
2.1 KiB
Nix
Raw Normal View History

2022-05-19 23:59:13 +02:00
{ lib
, buildGoModule
, fetchFromGitHub
, testers
, crc
, coreutils
}:
let
2024-02-08 09:20:18 +01:00
openShiftVersion = "4.14.8";
okdVersion = "4.14.0-0.okd-scos-2024-01-10-151818";
microshiftVersion = "4.14.8";
podmanVersion = "4.4.4";
writeKey = "$(MODULEPATH)/pkg/crc/segment.WriteKey=cvpHsNcmGCJqVzf6YxrSnVlwFSAZaYtp";
2024-02-08 09:20:18 +01:00
gitCommit = "54a6f9a15155edb2bdb70128c7c535fc69841031";
gitHash = "sha256-tjrlh31J3fDiYm2+PUnVVRIxxQvJKQVLcYEnMekD4Us=";
2022-05-19 23:59:13 +02:00
in
buildGoModule rec {
2024-02-08 09:20:18 +01:00
version = "2.32.0";
2022-05-19 23:59:13 +02:00
pname = "crc";
src = fetchFromGitHub {
owner = "crc-org";
2022-05-19 23:59:13 +02:00
repo = "crc";
rev = "v${version}";
2023-03-20 16:51:38 +01:00
hash = gitHash;
2022-05-19 23:59:13 +02:00
};
2023-03-20 16:51:38 +01:00
vendorHash = null;
2022-05-19 23:59:13 +02:00
postPatch = ''
substituteInPlace pkg/crc/oc/oc_linux_test.go \
--replace "/bin/echo" "${coreutils}/bin/echo"
'';
subPackages = [
"cmd/crc"
];
2022-05-19 23:59:13 +02:00
tags = [ "containers_image_openpgp" ];
ldflags = [
"-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 23:59:13 +02:00
];
preCheck = ''
2022-05-19 23:59:13 +02:00
export HOME=$(mktemp -d)
'';
passthru.tests.version = testers.testVersion {
package = crc;
command = ''
export HOME=$(mktemp -d)
crc version
'';
};
passthru.updateScript = ./update.sh;
2022-05-19 23:59:13 +02:00
meta = with lib; {
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 23:59:13 +02:00
license = licenses.asl20;
mainProgram = "crc";
2023-02-21 18:32:27 +01:00
maintainers = with maintainers; [ matthewpi shikanime tricktron ];
2022-05-19 23:59:13 +02:00
};
}