home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (3221B)


      1 { stdenv, lib, buildGoPackage, buildGoModule, fetchFromGitHub, pkg-config, libvirt, podman, oc_4_4, oc_4_3 }:
      2 
      3 with lib;
      4 rec {
      5   crcGen =
      6     { version
      7     , sha256
      8     , bundle
      9     , oc
     10     , crc_driver_libvirt
     11     , patches
     12     }: buildGoPackage rec {
     13       inherit patches;
     14 
     15       pname = "crc";
     16       name = "${pname}-${version}";
     17 
     18       src = fetchFromGitHub {
     19         inherit sha256;
     20         owner = "code-ready";
     21         repo = "crc";
     22         rev = "${version}";
     23       };
     24 
     25       goPackagePath = "github.com/code-ready/crc";
     26       subPackages = [ "cmd/crc" ];
     27       buildFlagsArray =
     28         let
     29           t = "${goPackagePath}/pkg/crc";
     30         in
     31         ''
     32           -ldflags=
     33             -X ${t}/version.crcVersion=${version}
     34             -X ${t}/version.bundleVersion=${bundle}
     35             -X ${t}/constants.OcBinaryName=${oc}/bin/oc
     36             -X ${t}/constants.PodmanBinaryName=${podman}/bin/podman
     37             -X ${t}/machine/libvirt.MachineDriverCommand=${crc_driver_libvirt}/bin/machine-driver-libvirt
     38         '';
     39 
     40       meta = with lib; {
     41         homepage = https://github.com/code-ready/crc;
     42         description = "OpenShift 4.x cluster for testing and development purposes";
     43         license = licenses.asl20;
     44         maintainers = with maintainers; [ vdemeester ];
     45       };
     46     };
     47 
     48   crc_driver_libvirtGen =
     49     { version
     50     , sha256
     51     , vendorSha256
     52     ,
     53     }: buildGoModule rec {
     54       inherit vendorSha256;
     55       pname = "crc_driver_libvirt";
     56       name = "${pname}-${version}";
     57 
     58       nativeBuildInputs = [ pkg-config ];
     59       buildInputs = [ libvirt ];
     60 
     61       subPackages = [ "cmd/machine-driver-libvirt" ];
     62       src = fetchFromGitHub {
     63         inherit sha256;
     64         owner = "code-ready";
     65         repo = "machine-driver-libvirt";
     66         rev = "${version}";
     67       };
     68       modSha256 = "${vendorSha256}";
     69 
     70     };
     71 
     72 
     73   # bundle is https://storage.googleapis.com/crc-bundle-github-ci/crc_libvirt_4.4.3.zip
     74   crc_1_9 = makeOverridable crcGen {
     75     version = "1.9.0";
     76     sha256 = "1q2jdm847snjj7wqchsik7qpczvx4awgi5rgvw930mm2b635r3aq";
     77     bundle = "4.3.10";
     78     oc = oc_4_3;
     79     patches = [ ./patches/1_9.patch ];
     80     crc_driver_libvirt = crc_driver_libvirt_0_12_7;
     81   };
     82   crc_1_10 = makeOverridable crcGen {
     83     version = "1.10.0";
     84     sha256 = "11vy42zb2xzhwsgnz17894gfn03knvp2yr094k3zhly6wkxbwbk3";
     85     bundle = "4.4.3";
     86     oc = oc_4_4;
     87     patches = [ ./patches/1_10.patch ];
     88     crc_driver_libvirt = crc_driver_libvirt_0_12_7;
     89   };
     90   crc_1_11 = makeOverridable crcGen {
     91     version = "1.11.0";
     92     sha256 = "1r302qwpmh3wj9lb46fza3swksylm4zrq9jijz56qk9392yxj1v4";
     93     bundle = "4.4.5";
     94     oc = oc_4_4;
     95     patches = [ ./patches/1_11.patch ];
     96     crc_driver_libvirt = crc_driver_libvirt_0_12_8;
     97   };
     98   crc_driver_libvirt_0_12_7 = makeOverridable crc_driver_libvirtGen {
     99     version = "0.12.7";
    100     sha256 = "1mv6wqyzsc24y2gnw0nxmiy52sf3lgfnqkq98v8jdvq3fn6lgacm";
    101     vendorSha256 = "069rac4m7y7m0lsk04ipsfvq8p51hwlkib2wrsnf7r9sla3dl6fx";
    102   };
    103   crc_driver_libvirt_0_12_8 = makeOverridable crc_driver_libvirtGen {
    104     version = "0.12.8";
    105     sha256 = "1ks6vb7276xn4mr2f6d6cg4dhp3mrqgxwr36v0md0fbl6bai6ppk";
    106     vendorSha256 = "069rac4m7y7m0lsk04ipsfvq8p51hwlkib2wrsnf7r9sla3dl6fx";
    107   };
    108 }