diff mbox series

[bug#71764,v7] gnu: Add got.

Message ID 2b3365852f7368a67199c3b84e1502f6d499e379.1726149620.git.ashish.is@lostca.se
State New
Headers show
Series [bug#71764,v7] gnu: Add got. | expand

Commit Message

Ashish SHUKLA Sept. 12, 2024, 2 p.m. UTC
* gnu/packages/version-control.scm (got): New variable.

Change-Id: I34d19d90ab36e8831fa88668676aa2399356b002
---
This revision initializes got with 0.103.

 gnu/packages/version-control.scm | 50 ++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)


base-commit: f5449685143be0805a8a9b54ddecee94e368c6e9

Comments

Ludovic Courtès Sept. 17, 2024, 3:36 p.m. UTC | #1
Hi,

Ashish SHUKLA <ashish.is@lostca.se> skribis:

> * gnu/packages/version-control.scm (got): New variable.
>
> Change-Id: I34d19d90ab36e8831fa88668676aa2399356b002

[...]

> +(define-public got

[...]

> +    (inputs
> +     `(("libevent" ,libevent)
> +       ("libuuid" ,util-linux "lib")
> +       ("zlib" ,zlib)
> +       ("libressl" ,libressl)
> +       ("libmd" ,libmd)
> +       ("libbsd" ,libbsd)
> +       ("ncurses" ,ncurses)))

Please run ‘guix style -S inputs --input-simplification=always got’.

> +     `(;; disable runpath validation, courtesy: libbsd's special
> +       ;; treatment of libmd
> +       #:validate-runpath? #f

It isn’t clear from the comment why RUNPATH validation is disabled, and
there has to be a very good reason because usually any problem it
detects is going to be an issue at run time.

Could you double-check?

> +       #:configure-flags
> +       '("CFLAGS=-DGOT_DIAL_PATH_SSH=\\\"ssh\\\" -DGOT_TAG_PATH_SSH_KEYGEN=\\\"ssh-keygen\\\" -DGOT_TAG_PATH_SIGNIFY=\\\"signify\\\"")

Please wrap lines to 80 characters.

Also, setting CFLAGS like this runs the risk of overriding the default,
which are usually “-O2 -g”, and thus building without optimizations.

Could you check whether this is the case and perhaps add “-O2 -g”?

> +      #:phases ,#~(modify-phases %standard-phases
> +                    (add-after 'unpack 'patch-execv-to-execvp
> +                      (lambda _
> +                        ;; got sources has paths hardcoded to /usr/bin
> +                        (substitute* "lib/dial.c"
> +                          (("execv\\(GOT_DIAL_") "execvp(GOT_DIAL_")
> +                          (("execv %s\", GOT_DIAL") "execvp %s\", GOT_DIAL"))
> +                        (substitute* "lib/sigs.c"
> +                          (("execv\\(GOT_TAG") "execvp(GOT_TAG")
> +                          (("execv %s\", GOT_TAG") "execvp %s\", GOT_TAG"))
> +                        #t)))))

Please remove the trailing #t.

Could you send an updated patch?

Thanks,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 0c4cdedce8..fb5eca3bb2 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -56,6 +56,7 @@ 
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2024 Suhail Singh <suhail@bayesians.ca>
 ;;; Copyright © 2024 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -102,6 +103,7 @@  (define-module (gnu packages version-control)
   #:use-module (gnu packages cook)
   #:use-module (gnu packages crates-io)
   #:use-module (gnu packages crates-vcs)
+  #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -124,6 +126,8 @@  (define-module (gnu packages version-control)
   #:use-module (gnu packages guile-xyz)
   #:use-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages libbsd)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages mail)
   #:use-module (gnu packages man)
@@ -963,6 +967,52 @@  (define-public git-tools
 @end itemize")
     (license license:gpl3+)))
 
+(define-public got
+  (package
+    (name "got")
+    (version "0.103")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://gameoftrees.org/releases/portable/got-portable-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "0y18961xrj4rja850i31gadiaps2qnkfb4jlramlz9akyf9mwh1j"))))
+    (inputs
+     `(("libevent" ,libevent)
+       ("libuuid" ,util-linux "lib")
+       ("zlib" ,zlib)
+       ("libressl" ,libressl)
+       ("libmd" ,libmd)
+       ("libbsd" ,libbsd)
+       ("ncurses" ,ncurses)))
+    (native-inputs
+     (list pkg-config perl))
+    (arguments
+     `(;; disable runpath validation, courtesy: libbsd's special
+       ;; treatment of libmd
+       #:validate-runpath? #f
+       #:configure-flags
+       '("CFLAGS=-DGOT_DIAL_PATH_SSH=\\\"ssh\\\" -DGOT_TAG_PATH_SSH_KEYGEN=\\\"ssh-keygen\\\" -DGOT_TAG_PATH_SIGNIFY=\\\"signify\\\"")
+      #:phases ,#~(modify-phases %standard-phases
+                    (add-after 'unpack 'patch-execv-to-execvp
+                      (lambda _
+                        ;; got sources has paths hardcoded to /usr/bin
+                        (substitute* "lib/dial.c"
+                          (("execv\\(GOT_DIAL_") "execvp(GOT_DIAL_")
+                          (("execv %s\", GOT_DIAL") "execvp %s\", GOT_DIAL"))
+                        (substitute* "lib/sigs.c"
+                          (("execv\\(GOT_TAG") "execvp(GOT_TAG")
+                          (("execv %s\", GOT_TAG") "execvp %s\", GOT_TAG"))
+                        #t)))))
+    (build-system gnu-build-system)
+    (synopsis "Distributed version control system")
+    (description
+     "Game of Trees (Got) is a version control system which prioritizes ease of use
+and simplicity over flexibility.")
+    (license license:bsd-3)
+    (home-page "https://gameoftrees.org/")))
+
 (define-public xdiff
   (let ((revision "0")
         (commit "a137bc7ee6c76618ed1737c257548eaa10ac0089"))