GNU bug report logs - #63003
[PATCH 0/3] gnu: Add restic-rest-server.

Previous Next

Package: guix-patches;

Reported by: Timo Wilken <guix <at> twilken.net>

Date: Fri, 21 Apr 2023 19:55:02 UTC

Severity: normal

Tags: patch

Done: Leo Famulari <leo <at> famulari.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63003 in the body.
You can then email your comments to 63003 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#63003; Package guix-patches. (Fri, 21 Apr 2023 19:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timo Wilken <guix <at> twilken.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 21 Apr 2023 19:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Timo Wilken <guix <at> twilken.net>
To: guix-patches <at> gnu.org
Cc: Timo Wilken <guix <at> twilken.net>
Subject: [PATCH 0/3] gnu: Add restic-rest-server.
Date: Fri, 21 Apr 2023 21:53:11 +0200
The restic REST server is a Go program that serves a restic backup repository
over HTTP.

Almost all dependencies were already packaged in Guix, though some in (gnu
packages syncthing). I moved these to (gnu packages golang) with the rest of
the Go dependencies, as that seemed appropriate.

Timo Wilken (3):
  gnu: Move golang dependencies to (gnu packages golang).
  gnu: Add go-github-com-coreos-go-systemd-activation.
  gnu: Add restic-rest-server.

 gnu/packages/backup.scm    |  48 ++++++++++++++++
 gnu/packages/golang.scm    | 115 ++++++++++++++++++++++++++++++++++++-
 gnu/packages/syncthing.scm |  90 -----------------------------
 3 files changed, 162 insertions(+), 91 deletions(-)


base-commit: 13ebf5e36cc676627a19072d3712c399b7aae61f
-- 
2.39.2





Information forwarded to guix-patches <at> gnu.org:
bug#63003; Package guix-patches. (Fri, 21 Apr 2023 19:56:02 GMT) Full text and rfc822 format available.

Message #8 received at 63003 <at> debbugs.gnu.org (full text, mbox):

From: Timo Wilken <guix <at> twilken.net>
To: 63003 <at> debbugs.gnu.org
Cc: Timo Wilken <guix <at> twilken.net>
Subject: [PATCH 1/3] gnu: Move golang dependencies to (gnu packages golang).
Date: Fri, 21 Apr 2023 21:55:13 +0200
These packages are needed by syncthing and the new restic-rest-server package,
so put them in (gnu packages golang) instead.

* gnu/packages/syncthing.scm (go-github-com-prometheus-common,
  go-github-com-prometheus-procfs, go-github-com-prometheus-client-golang):
  Delete variables.
* gnu/packages/golang.scm (go-github-com-prometheus-common,
  go-github-com-prometheus-procfs, go-github-com-prometheus-client-golang):
  Move deleted variables here.
---
 gnu/packages/golang.scm    | 90 ++++++++++++++++++++++++++++++++++++++
 gnu/packages/syncthing.scm | 90 --------------------------------------
 2 files changed, 90 insertions(+), 90 deletions(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 24dae34e20..cca5aacdb6 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9497,6 +9497,96 @@ (define-public go-github-com-godbus-dbus
 bindings for the D-Bus message bus system.")
     (license license:bsd-2)))
 
