commit e8bc69b36854eaafce176cff03ee2520b8af0261
parent 5adacc542939643a9eaa20c0f755d45a9d55b202
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 3 Dec 2021 12:10:40 +0100
nix/packages: from buildFlagsArray to ldflags 🎏
This also updates buildkit, buildx and prm.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
6 files changed, 45 insertions(+), 47 deletions(-)
diff --git a/nix/packages/buildkit/default.nix b/nix/packages/buildkit/default.nix
@@ -2,22 +2,20 @@
buildGoModule rec {
name = "buildkit-${version}";
- version = "0.8.0";
+ version = "0.9.3";
rev = "v${version}";
subPackages = [ "cmd/buildctl" "cmd/buildkitd" ];
- buildFlagsArray = let t = "github.com/moby/buildkit/version"; in
- ''
- -ldflags=
- -X ${t}.Version=${version}
- '';
+ ldflags = [
+ "-X github.com/moby/buildkit/version.Version=${version}"
+ ];
src = fetchFromGitHub {
inherit rev;
owner = "moby";
repo = "buildkit";
- sha256 = "0qcgq93wj77i912xqhwrzkzaqz608ilczfn5kcsrf9jk2m1gnx7m";
+ sha256 = "sha256-xjuHMjJjA4sx2Hrr6tPpvKtSmhGZ3AZka733DLxmYfk=";
};
vendorSha256 = null;
doCheck = false;
diff --git a/nix/packages/buildx/default.nix b/nix/packages/buildx/default.nix
@@ -2,22 +2,20 @@
buildGoModule rec {
name = "buildx-${version}";
- version = "0.5.1";
+ version = "0.7.1";
rev = "v${version}";
subPackages = [ "cmd/buildx" ];
- buildFlagsArray = let t = "github.com/docker/buildx/version"; in
- ''
- -ldflags=
- -X ${t}.Version=${version}
- '';
+ ldflags = [
+ "-X github.com/docker/buildx/version.Version=${version}"
+ ];
src = fetchFromGitHub {
inherit rev;
owner = "docker";
repo = "buildx";
- sha256 = "0l03ncs1x4lhgy0kf7bd1zq00md8fi93f8xq6k0ans4400divfzk";
+ sha256 = "sha256-5EV0Rw1+ufxQ1wmQ0EJXQ7HVtXVbB4do/tet0QFRi08=";
};
vendorSha256 = null;
doCheck = false;
diff --git a/nix/packages/crc/default.nix b/nix/packages/crc/default.nix
@@ -24,18 +24,17 @@ rec {
goPackagePath = "github.com/code-ready/crc";
subPackages = [ "cmd/crc" ];
- buildFlagsArray =
+ ldflags =
let
t = "${goPackagePath}/pkg/crc";
in
- ''
- -ldflags=
- -X ${t}/version.crcVersion=${version}
- -X ${t}/version.bundleVersion=${bundle}
- -X ${t}/constants.OcBinaryName=${oc}/bin/oc
- -X ${t}/constants.PodmanBinaryName=${podman}/bin/podman
- -X ${t}/machine/libvirt.MachineDriverCommand=${crc_driver_libvirt}/bin/machine-driver-libvirt
- '';
+ [
+ "-X ${t}/version.crcVersion=${version}"
+ "-X ${t}/version.bundleVersion=${bundle}"
+ "-X ${t}/constants.OcBinaryName=${oc}/bin/oc"
+ "-X ${t}/constants.PodmanBinaryName=${podman}/bin/podman"
+ "-X ${t}/machine/libvirt.MachineDriverCommand=${crc_driver_libvirt}/bin/machine-driver-libvirt"
+ ];
meta = with lib; {
homepage = https://github.com/code-ready/crc;
diff --git a/nix/packages/operator-sdk/default.nix b/nix/packages/operator-sdk/default.nix
@@ -4,6 +4,7 @@ with lib;
rec {
operatorSdkGen =
{ version
+ , k8sVersion
, sha256
, vendorSha256
}:
@@ -17,15 +18,14 @@ rec {
builtInputs = [ "git" ];
subPackages = [ "cmd/operator-sdk" ];
- buildFlagsArray =
+ ldflags =
let
t = "github.com/operator-framework/operator-sdk/version";
in
- ''
- -ldflags=
- -X ${t}.GitVersion=${version}
- -X ${t}.KubernetesVersion=v1.17.2
- '';
+ [
+ "-X ${t}.GitVersion=${version}"
+ "-X ${t}.KubernetesVersion=${k8sVersion}"
+ ];
src = fetchFromGitHub {
inherit rev;
@@ -52,26 +52,31 @@ rec {
operator-sdk_0_18 = makeOverridable operatorSdkGen {
version = "0.18.0";
+ k8sVersion = "v1.17.2";
sha256 = "1jbi5v1kcni740znjxm6hbpjx3a1zlkgnbnpsqbiljfi6k7spn6p";
vendorSha256 = "08n6r0d7gqiysyl348l698blr7y9cxdmcadbmymzcya0fmczp0mv";
};
operator-sdk_0_19 = makeOverridable operatorSdkGen {
version = "0.19.0";
+ k8sVersion = "v1.17.2";
sha256 = "0prwdsxm8sldzdn7r9k1yw2q4asz90n25g4zcfaq23vs6fkxch9b";
vendorSha256 = "0k6xrd1ahic89l821qvh3rr8k203ab6fmj7v4flkv889xaajjxb0";
};
operator-sdk_1_13 = makeOverridable operatorSdkGen {
version = "1.13.0";
+ k8sVersion = "v1.21";
sha256 = "107rkh11qql77i0ahgipfgih843zfrbvf1k7gfrmvp2avns98m3x";
vendorSha256 = "1mvwrnik3mapghvi41zdxfd6d2d08hafnghypqqjwgdnin06bg98";
};
operator-sdk_1_14 = makeOverridable operatorSdkGen {
version = "1.14.0";
+ k8sVersion = "v1.21";
sha256 = "sha256-fLOCRg37YwRZwhQwMz6NSD/byYCZPu9+RZUqQbB9uBM=";
vendorSha256 = "sha256:1dgpc718nxgzn048q08in5cxjf1cya57a3pgykg96092pnh01n79";
};
operator-sdk_1_15 = makeOverridable operatorSdkGen {
version = "1.15.0";
+ k8sVersion = "v1.21";
sha256 = "sha256-8RWo+9XJrO/CU5vcnjzt0u2vbMmgP0aCa3iIZFEU50c=";
vendorSha256 = "sha256:1dgpc718nxgzn048q08in5cxjf1cya57a3pgykg96092pnh01n79";
};
diff --git a/nix/packages/prm/default.nix b/nix/packages/prm/default.nix
@@ -2,27 +2,28 @@
buildGoModule rec {
name = "prm-${version}";
- version = "3.4.0";
+ version = "3.4.5";
rev = "v${version}";
- buildFlagsArray = let t = "github.com/ldez/prm/v3/meta"; in
- ''
- -ldflags=
- -X ${t}.Version=${version}
- -X ${t}.BuildDate=unknown
- '';
+ ldflags =
+ let t = "github.com/ldez/prm/v3/meta";
+ in
+ [
+ "-X ${t}.Version=${version}"
+ "-X ${t}.BuildDate=unknown"
+ ];
src = fetchFromGitHub {
inherit rev;
owner = "ldez";
repo = "prm";
- sha256 = "1vpii7046rq13ahjkbk7rmbqskk6x1mcsrzqx91nii7nzl32wdap";
+ sha256 = "sha256-ZrzZ4aJ9uB7iFHLCDsTJp8POqOG2HhrIC2cYg31tYdg=";
};
- vendorSha256 = "0hiz514xklhk4c5c7lmx02l04dynnlmjy6mjwx3f7ynxiyk3scgz";
+ vendorSha256 = "1k1n2ylxrbkdwli0nh56fv7q8c7yl0661ayvpgirlp19704za509";
meta = {
description = "Pull Request Manager for Maintainers";
- homepage = "https://github.com/ldez/prm";
+ homepage = https://github.com/ldez/prm;
license = lib.licenses.asl20;
};
}
diff --git a/nix/packages/tkn/default.nix b/nix/packages/tkn/default.nix
@@ -8,14 +8,11 @@ rec {
name = "${pname}-${version}";
subPackages = [ "cmd/tkn" ];
- buildFlagsArray =
- let
- t = "github.com/tektoncd/cli/pkg/cmd/version";
- in
- ''
- -ldflags=
- -X ${t}.clientVersion=${version}
- '';
+ ldflags = [
+ "-s"
+ "-w"
+ "-X github.com/tektoncd/cli/pkg/cmd/version.clientVersion=${version}"
+ ];
src = fetchFromGitHub {
owner = "tektoncd";
repo = "cli";