Commit 8af2151b authored by Paul Meyer's avatar Paul Meyer
Browse files

crc: cleanup

- use subPackages instead of modRoot
- remove unused dependencies
- remove unused substitutions in Makefile
- set HOME in preCheck, as it is required for tests
parent 95bc6c92
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
{ lib
, buildGoModule
, fetchFromGitHub
, git
, stdenv
, testers
, crc
, runtimeShell
, coreutils
}:

@@ -21,7 +18,6 @@ in
buildGoModule rec {
  version = "2.30.0";
  pname = "crc";
  modRoot = "cmd/crc";

  src = fetchFromGitHub {
    owner = "crc-org";
@@ -32,16 +28,15 @@ buildGoModule rec {

  vendorHash = null;

  nativeBuildInputs = [ git ];

  postPatch = ''
    substituteInPlace pkg/crc/oc/oc_linux_test.go \
      --replace "/bin/echo" "${coreutils}/bin/echo"

    substituteInPlace Makefile \
      --replace "/bin/bash" "${runtimeShell}"
  '';

  subPackages = [
    "cmd/crc"
  ];

  tags = [ "containers_image_openpgp" ];

  ldflags = [
@@ -54,7 +49,7 @@ buildGoModule rec {
    "-X github.com/crc-org/crc/v2/pkg/crc/segment.WriteKey=${writeKey}"
  ];

  preBuild = ''
  preCheck = ''
    export HOME=$(mktemp -d)
  '';