push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nix-update-script,
replaceVars,
}:
buildGoModule rec {
pname = "flottbot";
version = "0.15.1";
src = fetchFromGitHub {
owner = "target";
repo = "flottbot";
rev = version;
hash = "sha256-gOy03qrAzkZk99hVNe/tG1YLoUD5CMCE9AeONAJyeE4=";
};
patches = [
# patch out debug.ReadBuildInfo since version information is not available with buildGoModule
(replaceVars ./version.patch {
version = version;
vcsHash = version; # Maybe there is a way to get the git ref from src? idk.
})
];
vendorHash = "sha256-vXezNFEM/m5doVgt6T2+Q0PwP3lYALkhHD0cP4ul+JE=";
subPackages = [ "cmd/flottbot" ];
passthru = {
updateScript = nix-update-script { };
};
meta = with lib; {
description = "Chatbot framework written in Go";
homepage = "https://github.com/target/flottbot";
license = licenses.asl20;
maintainers = with maintainers; [ bryanhonof ];
sourceProvenance = [ sourceTypes.fromSource ];
mainProgram = "flottbot";
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,37 @@
diff --git a/version/version.go b/version/version.go
index 9ca8aba..d9bd968 100644
--- a/version/version.go
+++ b/version/version.go
@@ -4,9 +4,6 @@ package version
import (
"fmt"
- "runtime/debug"
-
- "github.com/Masterminds/semver/v3"
)
// Version supplies the semantic version.
@@ -14,20 +11,8 @@ var Version string
// String prints the build information for the bot.
func String() string {
- hash := "unknown"
-
- _, err := semver.NewVersion(Version)
- if err != nil {
- Version = "dev"
- }
-
- if info, ok := debug.ReadBuildInfo(); ok {
- for _, s := range info.Settings {
- if s.Key == "vcs.revision" {
- hash = s.Value
- }
- }
- }
+ Version = "@version@"
+ hash := "@vcsHash@"
return fmt.Sprintf("Version : %s\nGit Hash: %s\n", Version, hash)
}