all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#73126] [PATCH] git-download: Add git-origin macro.
@ 2024-09-08 20:30 Herman Rimm via Guix-patches via
  2024-09-16 16:29 ` [bug#73126] [PATCH v2 0/2] Add git-source procedure Herman Rimm via Guix-patches via
  0 siblings, 1 reply; 4+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-08 20:30 UTC (permalink / raw)
  To: 73126

* guix/packages.scm (git-origin-helper, git-origin): Add macros.
---
 guix/git-download.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/guix/git-download.scm b/guix/git-download.scm
index ae2073ea06..d32f9a25eb 100644
--- a/guix/git-download.scm
+++ b/guix/git-download.scm
@@ -55,6 +55,8 @@ (define-module (guix git-download)
             git-reference-commit
             git-reference-recursive?
 
+            git-origin
+
             git-fetch
             git-fetch/lfs
             git-version
@@ -87,6 +89,31 @@ (define (git-lfs-package)
   (let ((distro (resolve-interface '(gnu packages version-control))))
     (module-ref distro 'git-lfs)))
 
+(define-syntax git-origin-helper
+  (syntax-rules (commit hash repository)
+    ((_ () (fields ...) c repo)
+     (origin fields ...
+             (method git-fetch)
+             (uri (git-reference (commit c)
+                                 (url repo)))))
+    ((_ ((commit exp) rest ...) others _ repo)
+     (git-origin-helper (rest ...) others exp repo))
+    ((_ ((hash exp) rest ...) (others ...) c repo)
+     (git-origin-helper
+       (rest ...)
+       (others ... (hash (content-hash (base32 exp) sha256)))
+       c
+       repo))
+    ((_ ((repository exp) rest ...) others c _)
+     (git-origin-helper (rest ...) others c exp))
+    ((_ (field rest ...) (others ...) c repo)
+     (git-origin-helper (rest ...) (others ... field) c repo))))
+
+(define-syntax-rule (git-origin fields ...)
+  "Build an <origin> record, converting the commit and repository field
+specifications to a <git-reference> and hash to a <content-hash>."
+  (git-origin-helper (fields ...) () #f #f))
+
 (define (git-fetch-builder git git-lfs git-ref-recursive? hash-algo)
   (define inputs
     `(,(or git (git-package))
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#73126] [PATCH v2 0/2] Add git-source procedure.
  2024-09-08 20:30 [bug#73126] [PATCH] git-download: Add git-origin macro Herman Rimm via Guix-patches via
@ 2024-09-16 16:29 ` Herman Rimm via Guix-patches via
  2024-09-16 16:29   ` [bug#73126] [PATCH v2 1/2] download: Add git-source Herman Rimm via Guix-patches via
  2024-09-16 16:29   ` [bug#73126] [PATCH v2 2/2] gnu: Add inadyn Herman Rimm via Guix-patches via
  0 siblings, 2 replies; 4+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-16 16:29 UTC (permalink / raw)
  To: 73126

Hi,

A procedure is shorter for sure and so is its invocation, see patch #2.
On the one hand the hash line is close to the version line, but there
are no field names anymore; it may be unclear that a 'version' variable
is used as a 'commit' argument.

I keep a 'host' argument separate from 'author' in case we want to use
symbols for popular hosts or ones that use protocols other than HTTPS.
I could add a version keyword argument, which would be useful for
packages which have their version field generated by git-version.

Cheers,
Herman

Herman Rimm (2):
  download: Add git-source.
  gnu: Add inadyn.

 doc/guix.texi         |  7 +++++++
 gnu/packages/dns.scm  | 27 +++++++++++++++++++++++++--
 guix/git-download.scm | 12 +++++++++++-
 3 files changed, 43 insertions(+), 3 deletions(-)


base-commit: ee64bcfb796ef36db4b63f79540627fb25f3320a
-- 
2.45.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#73126] [PATCH v2 1/2] download: Add git-source.
  2024-09-16 16:29 ` [bug#73126] [PATCH v2 0/2] Add git-source procedure Herman Rimm via Guix-patches via
@ 2024-09-16 16:29   ` Herman Rimm via Guix-patches via
  2024-09-16 16:29   ` [bug#73126] [PATCH v2 2/2] gnu: Add inadyn Herman Rimm via Guix-patches via
  1 sibling, 0 replies; 4+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-16 16:29 UTC (permalink / raw)
  To: 73126
  Cc: Christopher Baines, Florian Pelz, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Maxim Cournoyer,
	Simon Tournier, Tobias Geerinckx-Rice

* guix/git-download.scm (git-source): Add and export procedure.
* doc/guix.texi (origin Reference): Document git-source.

Change-Id: I40c24ff10135e4895c5319f969005ba1c09760db
---
 doc/guix.texi         |  7 +++++++
 guix/git-download.scm | 12 +++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index bc4d306c2d..fa64c6a3fc 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8248,6 +8248,13 @@ origin Reference
 @end lisp
 @end deftp
 
+@deffn {Procedure} git-source hash host author project commit [prefix]
+Return an @code{origin} corresponding to the @var{host}'s repository for
+the @var{author}'s @var{project}.  It is checked out at @var{commit},
+with a consistent @var{prefix} used in some repositories.  @var{hash} is
+the string for a base32-encoded SHA256 hash used by @code{git-fetch}.
+@end deffn
+
 For Mercurial repositories, the module @code{(guix hg-download)} defines
 the @code{hg-fetch} origin method and @code{hg-reference} data type for
 support of the Mercurial version control system.
diff --git a/guix/git-download.scm b/guix/git-download.scm
index ae2073ea06..6de53fec70 100644
--- a/guix/git-download.scm
+++ b/guix/git-download.scm
@@ -59,7 +59,8 @@ (define-module (guix git-download)
             git-fetch/lfs
             git-version
             git-file-name
-            git-predicate))
+            git-predicate
+            git-source))
 
 ;;; Commentary:
 ;;;
@@ -395,4 +396,13 @@ (define* (git-predicate directory #:key (recursive? #t))
             (#f        #f)))))
     (const #f)))
 
+(define* (git-source hash host author project commit #:optional prefix)
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+           (url (string-join (list "https:/" host author project) "/"))
+           (commit (if prefix (string-append prefix commit) commit))))
+    (file-name (git-file-name project commit))
+    (hash (content-hash (base32 hash) sha256))))
+
 ;;; git-download.scm ends here
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#73126] [PATCH v2 2/2] gnu: Add inadyn.
  2024-09-16 16:29 ` [bug#73126] [PATCH v2 0/2] Add git-source procedure Herman Rimm via Guix-patches via
  2024-09-16 16:29   ` [bug#73126] [PATCH v2 1/2] download: Add git-source Herman Rimm via Guix-patches via
@ 2024-09-16 16:29   ` Herman Rimm via Guix-patches via
  1 sibling, 0 replies; 4+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-16 16:29 UTC (permalink / raw)
  To: 73126

* gnu/packages/dns.scm (inadyn): Add variable.
(unbound): Remove trailing whitespace.

Change-Id: I47ba0f6c3537b963623011d1862aa4abf528b53b
---
 gnu/packages/dns.scm | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index ffc8eda6bb..52e5103603 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -22,6 +22,7 @@
 ;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
 ;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space>
 ;;; Copyright © 2024 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -78,6 +79,7 @@ (define-module (gnu packages dns)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
@@ -714,7 +716,7 @@ (define-public unbound
     p->p_name = \"udp\";
     p->p_proto = 17;
     p->p_aliases[0] = \"UDP\";
-  } else 
+  } else
     p = NULL;
   return p;
 }
@@ -750,7 +752,7 @@ (define-public unbound
     s->s_name = \"domain\";
     s->s_port = htons(53);
     s->s_proto = buf;
-  } else 
+  } else
     s = NULL;
   return s;
 }
@@ -790,6 +792,27 @@ (define-public unbound
 served by AS112.  Stub and forward zones are supported.")
     (license license:bsd-4)))
 
+(define-public inadyn
+  (package
+    (name "inadyn")
+    (version "2.12.0")
+    (source (git-source
+              "1a9i9ayxcvgcvj1b68wl9mkgrzp9a42w2rcgbmsp2s03ffvcj0b9"
+              "github.com" "troglobit" name version "v"))
+    (build-system gnu-build-system)
+    (arguments '(#:configure-flags (list "--localstatedir=/var")))
+    (inputs (list libconfuse gnutls))
+    (native-inputs (list autoconf automake libtool pkg-config))
+    (home-page "https://troglobit.com/projects/inadyn")
+    (synopsis "Dynamic DNS (DDNS) client with HTTPS support")
+    (description
+      "In-a-Dyn is a small and simple Dynamic DNS (DDNS) client with
+HTTPS support.  DDNS is used in off-the-shelf routers and Internet
+gateways to automate the task of keeping your DNS record up to date with
+any IP address changes from your ISP.  DDNS can also be used in
+installations with redundant (backup) connections to the Internet.")
+    (license license:gpl2)))
+
 (define-public yadifa
   (package
     (name "yadifa")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-16 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-08 20:30 [bug#73126] [PATCH] git-download: Add git-origin macro Herman Rimm via Guix-patches via
2024-09-16 16:29 ` [bug#73126] [PATCH v2 0/2] Add git-source procedure Herman Rimm via Guix-patches via
2024-09-16 16:29   ` [bug#73126] [PATCH v2 1/2] download: Add git-source Herman Rimm via Guix-patches via
2024-09-16 16:29   ` [bug#73126] [PATCH v2 2/2] gnu: Add inadyn Herman Rimm via Guix-patches via

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.