Unverified Commit 1b0090a4 authored by Fabián Heredia Montiel's avatar Fabián Heredia Montiel Committed by GitHub
Browse files

{lima,colima}: use pkill from nixpkgs on non-darwin (#458941)

parents da0651d4 cca6685c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
  installShellFiles,
  lima,
  makeWrapper,
  procps,
  qemu,
  testers,
  colima,
@@ -43,6 +44,14 @@ buildGoModule rec {

  env.CGO_ENABLED = 1;

  postPatch = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
    substituteInPlace cmd/daemon/daemon.go \
      --replace-fail '/usr/bin/pkill' '${lib.getExe' procps "pkill"}'

    substituteInPlace daemon/process/vmnet/vmnet.go \
      --replace-fail '/usr/bin/pkill' '${lib.getExe' procps "pkill"}'
  '';

  preConfigure = ''
    ldflags="-s -w -X github.com/abiosoft/colima/config.appVersion=${version} \
    -X github.com/abiosoft/colima/config.revision=$(cat .git-revision)"
+6 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
  buildGoModule,
  callPackage,
  installShellFiles,
  procps,
  qemu,
  darwin,
  makeWrapper,
@@ -40,6 +41,11 @@ buildGoModule (finalAttrs: {
    substituteInPlace Makefile \
      --replace-fail 'codesign -f -v --entitlements vz.entitlements -s -' 'codesign -f --entitlements vz.entitlements -s -' \
      --replace-fail 'rm -rf _output vendor' 'rm -rf _output'
  ''
  # fixed upstream, remove when version >=2.0.0
  + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
    substituteInPlace pkg/networks/usernet/recoincile.go \
      --replace-fail '/usr/bin/pkill' '${lib.getExe' procps "pkill"}'
  '';

  # It attaches entitlements with codesign and strip removes those,