diff mbox series

[bug#51998] gnu: Add guile-gitlab

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

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Artyom V. Poptsov Nov. 20, 2021, 2:13 p.m. UTC
Hello Guixers,

here's my first patch for GNU Guix that adds Guile-GitLab[1] -- my Guile
module that allows to interact with GitLab Community Edition REST API
and provides a useful tool for that.

Thanks,

- avp

1. https://github.com/artyom-poptsov/guile-gitlab

Comments

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

Thanks for this first contribution! I think that there is a small issue
with the library path. The gitlab.scm files is in:

--8<---------------cut here---------------start------------->8---
/gnu/store/xn0bnrh23iscxy7xsvzqffyjy4wqy1q6-guile-gitlab-0.1.0/share/guile-gitlab/gitlab.scm
--8<---------------cut here---------------end--------------->8---

whereas it should be in:

--8<---------------cut here---------------start------------->8---
/gnu/store/xn0bnrh23iscxy7xsvzqffyjy4wqy1q6-guile-gitlab-0.1.0/share/guile/site/2.2/gitlab.scm
--8<---------------cut here---------------end--------------->8---

I also have the following error when running gitlab-cli:

--8<---------------cut here---------------start------------->8---

           0 (scm-error misc-error #f "~A ~S" ("no code for modu…" …) …)

ERROR: In procedure scm-error:
no code for module (gitlab)
--8<---------------cut here---------------end--------------->8---

that should be solved by adjusting the library path.

Thanks,

Mathieu
diff mbox series

Patch

From 6702a25439e480b45432915f68b64f7177c53fa0 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 | 47 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 628d81710a..65e30c2618 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,49 @@  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.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/artyom-poptsov/guile-gitlab.git")
+             (commit (string-append "v" version))))
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32
+         "1vpwwnxxglla8ci9mz6smm3nyqvdz2k082qyrp36ad14v9y70l86"))))
+    (build-system gnu-build-system)
+    (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)))
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-before 'configure 'set-guilesitedir
+                    (let ((files (find-files "." "Makefile.in")))
+                      (lambda _
+                        (substitute* files
+                          (("^guilesitedir =.*$")
+                           "guilesitedir = \
+$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
+                        #t)))
+                  (add-after 'unpack 'autoreconf
+                    (lambda _
+                      (zero? (system* "autoreconf" "-vfi")))))))
+    (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