diff mbox series

[bug#51998] gnu: Add guile-gitlab

Message ID 87zgppifrm.fsf@gmail.com
State Accepted
Headers show
Series [bug#51998] gnu: Add guile-gitlab | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Artyom V. Poptsov Nov. 27, 2021, 7:02 p.m. UTC
Hello Mathieu,

I just released Guile-GitLab 0.2.0[1] with fixed Autotools scripts.  Thanks
for the hints, I appreciate it.

Could you please check if my package is OK?

- Artyom

P.S.

> Спасибо за вторую версию.
Ты знаешь русский язык?

1. https://github.com/artyom-poptsov/guile-gitlab/releases/tag/v0.2.0

Comments

Mathieu Othacehe Nov. 28, 2021, 10:04 a.m. UTC | #1
Hello Artyom,

I edited a bit the package definition:

* Added bash-minimal to the inputs as suggested by "guix lint".
* Moved guile-lib to the inputs.
* Added json and tls to the wrap so that they can always be found.
* Wrapped a few lines.

and pushed as a0352562505cfced63ca415e2bb4cbce29f7fc35.

Note that I also have the following error on two different Gitlab
servers:

--8<---------------cut here---------------start------------->8---
mathieu@meije ~/guix [env]$ gitlab-cli project list --token "xxx" --server "https://gitlab.com"
Backtrace:
           4 (apply-smob/1 #<catch-closure 7fc671915920>)
In ice-9/boot-9.scm:
    705:2  3 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
In ice-9/eval.scm:
    619:8  2 (_ #(#(#<directory (guile-user) 7fc6715ad140>)))
In gitlab/cli/project.scm:
   116:19  1 (gitlab-cli-project/list _ _)
In gitlab/api/common.scm:
    74:21  0 (api-get #<<session> 7fc6715e2cf0> "/api/v4/projects" # ?)

gitlab/api/common.scm:74:21: In procedure api-get:
In procedure vector-length: Wrong type argument in position 1 (expecting
vector): (#<hash-table 7fc67039eda0 91/113> #<hash-table 7fc67067e060
91/113> #<hash-table 7fc67032a8e0 91/113> #<hash-table 7fc670376e20
91/113> #<hash-table 7fc67039062 ...
--8<---------------cut here---------------end--------------->8---

Are you expecting a specific Gitlab revision or the error is elsewhere?

Thanks,

Mathieu
diff mbox series

Patch

From 146fb0e85382ba58e324af99b4bef39a261c0da0 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 20 Nov 2021 15:32:10 +0300
Subject: [PATCH] gnu: Add guile-gitlab

* gnu/packages/guile-xyz.scm (guile-gitlab): Add new package.
---
 gnu/packages/guile-xyz.scm | 61 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 628d81710a..841fd49f18 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -38,6 +38,7 @@ 
 ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
 ;;; Copyright © 2021 Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
 ;;; Copyright © 2021 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2021 Artyom V. Poptsov <poptsov.artyom@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4795,3 +4796,63 @@  It provides a generic library for writing implementations of a netlink
 protocol, a low-level rtnetlink implementation that uses that library and a
 high-level API for network management that uses rtnetlink.")
     (license license:gpl3+)))
+
+(define-public guile-gitlab
+  (package
+    (name "guile-gitlab")
+    (version "0.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/artyom-poptsov/guile-gitlab")
+             (commit (string-append "v" version))))
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32
+         "1yq8w507vw9n7f626sbnsk8prsdk337d6acr7f9k3j500lhlvxj5"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:modules (((guix build guile-build-system)
+                   #:select (target-guile-effective-version))
+                  ,@%gnu-build-system-modules)
+       #:imported-modules ((guix build guile-build-system)
+                           ,@%gnu-build-system-modules)
+       #:phases (modify-phases %standard-phases
+                  (add-after 'install 'wrap-program
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let* ((out       (assoc-ref outputs "out"))
+                             (bin       (string-append out "/bin"))
+                             (guile-lib (assoc-ref inputs "guile-lib"))
+                             (version   (target-guile-effective-version))
+                             (scm       (string-append "/share/guile/site/"
+                                                       version))
+                             (go        (string-append  "/lib/guile/"
+                                                        version "/site-ccache")))
+                        (wrap-program (string-append bin "/gitlab-cli")
+                          `("GUILE_LOAD_PATH" prefix
+                            (,(string-append out scm)
+                             ,(string-append guile-lib scm)))
+                          `("GUILE_LOAD_COMPILED_PATH" prefix
+                            (,(string-append out go)
+                             ,(string-append guile-lib go)))))
+                      #t)))))
+    (native-inputs
+     `(("autoconf"     ,autoconf)
+       ("automake"     ,automake)
+       ("pkg-config"   ,pkg-config)
+       ("texinfo"      ,texinfo)))
+    (inputs
+     `(("guile"        ,guile-2.2)
+       ("guile-json"   ,guile-json-1)
+       ("guile-gnutls" ,guile2.2-gnutls)))
+    (propagated-inputs
+     `(("guile-lib"    ,guile2.2-lib)))
+    (home-page "https://github.com/artyom-poptsov/guile-gitlab")
+    (synopsis "GitLab module for Guile")
+    (description
+     "GNU Guile interface to GitLab Community Edition REST API.
+
+This package provides @samp{gitlab-cli} command line tool for interacting with
+a GitLab instance.")
+    (license license:gpl3)))
-- 
2.25.1