From ac8fadc7f35009bf0fd81e9306c92a4238b0fe4c Mon Sep 17 00:00:00 2001 From: tricktron Date: Mon, 4 Jul 2022 13:28:02 +0200 Subject: [PATCH] colima: 0.4.2 -> 0.4.4 (#179522) * colima: use updated Makefile in build and install phases * colima: use lima-unwrapped * colima: fix dynamic version * colima: 0.4.2 -> 0.4.3 * colima: delete .git folder in postfetch when `leaveDotGit = true` Otherwise it may lead to non-deterministic behaviour. Co-authored-by: j-k * colima: do not override default buildGoModule phases The colima Makefile does more or less the same as the `buildGoModule` implementation. Instead of overriding it and using the Makefile directly, we reproduce the behaviour desired behaviour by customising env variables, e.g. `ldflags` and `subPackages`. Co-authored-by: j-k * colima: use `buildGoModule = buildGo118Module;` Co-authored-by: j-k * colima: update meta.description Co-authored-by: j-k * colima: set `CGO_ENABLED = 1` to make VPN connections work See https://github.com/abiosoft/colima/issues/358 * colima: 0.4.3 -> 0.4.4 * colima: define all ldflags in preConfigure Co-authored-by: Atemu * colima: add version test * colima: add meta.mainProgram and meta.platforms * colima: remove unused runCommand input Co-authored-by: j-k * colima: cleanup meta Co-authored-by: Sandro * colima: drop meta.platforms because we use the default value of `platforms.darwin ++ platforms.linux` Co-authored-by: Sandro Co-authored-by: Atemu * Update pkgs/applications/virtualization/colima/default.nix Co-authored-by: j-k Co-authored-by: Atemu Co-authored-by: Sandro --- .../virtualization/colima/default.nix | 35 ++++++++++++------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/virtualization/colima/default.nix b/pkgs/applications/virtualization/colima/default.nix index 4b756bb720a0..6b6d1364f753 100644 --- a/pkgs/applications/virtualization/colima/default.nix +++ b/pkgs/applications/virtualization/colima/default.nix @@ -1,43 +1,47 @@ { lib -, buildGo118Module +, buildGoModule , fetchFromGitHub , installShellFiles , lima , makeWrapper +, qemu +, testers +, colima }: -buildGo118Module rec { +buildGoModule rec { pname = "colima"; - version = "0.4.2"; + version = "0.4.4"; src = fetchFromGitHub { owner = "abiosoft"; repo = pname; rev = "v${version}"; - sha256 = "sha256-66nKH5jxTzLB9bg2lH1E8Cc0GZ6C/N/+yPYhCVEKOBY="; - + sha256 = "bSBaSS+rVkFqTSdyegdE/F0X5u7yvF/nHslAO3xgD6I="; # We need the git revision leaveDotGit = true; postFetch = '' - git -C $out rev-parse HEAD > $out/.git-revision + git -C $out rev-parse --short HEAD > $out/.git-revision rm -rf $out/.git ''; }; nativeBuildInputs = [ installShellFiles makeWrapper ]; - vendorSha256 = "sha256-91Ex3RPWxOHyZcR3Bo+bRdDAFw2mEGiC/uNKjdX2kuw="; + vendorSha256 = "sha256-jDzDwK7qA9lKP8CfkKzfooPDrHuHI4OpiLXmX9vOpOg="; - doCheck = false; + CGO_ENABLED = 1; preConfigure = '' - ldflags="-X github.com/abiosoft/colima/config.appVersion=${version} - -X github.com/abiosoft/colima/config.revision=$(cat .git-revision)" + ldflags="-s -w -X github.com/abiosoft/colima/config.appVersion=${version} \ + -X github.com/abiosoft/colima/config.revision=$(cat .git-revision)" ''; + subPackages = [ "cmd/colima" ]; + postInstall = '' wrapProgram $out/bin/colima \ - --prefix PATH : ${lib.makeBinPath [ lima ]} + --prefix PATH : ${lib.makeBinPath [ lima qemu ]} installShellCompletion --cmd colima \ --bash <($out/bin/colima completion bash) \ @@ -45,10 +49,15 @@ buildGo118Module rec { --zsh <($out/bin/colima completion zsh) ''; + passthru.tests.version = testers.testVersion { + package = colima; + command = "HOME=$(mktemp -d) colima version"; + }; + meta = with lib; { - description = "Container runtimes on MacOS with minimal setup"; + description = "Container runtimes with minimal setup"; homepage = "https://github.com/abiosoft/colima"; license = licenses.mit; - maintainers = with maintainers; [ aaschmid ]; + maintainers = with maintainers; [ aaschmid tricktron ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6414df64fe7a..3770016107c5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34527,7 +34527,7 @@ with pkgs; idsk = callPackage ../tools/filesystems/idsk { stdenv = gcc10StdenvCompat; }; - colima = callPackage ../applications/virtualization/colima { }; + colima = callPackage ../applications/virtualization/colima { buildGoModule = buildGo118Module; }; lima = callPackage ../applications/virtualization/lima { };