[PATCH] gnu: yggdrasil: Update to 0.4.1.

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • raingloom
Owner
unassigned
Submitted by
raingloom
Severity
normal
R
R
raingloom wrote on 3 Nov 2021 21:42
(name . Guix Patches)(address . guix-patches@gnu.org)
20211103214245.367ec719@riseup.net
* gnu/packages/networking.scm (yggdrasil): Update to 0.4.1.
* gnu/packages/patches/yggdrasil-extra-config.patch: Update for new
version. ---
gnu/packages/networking.scm | 4 +-
.../patches/yggdrasil-extra-config.patch | 47 ++++++++++++-------
2 files changed, 33 insertions(+), 18 deletions(-)

Toggle diff (129 lines)
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index d1a437e177..7759e3cb84 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -4086,7 +4086,7 @@ (define-public nbd
(define-public yggdrasil
(package
(name "yggdrasil")
- (version "0.4.0")
+ (version "0.4.1")
(source
(origin
(method git-fetch)
@@ -4097,7 +4097,7 @@ (define-public yggdrasil
(recursive? #t)))
(file-name (git-file-name name version))
(sha256
- (base32
"0mmqw6w5a6ph49xd1yzb7i70xg466k9pi5sdvplhb66x68wipixh"))
+ (base32
"1ajhn0z58ap9jldip7mqj78drmgg4645zfsxsy004cfkm60fasnx")) (patches
(search-patches "yggdrasil-extra-config.patch")))) (build-system
go-build-system) (arguments
diff --git a/gnu/packages/patches/yggdrasil-extra-config.patch
b/gnu/packages/patches/yggdrasil-extra-config.patch index
46fd3f15fc..bd4bea7b9f 100644 ---
a/gnu/packages/patches/yggdrasil-extra-config.patch +++
b/gnu/packages/patches/yggdrasil-extra-config.patch @@ -1,8 +1,20 @@
+From 779f980451d20079b34812f7006f2d7230738ad0 Mon Sep 17 00:00:00 2001
+From: csepp <raingloom@riseup.net>
+Date: Wed, 3 Nov 2021 21:14:54 +0100
+Subject: [PATCH] add extra config file option to yggdrasil command
+
+This is useful in Guix and Nix, because one config file can come
+from the world-readable store and another can be placed directly
+into /etc with much stricter permissions.
+---
+ cmd/yggdrasil/main.go | 29 ++++++++++++++++++++++-------
+ 1 file changed, 22 insertions(+), 7 deletions(-)
+
diff --git a/cmd/yggdrasil/main.go b/cmd/yggdrasil/main.go
-index 813e950..08d35cc 100644
+index 58b8230..b9df98a 100644
--- a/cmd/yggdrasil/main.go
+++ b/cmd/yggdrasil/main.go
-@@ -40,11 +40,12 @@ type node struct {
+@@ -43,11 +43,12 @@ type node struct {
admin *admin.AdminSocket
}
@@ -16,7 +28,7 @@ index 813e950..08d35cc 100644
var err error
if useconffile != "" {
// Read the file from the filesystem
-@@ -56,6 +57,21 @@ func readConfig(useconf *bool, useconffile *string,
normaliseconf *bool) *config +@@ -59,6 +60,21 @@ func readConfig(log
*log.Logger, useconf bool, useconffile string, normaliseconf if err !=
nil { panic(err)
}
@@ -38,7 +50,7 @@ index 813e950..08d35cc 100644
// If there's a byte order mark - which Windows 10 is now
incredibly fond of // throwing everywhere when it's converting things
into UTF-16 for the hell // of it - remove it and decode back down into
UTF-8. This is necessary -@@ -69,11 +85,6 @@ func readConfig(log
*log.Logger, useconf bool, useconffile string, normaliseconf bool)
*config +@@ -72,11 +88,6 @@ func readConfig(log *log.Logger, useconf
bool, useconffile string, normaliseconf panic(err) }
}
@@ -50,7 +62,7 @@ index 813e950..08d35cc 100644
var dat map[string]interface{}
if err := hjson.Unmarshal(conf, &dat); err != nil {
panic(err)
-@@ -112,6 +123,7 @@ func readConfig(log *log.Logger, useconf *bool,
useconffile *string, normaliseconf *bool) *config +@@ -136,6 +147,7 @@
func readConfig(log *log.Logger, useconf bool, useconffile string,
normaliseconf if err = mapstructure.Decode(dat, &cfg); err != nil {
panic(err) }
@@ -58,15 +70,15 @@ index 813e950..08d35cc 100644
return cfg
}
-@@ -185,6 +197,7 @@ func main() {
- genconf bool
- useconf bool
+@@ -192,6 +204,7 @@ type yggArgs struct {
+ getaddr bool
+ getsnet bool
useconffile string
-+ extraconffile string
- normaliseconf bool
- confjson bool
- autoconf bool
-@@ -164,6 +176,7 @@ func main() {
++ extraconffile string
+ logto string
+ loglevel string
+ }
+@@ -200,6 +213,7 @@ func getArgs() yggArgs {
genconf := flag.Bool("genconf", false, "print a new config to
stdout") useconf := flag.Bool("useconf", false, "read HJSON/JSON config
from stdin") useconffile := flag.String("useconffile", "", "read
HJSON/JSON config from specified file path") @@ -74,15 +86,15 @@ index
813e950..08d35cc 100644 normaliseconf := flag.Bool("normaliseconf",
false, "use in combination with either -useconf or -useconffile,
outputs your configuration normalised") confjson := flag.Bool("json",
false, "print configuration from -genconf or -normaliseconf as JSON
instead of HJSON") autoconf := flag.Bool("autoconf", false, "automatic
mode (dynamic IP, peer with IPv6 neighbors)") -@@ -212,6 +225,7 @@ func
main() { +@@ -213,6 +227,7 @@ func getArgs() yggArgs { genconf:
*genconf, useconf: *useconf, useconffile: *useconffile,
-+ extraconffile: *extraconffile,
++ extraconffile: *extraconffile,
normaliseconf: *normaliseconf,
confjson: *confjson,
autoconf: *autoconf,
-@@ -187,7 +200,7 @@ func main() {
+@@ -265,7 +280,7 @@ func run(args yggArgs, ctx context.Context, done
chan struct{}) { cfg = defaults.GenerateConfig()
case args.useconffile != "" || args.useconf:
// Read the configuration from either stdin or from
the filesystem @@ -91,3 +103,6 @@ index 813e950..08d35cc 100644
// If the -normaliseconf option was specified then
remarshal the above // configuration and print it back to stdout. This
lets the user update // their configuration file with newly mapped
names (like above) or to +--
+2.33.1
+
--
2.33.1
L
L
Ludovic Courtès wrote on 17 Nov 2021 18:22
(name . raingloom)(address . raingloom@riseup.net)(address . 51594@debbugs.gnu.org)
878rxmu281.fsf@gnu.org
Hi,

raingloom <raingloom@riseup.net> skribis:

Toggle quote (7 lines)
> * gnu/packages/networking.scm (yggdrasil): Update to 0.4.1.
> * gnu/packages/patches/yggdrasil-extra-config.patch: Update for new
> version. ---
> gnu/packages/networking.scm | 4 +-
> .../patches/yggdrasil-extra-config.patch | 47 ++++++++++++-------
> 2 files changed, 33 insertions(+), 18 deletions(-)

This patch got mangled on its way. Could you resend it as an
attachment?

Thanks,
Ludo’.
R
R
raingloom wrote on 24 Nov 2021 00:54
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 51594@debbugs.gnu.org)
20211124005456.2d35d502@riseup.net
On Wed, 17 Nov 2021 18:22:06 +0100
Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (18 lines)
> Hi,
>
> raingloom <raingloom@riseup.net> skribis:
>
> > * gnu/packages/networking.scm (yggdrasil): Update to 0.4.1.
> > * gnu/packages/patches/yggdrasil-extra-config.patch: Update for new
> > version. ---
> > gnu/packages/networking.scm | 4 +-
> > .../patches/yggdrasil-extra-config.patch | 47
> > ++++++++++++------- 2 files changed, 33 insertions(+), 18
> > deletions(-)
>
> This patch got mangled on its way. Could you resend it as an
> attachment?
>
> Thanks,
> Ludo’.

Heck, I'm pretty sure I sent it as an attachment? Maybe I forgot to
re-add them to the email when I modified the patches?
Well, here is attempt 3.
From c11a2cf43ddd6108b57c24ef9669655b677ce276 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:36:37 +0000
Subject: [PATCH 1/8] gnu: Add go-github-com-vividcortex-ewma.

* gnu/packages/golang.scm (go-github-com-vividcortex-ewma): New variable.
---
gnu/packages/golang.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

Toggle diff (31 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index cc2a4ebc16..84e7387408 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8839,3 +8839,24 @@ (define-public go-gopkg-in-djherbis-times-v1
(description
"Provides a platform-independent way to get atime, mtime, ctime and btime for files.")
(license license:expat)))
+
+(define-public go-github-com-vividcortex-ewma
+ (package
+ (name "go-github-com-vividcortex-ewma")
+ (version "1.2.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/VividCortex/ewma")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0whx516l9nm4n41spagb605ry7kfnz1qha96mcshnfjlahhnnylq"))))
+ (build-system go-build-system)
+ (arguments '(#:import-path "github.com/VividCortex/ewma"))
+ (home-page "https://github.com/VividCortex/ewma")
+ (synopsis "EWMA")
+ (description
+ "Package ewma implements exponentially weighted moving averages.")
+ (license license:expat)))
--
2.33.1
From 4732bee7bdbea38292afe9f6b1149986dbfabcb7 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:37:11 +0000
Subject: [PATCH 2/8] gnu: Add go-github-com-rivo-uniseg.

* gnu/packages/golang.scm (go-github-com-rivo-uniseg): New variable.
---
gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (34 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 84e7387408..e2fee47b91 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8860,3 +8860,27 @@ (define-public go-github-com-vividcortex-ewma
(description
"Package ewma implements exponentially weighted moving averages.")
(license license:expat)))
+
+(define-public go-github-com-rivo-uniseg
+ (package
+ (name "go-github-com-rivo-uniseg")
+ (version "0.2.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rivo/uniseg")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0j7h22vfmjj562vr8gpsyrkrwp1pq9ayh5fylv24skxb467g9f0q"))))
+ (build-system go-build-system)
+ (arguments '(#:import-path "github.com/rivo/uniseg"))
+ (home-page "https://github.com/rivo/uniseg")
+ (synopsis "Unicode Text Segmentation for Go")
+ (description
+ "Package uniseg implements Unicode Text Segmentation according to Unicode
+Standard Annex #29
+(@url{http://unicode.org/reports/tr29/,http://unicode.org/reports/tr29/}).
+")
+ (license license:expat)))
--
2.33.1
From a234dd530900d0914a9972ad5a22a1fe303c1bc5 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:37:17 +0000
Subject: [PATCH 3/8] gnu: Add go-github-com-mattn-go-runewidth.

* gnu/packages/golang.scm (go-github-com-mattn-go-runewidth): New variable.
---
gnu/packages/golang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index e2fee47b91..63300c265f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8884,3 +8884,26 @@ (define-public go-github-com-rivo-uniseg
(@url{http://unicode.org/reports/tr29/,http://unicode.org/reports/tr29/}).
")
(license license:expat)))
+
+(define-public go-github-com-mattn-go-runewidth
+ (package
+ (name "go-github-com-mattn-go-runewidth")
+ (version "0.0.13")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mattn/go-runewidth")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1yir0f3wc5z5hnkwhvx5qb6nmpfb05zp2gvfjvna63s8kmla1rrn"))))
+ (build-system go-build-system)
+ (arguments '(#:import-path "github.com/mattn/go-runewidth"))
+ (propagated-inputs
+ `(("go-github-com-rivo-uniseg" ,go-github-com-rivo-uniseg)))
+ (home-page "https://github.com/mattn/go-runewidth")
+ (synopsis "Rune width implementation for Go")
+ (description
+ "Provides functions to get fixed width of the character or string.")
+ (license license:expat)))
--
2.33.1
From 6a4220dbb3cbb56cc818bd2f2714484e5f8682e4 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:45:47 +0000
Subject: [PATCH 4/8] gnu: go-github-com-cheggaaa-pb: Update to 3.0.8.

* gnu/packages/golang.scm (go-github-com-cheggaaa-pb): Update to 3.0.8.
---
gnu/packages/golang.scm | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 63300c265f..4033806c7f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -7948,7 +7948,7 @@ (define-public go-github-com-arceliar-phony
(define-public go-github-com-cheggaaa-pb
(package
(name "go-github-com-cheggaaa-pb")
- (version "3.0.4")
+ (version "3.0.8")
(source
(origin
(method git-fetch)
@@ -7957,18 +7957,20 @@ (define-public go-github-com-cheggaaa-pb
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32
- "0xhsv9yf3fz918ay6w0d87jnb3hk9vxvi16jk172kqq26x7jixd0"))))
+ (base32 "0d701s2niy39r650d1phjw19h4l27b1yfc2ih6s31f56b3zzqspx"))))
(build-system go-build-system)
- (arguments
- '(#:import-path "github.com/cheggaaa/pb/"))
+ (arguments '(#:import-path "github.com/cheggaaa/pb/v3"
+ ;; XXX: it does have tests but I'm not sure how to run them.
+ ;; go-build-system is looking in the wrong directory.
+ #:tests? #f))
(propagated-inputs
- `(("go-github-com-fatih-color" ,go-github-com-fatih-color)
+ `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
+ ("go-github-com-rivo-uniseg" ,go-github-com-rivo-uniseg)
+ ("go-github-com-mattn-go-runewidth" ,go-github-com-mattn-go-runewidth)
+ ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
("go-github-com-mattn-go-colorable" ,go-github-com-mattn-go-colorable)
- ("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
- ("go-golang-org-x-sys" ,go-golang-org-x-sys)))
- (native-inputs
- `(("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)))
+ ("go-github-com-fatih-color" ,go-github-com-fatih-color)
+ ("go-github-com-vividcortex-ewma" ,go-github-com-vividcortex-ewma)))
(home-page "https://github.com/cheggaaa/pb/")
(synopsis "Console progress bar for Go")
(description "This package is a Go library that draws progress bars on
--
2.33.1
From 1b4bfd5a947902f453e47a510ab058ff459412f5 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:46:57 +0000
Subject: [PATCH 5/8] gnu: Rename go-github-com-cheggaaa-pb to
go-github-com-cheggaaa-pb-v3.

* gnu/packages/golang.scm:
(go-github-com-cheggaaa-pb): Rename variable.
(go-github-com-cheggaaa-pb-v3): New variable.
---
gnu/packages/golang.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (18 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 4033806c7f..d0435b5469 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -7945,9 +7945,9 @@ (define-public go-github-com-arceliar-phony
inspired by the causal messaging system in the Pony programming language.")
(license license:expat))))
-(define-public go-github-com-cheggaaa-pb
+(define-public go-github-com-cheggaaa-pb-v3
(package
- (name "go-github-com-cheggaaa-pb")
+ (name "go-github-com-cheggaaa-pb-v3")
(version "3.0.8")
(source
(origin
--
2.33.1
From ce6e34a490816fd9c093fec3b9124bff26620e1f Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Tue, 2 Nov 2021 06:50:36 +0000
Subject: [PATCH 6/8] gnu: Add go-github-com-arceliar-ironwood.

* gnu/packages/golang.scm (go-github-com-arceliar-ironwood): New variable.
---
gnu/packages/golang.scm | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)

Toggle diff (50 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index d0435b5469..d8456c8f05 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8909,3 +8909,43 @@ (define-public go-github-com-mattn-go-runewidth
(description
"Provides functions to get fixed width of the character or string.")
(license license:expat)))
+
+(define-public go-github-com-arceliar-ironwood
+ (package
+ (name "go-github-com-arceliar-ironwood")
+ (version "0.0.0-20210912013146-c2bc55bb349c")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Arceliar/ironwood")
+ (commit (go-version->git-ref version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1dfkqnkfxwlwcsk8g9r1pv84lfzgn8r1vam13zlmk81cgan2r6fx"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/Arceliar/ironwood"
+ #:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ ;; Source-only package
+ (delete 'build))))
+ (propagated-inputs
+ `(("go-golang-org-x-crypto"
+ ,go-golang-org-x-crypto)
+ ("go-github-com-arceliar-phony"
+ ,go-github-com-arceliar-phony)))
+ (home-page
+ "https://github.com/Arceliar/ironwood")
+ (synopsis "Experimental network routing library")
+ (description
+ "Ironwood is a routing library with a @code{net.PacketConn}-compatible
+interface using @code{ed25519.PublicKey}s as addresses. Basically, you use it
+when you want to communicate with some other nodes in a network, but you can't
+guarantee that you can directly connect to every node in that network. It was
+written to test improvements to / replace the routing logic in
+@url{https://github.com/yggdrasil-network/yggdrasil-go,Yggdrasil}, but it may
+be useful for other network applications.")
+ (license license:mpl2.0)))
--
2.33.1
?