From a5fea5b4361f95fe86147d7a4b3b565365d10ac2 Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sun, 19 Feb 2023 01:00:02 +0100
Subject: [PATCH] guix: guix-helper-bot: Use GIT-CHECKOUT.

* guix.scm (guix-helper-bot)[version]: Use something silly.
[source]: Use GIT-CHECKOUT.
---
 guix.scm | 149 ++++++++++++++++++++++++++-----------------------------
 1 file changed, 71 insertions(+), 78 deletions(-)

diff --git a/guix.scm b/guix.scm
index 217dbbb..0d27ae3 100644
--- a/guix.scm
+++ b/guix.scm
@@ -6,6 +6,7 @@
  (gnu packages tls)
  (guix build-system guile)
  (guix gexp)
+ (guix git)
  (guix git-download)
  ((guix licenses) #:prefix license:)
  (guix packages))
@@ -48,83 +49,75 @@ number base of 60.")
       (license license:agpl3+))))
 
 (define-public guix-helper-bot
-  (let ((commit "25381c44402c9dfea5723ef761f883cab5e2b542")
-        (revision "0"))
-    (package
-      (name "guix-helper-bot")
-      (version (git-version "0.0" revision commit))
-      (source (origin
-                (method git-fetch)
-                (uri (git-reference
-                      (url "https://codeberg.org/lechner/guix-helper-bot")
-                      (commit commit)))
-                (file-name (git-file-name name version))
-                (sha256
-                 (base32
-                  "0fdfn9fpl1yg4gpfws8z5idjv6bh1qf1xnqhzgpa7qxvgxppn4zm"))))
-      (build-system guile-build-system)
-      (arguments
-       (list
-        #:source-directory "scm"
-        #:phases
-        #~(modify-phases %standard-phases
-            (add-after 'patch-source-shebangs 'fix-env-s
-              (lambda* (#:key inputs #:allow-other-keys)
-                (substitute* "scm/guix-helper-bot.scm"
-                  (("/usr/bin/env -S guile ")
-                   (string-append (search-input-file inputs "/bin/guile") " \\\n")))))
-            (add-after 'install 'link-and-wrap-executable
-              (lambda _
-                (let* ((bin (string-append #$output "/bin"))
-                       (script (string-append bin "/guix-helper-bot"))
-                       (site-version (target-guile-effective-version))
-                       (scm (string-append "/share/guile/site/"
-                                           site-version))
-                       (go (string-append  "/lib/guile/"
-                                           site-version "/site-ccache"))
-                       (gnutls #$(this-package-input "guile-gnutls"))
-                       (irc #$(this-package-input "guile-irc"))
-                       (irregex #$(this-package-input "guile-irregex"))
-                       (json #$(this-package-input "guile-json"))
-                       (lib #$(this-package-input "guile-lib"))
-                       (naptcha #$(this-package-input "guile-naptcha")))
-                  (mkdir-p bin)
-                  (symlink (string-append #$output scm "/guix-helper-bot.scm")
-                           script)
-                  (wrap-program script #:sh (which "bash")
-                                `("GUILE_LOAD_PATH" prefix
-                                  (,(string-append #$output scm)
-                                   ,(string-append gnutls scm)
-                                   ,(string-append irc scm)
-                                   ,(string-append irregex scm)
-                                   ,(string-append json scm)
-                                   ,(string-append lib scm)
-                                   ,(string-append naptcha scm)))
-                                `("GUILE_LOAD_COMPILED_PATH" prefix
-                                  (,(string-append #$output go)
-                                   ,(string-append gnutls go)
-                                   ,(string-append irc go)
-                                   ,(string-append irregex go)
-                                   ,(string-append json go)
-                                   ,(string-append lib go)
-                                   ,(string-append naptcha go))))))))))
-      (native-inputs (list
-                      ;; see comment in guile-build-system
-                      guile-3.0))
-      (inputs (list
-               ;; for wrap-program
-               bash
-	       guile-3.0
-               guile-gnutls
-	       guile-irc
-               guile-irregex
-	       guile-json-4
-               guile-lib
-	       guile-naptcha))
-      (home-page "https://codeberg.org/lechner/guix-helper-bot")
-      (synopsis "IRC Bot Shedding Light on Bug Details")
-      (description
-       "This IRC bot offers helpful advice in Guix-related channels.")
-      (license license:agpl3+))))
+  (package
+    (name "guix-helper-bot")
+    (version "0-some-git-checkout")
+    (source (git-checkout
+             (url (getcwd))
+             (branch "history")))
+    (build-system guile-build-system)
+    (arguments
+     (list
+      #:source-directory "scm"
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'patch-source-shebangs 'fix-env-s
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "scm/guix-helper-bot.scm"
+                (("/usr/bin/env -S guile ")
+                 (string-append (search-input-file inputs "/bin/guile") " \\\n")))))
+          (add-after 'install 'link-and-wrap-executable
+            (lambda _
+              (let* ((bin (string-append #$output "/bin"))
+                     (script (string-append bin "/guix-helper-bot"))
+                     (site-version (target-guile-effective-version))
+                     (scm (string-append "/share/guile/site/"
+                                         site-version))
+                     (go (string-append  "/lib/guile/"
+                                         site-version "/site-ccache"))
+                     (gnutls #$(this-package-input "guile-gnutls"))
+                     (irc #$(this-package-input "guile-irc"))
+                     (irregex #$(this-package-input "guile-irregex"))
+                     (json #$(this-package-input "guile-json"))
+                     (lib #$(this-package-input "guile-lib"))
+                     (naptcha #$(this-package-input "guile-naptcha")))
+                (mkdir-p bin)
+                (symlink (string-append #$output scm "/guix-helper-bot.scm")
+                         script)
+                (wrap-program script #:sh (which "bash")
+                              `("GUILE_LOAD_PATH" prefix
+                                (,(string-append #$output scm)
+                                 ,(string-append gnutls scm)
+                                 ,(string-append irc scm)
+                                 ,(string-append irregex scm)
+                                 ,(string-append json scm)
+                                 ,(string-append lib scm)
+                                 ,(string-append naptcha scm)))
+                              `("GUILE_LOAD_COMPILED_PATH" prefix
+                                (,(string-append #$output go)
+                                 ,(string-append gnutls go)
+                                 ,(string-append irc go)
+                                 ,(string-append irregex go)
+                                 ,(string-append json go)
+                                 ,(string-append lib go)
+                                 ,(string-append naptcha go))))))))))
+    (native-inputs (list
+                    ;; see comment in guile-build-system
+                    guile-3.0))
+    (inputs (list
+             ;; for wrap-program
+             bash
+	     guile-3.0
+             guile-gnutls
+	     guile-irc
+             guile-irregex
+	     guile-json-4
+             guile-lib
+	     guile-naptcha))
+    (home-page "https://codeberg.org/lechner/guix-helper-bot")
+    (synopsis "IRC Bot Shedding Light on Bug Details")
+    (description
+     "This IRC bot offers helpful advice in Guix-related channels.")
+    (license license:agpl3+)))
 
 guix-helper-bot

base-commit: b62b328fa336aa680b842a566e7b1e9143fd768d
-- 
2.39.1

