emaryn 2025-04-24 09:39:44 +08:00
parent b7d20dbed1
commit 1b98d9de85

View File

@ -7,25 +7,26 @@
func, func,
}: }:
buildGoModule rec { buildGoModule (finalAttrs: {
pname = "func"; pname = "func";
version = "1.10.0"; version = "1.16.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "knative"; owner = "knative";
repo = "func"; repo = "func";
rev = "knative-v${version}"; tag = "knative-v${finalAttrs.version}";
hash = "sha256-x/SrRkgeLvjcd9LNgMGOf5TLU1GXpjY2Z2MyxrBZckc="; hash = "sha256-nbS7X5WPu+WBtPUKShE5aWve5m2gw2naQQzNeG7pbGM=";
}; };
vendorHash = null; vendorHash = "sha256-Gn+nyck/VOwf8iKPeyLvsPWOpfdN/maUcQOLFAU0oic=";
subPackages = [ "cmd/func" ]; subPackages = [ "cmd/func" ];
ldflags = [ ldflags = [
"-X main.vers=v${version}" "-X knative.dev/func/pkg/app.vers=v${finalAttrs.version}"
"-X main.date=19700101T000000Z" "-X main.date=19700101T000000Z"
"-X main.hash=${version}" "-X knative.dev/func/pkg/app.hash=${finalAttrs.version}"
"-X knative.dev/func/pkg/app.kver=${finalAttrs.src.tag}"
]; ];
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
@ -39,15 +40,15 @@ buildGoModule rec {
passthru.tests.version = testers.testVersion { passthru.tests.version = testers.testVersion {
package = func; package = func;
command = "func version"; command = "func version";
version = "v${version}"; version = "v${finalAttrs.version}";
}; };
meta = with lib; { meta = {
description = "Knative client library and CLI for creating, building, and deploying Knative Functions"; description = "Knative client library and CLI for creating, building, and deploying Knative Functions";
mainProgram = "func"; mainProgram = "func";
homepage = "https://github.com/knative/func"; homepage = "https://github.com/knative/func";
changelog = "https://github.com/knative/func/releases/tag/knative-v${version}"; changelog = "https://github.com/knative/func/releases/tag/knative-v${finalAttrs.version}";
license = licenses.asl20; license = lib.licenses.asl20;
maintainers = with maintainers; [ maxwell-lt ]; maintainers = with lib.maintainers; [ maxwell-lt ];
}; };
} })