+(define-public go-github-com-prometheus-common
+  (package
+    (name "go-github-com-prometheus-common")
+    (version "0.4.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/prometheus/common")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0sf4sjdckblz1hqdfvripk3zyp8xq89w7q75kbsyg4c078af896s"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/prometheus/common"
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         ;; Source-only package
+         (delete 'build))))
+    (propagated-inputs
+     (list go-github-com-golang-protobuf-proto
+           go-github-com-matttproud-golang-protobuf-extensions-pbutil
+           go-github-com-prometheus-client-model))
+    (synopsis "Prometheus metrics")
+    (description "This package provides tools for reading and writing
+Prometheus metrics.")
+    (home-page "https://github.com/prometheus/common")
+    (license license:asl2.0)))
+
+(define-public go-github-com-prometheus-procfs
+  (package
+    (name "go-github-com-prometheus-procfs")
+    (version "0.0.4")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/prometheus/procfs")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1z5jq5rjala0a0di4nwk1rai0z9f73qwqj6mgcbpjbg2qknlb544"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/prometheus/procfs"
+       ;; The tests require Go modules, which are not yet supported in Guix's
+       ;; Go build system.
+       #:tests? #f))
+    (synopsis "Go library for reading @file{/proc}")
+    (description "The @code{procfs} Go package provides functions to retrieve
+system, kernel, and process metrics from the @file{/proc} pseudo file system.")
+    (home-page "https://github.com/prometheus/procfs")
+    (license license:asl2.0)))
+
+(define-public go-github-com-prometheus-client-golang
+  (package
+    (name "go-github-com-prometheus-client-golang")
+    (version "1.2.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/prometheus/client_golang")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0zs49psk23n9z8wrl02d5vib5wclpym8kaxcy6n5pk696i419065"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:tests? #f
+       #:import-path "github.com/prometheus/client_golang"
+       #:phases
+       (modify-phases %standard-phases
+         ;; Source-only package
+         (delete 'build))))
+    (propagated-inputs
+     (list go-github-com-beorn7-perks-quantile
+           go-github-com-golang-protobuf-proto
+           go-github-com-prometheus-client-model
+           go-github-com-prometheus-common
+           go-github-com-prometheus-procfs
+           go-github-com-cespare-xxhash))
+    (synopsis "HTTP server and client tools for Prometheus")
+    (description "This package @code{promhttp} provides HTTP client and
+server tools for Prometheus metrics.")
+    (home-page "https://github.com/prometheus/client_golang")
+    (license license:asl2.0)))
+
 (define-public go-github-com-zalando-go-keyring
   (package
     (name "go-github-com-zalando-go-keyring")
diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
index c4204f32fe..dd54100ce6 100644
--- a/gnu/packages/syncthing.scm
+++ b/gnu/packages/syncthing.scm
@@ -877,96 +877,6 @@ (define-public go-github-com-matttproud-golang-protobuf-extensions-pbutil
       (home-page "https://github.com/matttproud/golang_protobuf_extensions")
       (license asl2.0))))
 
-(define-public go-github-com-prometheus-common
-    (package
-      (name "go-github-com-prometheus-common")
-      (version "0.4.1")
-      (source (origin
-                (method git-fetch)
-                (uri (git-reference
-                       (url "https://github.com/prometheus/common")
-                       (commit (string-append "v" version))))
-                (file-name (git-file-name name version))
-                (sha256
-                 (base32
-                  "0sf4sjdckblz1hqdfvripk3zyp8xq89w7q75kbsyg4c078af896s"))))
-      (build-system go-build-system)
-      (arguments
-       '(#:import-path "github.com/prometheus/common"
-         #:tests? #f
-         #:phases
-         (modify-phases %standard-phases
-           ;; Source-only package
-           (delete 'build))))
-      (propagated-inputs
-       (list go-github-com-golang-protobuf-proto
-             go-github-com-matttproud-golang-protobuf-extensions-pbutil
-             go-github-com-prometheus-client-model))
-      (synopsis "Prometheus metrics")
-      (description "This package provides tools for reading and writing
-Prometheus metrics.")
-      (home-page "https://github.com/prometheus/common")
-      (license asl2.0)))
-
-(define-public go-github-com-prometheus-procfs
-    (package
-      (name "go-github-com-prometheus-procfs")
-      (version "0.0.4")
-      (source (origin
-                (method git-fetch)
-                (uri (git-reference
-                       (url "https://github.com/prometheus/procfs")
-                       (commit (string-append "v" version))))
-                (file-name (git-file-name name version))
-                (sha256
-                 (base32
-                  "1z5jq5rjala0a0di4nwk1rai0z9f73qwqj6mgcbpjbg2qknlb544"))))
-      (build-system go-build-system)
-      (arguments
-       '(#:import-path "github.com/prometheus/procfs"
-         ;; The tests require Go modules, which are not yet supported in Guix's
-         ;; Go build system.
-         #:tests? #f))
-      (synopsis "Go library for reading @file{/proc}")
-      (description "The @code{procfs} Go package provides functions to retrieve
-system, kernel, and process metrics from the @file{/proc} pseudo file system.")
-      (home-page "https://github.com/prometheus/procfs")
-      (license asl2.0)))
-
-(define-public go-github-com-prometheus-client-golang
-    (package
-      (name "go-github-com-prometheus-client-golang")
-      (version "1.2.1")
-      (source (origin
-                (method git-fetch)
-                (uri (git-reference
-                       (url "https://github.com/prometheus/client_golang")
-                       (commit (string-append "v" version))))
-                (file-name (git-file-name name version))
-                (sha256
-                 (base32
-                  "0zs49psk23n9z8wrl02d5vib5wclpym8kaxcy6n5pk696i419065"))))
-      (build-system go-build-system)
-      (arguments
-       '(#:tests? #f
-         #:import-path "github.com/prometheus/client_golang"
-         #:phases
-         (modify-phases %standard-phases
-           ;; Source-only package
-           (delete 'build))))
-      (propagated-inputs
-       (list go-github-com-beorn7-perks-quantile
-             go-github-com-golang-protobuf-proto
-             go-github-com-prometheus-client-model
-             go-github-com-prometheus-common
-             go-github-com-prometheus-procfs
-             go-github-com-cespare-xxhash))
-      (synopsis "HTTP server and client tools for Prometheus")
-      (description "This package @code{promhttp} provides HTTP client and
-server tools for Prometheus metrics.")
-      (home-page "https://github.com/prometheus/client_golang")
-      (license asl2.0)))
-
 (define-public go-github-com-go-asn1-ber-asn1-ber
   (package
     (name "go-github-com-go-asn1-ber-asn1-ber")
-- 
2.39.2





Information forwarded to guix-patches <at> gnu.org:
bug#63003; Package guix-patches. (Fri, 21 Apr 2023 19:56:02 GMT) Full text and rfc822 format available.

Message #11 received at 63003 <at> debbugs.gnu.org (full text, mbox):

From: Timo Wilken <guix <at> twilken.net>
To: 63003 <at> debbugs.gnu.org
Cc: Timo Wilken <guix <at> twilken.net>
Subject: [PATCH 3/3] gnu: Add restic-rest-server.
Date: Fri, 21 Apr 2023 21:55:15 +0200
* gnu/packages/backup.scm (restic-rest-server): New variable.
---
 gnu/packages/backup.scm | 48 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 134647d33d..94e8e3acc4 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2022 Feng Shu <tumashu <at> 163.com>
+;;; Copyright © 2023 Timo Wilken <guix <at> twilken.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1029,6 +1030,53 @@ (define-public restic
 @end itemize")
     (license license:bsd-2)))
 
+(define-public restic-rest-server
+  (package
+    (name "restic-rest-server")
+    (version "0.11.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/restic/rest-server")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1nvmxc9x0mlks6yfn66fmwn50k5q83ip4g9vvb0kndzd7hwcyacy"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/restic/rest-server/cmd/rest-server"
+       #:unpack-path "github.com/restic/rest-server"
+       #:install-source? #f ;all we need is the binary
+       #:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys . args)
+                      (when tests?
+                        ;; Unit tests seems to break with Guix' non-standard TMPDIR.
+                        (setenv "TMPDIR" "/tmp")
+                        (apply (assoc-ref %standard-phases
+                                          'check) args))))
+                  (add-after 'install 'rename-binary
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (with-directory-excursion (assoc-ref outputs "out")
+                        ;; "rest-server" is a bit too generic.
+                        (rename-file "bin/rest-server"
+                                     "bin/restic-rest-server")))))))
+    (propagated-inputs (list go-golang-org-x-crypto
+                             go-github-com-spf13-cobra
+                             go-github-com-prometheus-client-golang
+                             go-github-com-miolini-datacounter
+                             go-github-com-minio-sha256-simd
+                             go-github-com-gorilla-handlers
+                             go-github-com-coreos-go-systemd-activation))
+    (home-page "https://github.com/restic/rest-server")
+    (synopsis "Restic REST server")
+    (description
+     "The Restic REST server is a high performance HTTP server that implements
+restic's REST backend API.  It provides a secure and efficient way to backup
+data remotely, using the restic backup client and a @code{rest:} URL.")
+    (license license:bsd-2)))
+
 (define-public zbackup
   (package
     (name "zbackup")
-- 
2.39.2





Information forwarded to guix-patches <at> gnu.org:
bug#63003; Package guix-patches. (Fri, 21 Apr 2023 19:56:03 GMT) Full text and rfc822 format available.

Message #14 received at 63003 <at> debbugs.gnu.org (full text, mbox):

From: Timo Wilken <guix <at> twilken.net>
To: 63003 <at> debbugs.gnu.org
Cc: Timo Wilken <guix <at> twilken.net>
Subject: [PATCH 2/3] gnu: Add go-github-com-coreos-go-systemd-activation.
Date: Fri, 21 Apr 2023 21:55:14 +0200
Required by restic-rest-server; see following commit.

* gnu/packages/golang.scm (go-github-com-coreos-go-systemd-activation): New variable.
---
 gnu/packages/golang.scm | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index cca5aacdb6..78864291ae 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8964,6 +8964,29 @@ (define-public go-github-com-coreos-go-semver
 It lets you parse and compare two semantic version strings.")
     (license license:asl2.0)))
 
+(define-public go-github-com-coreos-go-systemd-activation
+  (package
+    (name "go-github-com-coreos-go-systemd-activation")
+    (version "0.0.0-20191104093116-d3cd4ed1dbcf")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/coreos/go-systemd")
+                    (commit (go-version->git-ref version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "193mgqn7n4gbb8jb5kyn6ml4lbvh4xs55qpjnisaz7j945ik3kd8"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/coreos/go-systemd/activation"
+       #:unpack-path "github.com/coreos/go-systemd"))
+    (home-page "https://github.com/coreos/go-systemd")
+    (synopsis "Go bindings to systemd socket activation")
+    (description "Go bindings to systemd socket activation; for writing and
+using socket activation from Go.")
+    (license license:asl2.0)))
+
 (define-public go-github-com-emirpasic-gods
   (package
     (name "go-github-com-emirpasic-gods")
@@ -8980,7 +9003,7 @@ (define-public go-github-com-emirpasic-gods
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/emirpasic/gods"
-       ; Source-only package
+                                        ; Source-only package
        #:tests? #f
        #:phases
        (modify-phases %standard-phases
-- 
2.39.2





Information forwarded to guix-patches <at> gnu.org:
bug#63003; Package guix-patches. (Fri, 21 Apr 2023 20:00:02 GMT) Full text and rfc822 format available.

Message #17 received at 63003 <at> debbugs.gnu.org (full text, mbox):

From: "Timo Wilken" <guix <at> twilken.net>
To: <63003 <at> debbugs.gnu.org>
Cc: guix <at> twilken.net
Subject: Re: [PATCH 2/3] gnu: Add go-github-com-coreos-go-systemd-activation.
Date: Fri, 21 Apr 2023 21:59:24 +0200
On Fri Apr 21, 2023 at 9:55 PM CEST, Timo Wilken wrote:
> Required by restic-rest-server; see following commit.
>
> * gnu/packages/golang.scm (go-github-com-coreos-go-systemd-activation): New variable.
> 
> @@ -8980,7 +9003,7 @@ (define-public go-github-com-emirpasic-gods
>      (build-system go-build-system)
>      (arguments
>       `(#:import-path "github.com/emirpasic/gods"
> -       ; Source-only package
> +                                        ; Source-only package
>         #:tests? #f
>         #:phases
>         (modify-phases %standard-phases

Oops, sorry about this accidental reformatting! Should I resend this
patch series or can that be removed when applying the commit?




Reply sent to Leo Famulari <leo <at> famulari.name>:
You have taken responsibility. (Sun, 23 Apr 2023 14:48:02 GMT) Full text and rfc822 format available.

Notification sent to Timo Wilken <guix <at> twilken.net>:
bug acknowledged by developer. (Sun, 23 Apr 2023 14:48:02 GMT) Full text and rfc822 format available.

Message #22 received at 63003-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Timo Wilken <guix <at> twilken.net>
Cc: 63003-done <at> debbugs.gnu.org
Subject: Re: [bug#63003] [PATCH 3/3] gnu: Add restic-rest-server.
Date: Sun, 23 Apr 2023 10:47:39 -0400
On Fri, Apr 21, 2023 at 09:55:15PM +0200, Timo Wilken wrote:
> * gnu/packages/backup.scm (restic-rest-server): New variable.

Thanks Timo! I pushed the patches as
bcf63e6bf2ed3dec447d5c2fa3bc67b784eacbe1




Information forwarded to guix-patches <at> gnu.org:
bug#63003; Package guix-patches. (Sun, 23 Apr 2023 16:56:01 GMT) Full text and rfc822 format available.

Message #25 received at 63003-done <at> debbugs.gnu.org (full text, mbox):

From: Timo Wilken <timo <at> twilken.net>
To: Leo Famulari <leo <at> famulari.name>, Timo Wilken <guix <at> twilken.net>
Cc: 63003-done <at> debbugs.gnu.org
Subject: Re: [bug#63003] [PATCH 3/3] gnu: Add restic-rest-server.
Date: Sun, 23 Apr 2023 16:50:10 +0200

On 23 April 2023 16:47:39 CEST, Leo Famulari <leo <at> famulari.name> wrote:
>Thanks Timo! I pushed the patches as
>bcf63e6bf2ed3dec447d5c2fa3bc67b784eacbe1

Perfect, thank you Leo!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 22 May 2023 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 30 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.