From 5e8e9bcd25e7bfe945e6e31778e156b796bbc131 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 21 Nov 2023 09:05:03 +0200 Subject: gnu: aria2: Unbundle wslay. * gnu/packages/bittorrent.scm (aria2)[source]: Add snippet to delete configure script and remove bundled dependency. Add a patch. [native-inputs]: Add autoconf, automake, gettext-minimal, libtool. [inputs]: Add wslay. * gnu/packages/patches/aria2-unbundle-wslay.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Change-Id: I92390a872454726ff9587518bb535d2105c44ef3 --- gnu/packages/patches/aria2-unbundle-wslay.patch | 54 +++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 gnu/packages/patches/aria2-unbundle-wslay.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/aria2-unbundle-wslay.patch b/gnu/packages/patches/aria2-unbundle-wslay.patch new file mode 100644 index 0000000000..e3e534bbe1 --- /dev/null +++ b/gnu/packages/patches/aria2-unbundle-wslay.patch @@ -0,0 +1,54 @@ +This patch causes aria2 to depend on an external wslay. +The wslay version was copied from the configure.ac in deps/wslay +configure still needs to be deleted to update the script +deps/wslay is no longer necessary and can also be removed + +diff --git a/Makefile.am b/Makefile.am +index afe70a2..8c4d058 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,4 +1,4 @@ +-SUBDIRS = po lib deps src doc test ++SUBDIRS = po lib src doc test + + ACLOCAL_AMFLAGS = -I m4 --install + RST2HTML = @RST2HTML@ +diff --git a/configure.ac b/configure.ac +index 14b340f..74d5937 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1001,15 +1001,18 @@ if test "x$have_option_const_name" = "xyes"; then + fi + + if test "x$enable_websocket" = "xyes"; then +- AC_CONFIG_SUBDIRS([deps/wslay]) ++ PKG_CHECK_MODULES([WSLAY], [libwslay >= 1.1.1], [have_wslay=yes], [have_wslay=no]) + enable_websocket=yes + AC_DEFINE([ENABLE_WEBSOCKET], [1], + [Define 1 if WebSocket support is enabled.]) +- # $(top_srcdir) for `make distcheck` +- WSLAY_CFLAGS="-I\$(top_builddir)/deps/wslay/lib/includes -I\$(top_srcdir)/deps/wslay/lib/includes" +- WSLAY_LIBS="\$(top_builddir)/deps/wslay/lib/libwslay.la" +- AC_SUBST([WSLAY_CFLAGS]) +- AC_SUBST([WSLAY_LIBS]) ++ if test "x$have_wslay" = "xyes"; then ++ WSLAY_CFLAGS="$WSLAY_CFLAGS" ++ WSLAY_LIBS="$WSLAY_LIBS" ++ AC_SUBST([WSLAY_CFLAGS]) ++ AC_SUBST([WSLAY_LIBS]) ++ else ++ ARIA2_DEP_NOT_MET([wslay]) ++ fi + fi + AM_CONDITIONAL([ENABLE_WEBSOCKET], [test "x$enable_websocket" = "xyes"]) + +@@ -1071,8 +1074,7 @@ AC_CONFIG_FILES([Makefile + doc/manual-src/ru/Makefile + doc/manual-src/ru/conf.py + doc/manual-src/pt/Makefile +- doc/manual-src/pt/conf.py +- deps/Makefile]) ++ doc/manual-src/pt/conf.py]) + AC_OUTPUT + + AC_MSG_NOTICE([summary of build options: -- cgit v1.2.3 From 9d33830fd135bfd8c1bcd706a092e83ee7061e6b Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Mon, 6 Nov 2023 00:51:49 +0100 Subject: gnu: scilab: Update to 2024.0.0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/maths.scm (scilab): Update to 2024.0.0. Remove patch. [native-inputs]: Switch to AUTOCONF-2.71. [inputs]: Switch to HDF5-1.10; add LIBARCHIVE. [arguments]: Add ‘fix-linking’ phase. Change-Id: Ie1af4dc620cee644388f6b8acf88ea50c4148b65 Signed-off-by: Ludovic Courtès --- gnu/packages/maths.scm | 16 ++++-- gnu/packages/patches/scilab-hdf5-1.8-api.patch | 71 -------------------------- 2 files changed, 11 insertions(+), 76 deletions(-) delete mode 100644 gnu/packages/patches/scilab-hdf5-1.8-api.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index a5a004d16e..44e62f774d 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -104,6 +104,7 @@ #:use-module (gnu packages algebra) #:use-module (gnu packages audio) #:use-module (gnu packages autotools) + #:use-module (gnu packages backup) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages bison) @@ -9530,7 +9531,7 @@ computation is supported via MPI.") (define-public scilab (package (name "scilab") - (version "2023.1.0") + (version "2024.0.0") (source (origin (method git-fetch) @@ -9540,10 +9541,9 @@ computation is supported via MPI.") (file-name (git-file-name name version)) (sha256 (base32 - "0hbqsnc67b4f8zc690kl79bwhjaasykjlmqbln8iymnjcn3l5ypd")) + "08nyfli3x7gd396ffd1a8zn9fj3gm6a8yw0ggm547c09sp2rgvl7")) (modules '((guix build utils) (ice-9 ftw))) - (patches (search-patches "scilab-hdf5-1.8-api.patch")) (snippet #~(begin ;; Delete everything except for scilab itself: @@ -9598,7 +9598,7 @@ computation is supported via MPI.") "modules/ast/src/cpp/parse/parsescilab.cpp")))))) (build-system gnu-build-system) (native-inputs - (list autoconf + (list autoconf-2.71 autoconf-archive automake bison @@ -9615,8 +9615,9 @@ computation is supported via MPI.") curl fftw gettext-minimal - hdf5-1.14 + hdf5-1.10 lapack + libarchive libx11 libxml2 matio @@ -9661,6 +9662,11 @@ computation is supported via MPI.") "modules/scicos/src/translator/makefile.mak" "modules/scicos/src/modelica_compiler/makefile.mak") (("nums\\.cmx?a") "")))) + (add-after 'unpack 'fix-linking + (lambda _ + (substitute* "modules/Makefile.am" + (("libscilab_cli_la_LDFLAGS = .*\\)" all) + (string-append all " -lcurl"))))) (add-after 'unpack 'restrain-to-scilab-cli (lambda _ ;; Install only scilab-cli.desktop diff --git a/gnu/packages/patches/scilab-hdf5-1.8-api.patch b/gnu/packages/patches/scilab-hdf5-1.8-api.patch deleted file mode 100644 index 8b453e4720..0000000000 --- a/gnu/packages/patches/scilab-hdf5-1.8-api.patch +++ /dev/null @@ -1,71 +0,0 @@ -This patch fixes the compilation with hdf5 version >= 1.10. Adapted from -https://aur.archlinux.org/cgit/aur.git/plain/hdf5_18_api.patch?h=scilab-git. - -diff -ur a/scilab/modules/hdf5/includes/HDF5Objects.h b/scilab/modules/hdf5/includes/HDF5Objects.h ---- a/scilab/modules/hdf5/includes/HDF5Objects.h -+++ b/scilab/modules/hdf5/includes/HDF5Objects.h -@@ -16,14 +16,12 @@ - #ifndef __HDF5OBJECTS_H__ - #define __HDF5OBJECTS_H__ - --#define H5_NO_DEPRECATED_SYMBOLS - #undef H5_USE_16_API -+#define H5_USE_18_API - --#define H5Eset_auto_vers 2 - #include - #include - --#undef H5_NO_DEPRECATED_SYMBOLS - - //#define __HDF5OBJECTS_DEBUG__ - //#define __HDF5ERROR_PRINT__ -diff -ur a/scilab/modules/hdf5/Makefile.am b/scilab/modules/hdf5/Makefile.am ---- a/scilab/modules/hdf5/Makefile.am -+++ b/scilab/modules/hdf5/Makefile.am -@@ -104,8 +104,7 @@ - -DH5Gopen_vers=2 \ - -DH5Tget_array_dims_vers=2 \ - -DH5Acreate_vers=2 \ -- -DH5Rdereference_vers=2 \ -- -DNO_DEPRECATED_SYMBOLS -+ -DH5Rdereference_vers=2 - - - libscihdf5_la_CPPFLAGS = \ -diff -ur a/scilab/modules/hdf5/sci_gateway/cpp/sci_hdf5_listvar_v3.cpp b/scilab/modules/hdf5/sci_gateway/cpp/sci_hdf5_listvar_v3.cpp ---- a/scilab/modules/hdf5/sci_gateway/cpp/sci_hdf5_listvar_v3.cpp -+++ b/scilab/modules/hdf5/sci_gateway/cpp/sci_hdf5_listvar_v3.cpp -@@ -13,6 +13,8 @@ - * - */ - -+#define H5_USE_18_API -+ - #include - #include "function.hxx" - #include "string.hxx" -diff -ur a/scilab/modules/hdf5/src/c/h5_readDataFromFile.c b/scilab/modules/hdf5/src/c/h5_readDataFromFile.c ---- a/scilab/modules/hdf5/src/c/h5_readDataFromFile.c -+++ b/scilab/modules/hdf5/src/c/h5_readDataFromFile.c -@@ -13,7 +13,7 @@ - * - */ - --#define H5_NO_DEPRECATED_SYMBOLS -+#define H5_USE_18_API - - #ifndef _MSC_VER - #include -diff -ur a/scilab/modules/hdf5/src/c/h5_readDataFromFile_v1.c b/scilab/modules/hdf5/src/c/h5_readDataFromFile_v1.c ---- a/scilab/modules/hdf5/src/c/h5_readDataFromFile_v1.c -+++ b/scilab/modules/hdf5/src/c/h5_readDataFromFile_v1.c -@@ -13,7 +13,7 @@ - * - */ - --#define H5_NO_DEPRECATED_SYMBOLS -+#define H5_USE_18_API - - #ifndef _MSC_VER - #include -- cgit v1.2.3 From d25e9f440b15882af1a45057ff65616162de8201 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Fri, 24 Nov 2023 10:32:54 +0200 Subject: gnu: go-gopkg-in-yaml-v3: Fix build on 32-bit systems. * gnu/packages/golang.scm (go-gopkg-in-yaml-v3)[source]: Add patch. * gnu/packages/patches/go-gopkg-in-yaml-v3-32bit.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Change-Id: Ia8a96b15d37a3d2f133da9374cac1e58e38f2d2c --- gnu/local.mk | 1 + gnu/packages/golang.scm | 3 +- .../patches/go-gopkg-in-yaml-v3-32bit.patch | 50 ++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/go-gopkg-in-yaml-v3-32bit.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index db9d6b93a4..023cd4b17f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1342,6 +1342,7 @@ dist_patch_DATA = \ %D%/packages/patches/gobject-introspection-cc-1.72.patch \ %D%/packages/patches/gobject-introspection-girepository.patch \ %D%/packages/patches/go-fix-script-tests.patch \ + %D%/packages/patches/go-gopkg-in-yaml-v3-32bit.patch \ %D%/packages/patches/go-github-com-golang-snappy-32bit-test.patch \ %D%/packages/patches/go-github-com-urfave-cli-fix-tests.patch \ %D%/packages/patches/go-github-com-urfave-cli-v2-fix-tests.patch \ diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 9c707e5414..2c9aff4a28 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -5577,7 +5577,8 @@ values.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "01b0wjb7yzv8wzzz2iim8mjpkwjnykcanrwiq06pkl89lr6gv8hn")))) + (base32 "01b0wjb7yzv8wzzz2iim8mjpkwjnykcanrwiq06pkl89lr6gv8hn")) + (patches (search-patches "go-gopkg-in-yaml-v3-32bit.patch")))) (build-system go-build-system) (arguments '(#:import-path "gopkg.in/yaml.v3")) diff --git a/gnu/packages/patches/go-gopkg-in-yaml-v3-32bit.patch b/gnu/packages/patches/go-gopkg-in-yaml-v3-32bit.patch new file mode 100644 index 0000000000..7a243f5d80 --- /dev/null +++ b/gnu/packages/patches/go-gopkg-in-yaml-v3-32bit.patch @@ -0,0 +1,50 @@ +https://sources.debian.org/src/golang-gopkg-yaml.v3/3.0.1-3/debian/patches/0001-Fix-0b-on-32-bit-systems.patch/ + +From: Shengjing Zhu +Date: Fri, 16 Apr 2021 00:40:09 +0800 +Subject: Fix -0b on 32-bit systems + +Origin: backport, https://github.com/go-yaml/yaml/pull/442 +--- + decode_test.go | 7 ++++--- + resolve.go | 2 +- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/decode_test.go b/decode_test.go +index 51f5070..9cac74c 100644 +--- a/decode_test.go ++++ b/decode_test.go +@@ -175,9 +175,6 @@ var unmarshalTests = []struct { + }, { + "bin: -0b101010", + map[string]interface{}{"bin": -42}, +- }, { +- "bin: -0b1000000000000000000000000000000000000000000000000000000000000000", +- map[string]interface{}{"bin": -9223372036854775808}, + }, { + "decimal: +685_230", + map[string]int{"decimal": 685230}, +@@ -357,6 +354,10 @@ var unmarshalTests = []struct { + "int64_min: -9223372036854775808", + map[string]int64{"int64_min": math.MinInt64}, + }, ++ { ++ "int64_min_base2: -0b1000000000000000000000000000000000000000000000000000000000000000", ++ map[string]int64{"int64_min_base2": math.MinInt64}, ++ }, + { + "int64_neg_base2: -0b111111111111111111111111111111111111111111111111111111111111111", + map[string]int64{"int64_neg_base2": -math.MaxInt64}, +diff --git a/resolve.go b/resolve.go +index 64ae888..1b7d8c3 100644 +--- a/resolve.go ++++ b/resolve.go +@@ -223,7 +223,7 @@ func resolve(tag string, in string) (rtag string, out interface{}) { + } else if strings.HasPrefix(plain, "-0b") { + intv, err := strconv.ParseInt("-"+plain[3:], 2, 64) + if err == nil { +- if true || intv == int64(int(intv)) { ++ if intv == int64(int(intv)) { + return intTag, int(intv) + } else { + return intTag, intv -- cgit v1.2.3 From 98da3707b68f5b0c50997bf56662778e4aef039a Mon Sep 17 00:00:00 2001 From: "Artyom V. Poptsov" Date: Tue, 7 Nov 2023 23:40:53 +0300 Subject: gnu: yggdrasil: Update to 0.5.2. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/networking.scm (yggdrasil): Update to 0.5.2. [propagated-inputs]: Rewrite inputs to replace "go-golang-org-x-sys" with "go-golang-org-x-sys-0.8". Use "go-golang-org-x-sys-0.8". Add "go-github-com-bits-and-blooms-bitset", "go-github-com-bits-and-blooms-bloom", "go-github-com-quic-go-quic-go", and "go-github-com-hjson-hjson-go". * gnu/packages/patches/yggdrasil-extra-config.patch: Update. Change-Id: I3c411524e589f0af52eaa90230810148f6ad4e31 Signed-off-by: Ludovic Courtès --- gnu/packages/networking.scm | 62 +++++----- gnu/packages/patches/yggdrasil-extra-config.patch | 134 +++++++--------------- 2 files changed, 78 insertions(+), 118 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index 994ce6a96a..6b415076e8 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -60,6 +60,7 @@ ;;; Copyright © 2023 Bruno Victal ;;; Copyright © 2023 Yovan Naumovski ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2023 Artyom V. Poptsov ;;; ;;; This file is part of GNU Guix. ;;; @@ -4407,7 +4408,7 @@ QUIC protocol.") (define-public yggdrasil (package (name "yggdrasil") - (version "0.4.7") + (version "0.5.2") (source (origin (method git-fetch) @@ -4418,8 +4419,8 @@ QUIC protocol.") (recursive? #t))) (file-name (git-file-name name version)) (sha256 - (base32 "01mllfrsr55lnfivxwa57cfrjas6w4shsvx9k81pw8jixc124myk")) - (patches (search-patches "yggdrasil-extra-config.patch")))) + (base32 "0ahgb94s30sq1wwyc8h53mjj3j43ifr0aanj8262rsm6rqk04kzq")) + (patches (search-patches "yggdrasil-extra-config.patch")))) (build-system go-build-system) (arguments (list #:import-path "github.com/yggdrasil-network/yggdrasil-go" @@ -4445,32 +4446,37 @@ QUIC protocol.") (list "github.com/yggdrasil-network/yggdrasil-go/cmd/yggdrasil" "github.com/yggdrasil-network/yggdrasil-go/cmd/yggdrasilctl" "github.com/yggdrasil-network/yggdrasil-go/cmd/genkeys")))))))) - ;; https://github.com/kardianos/minwinsvc is windows only (propagated-inputs - (list ;;("go-golang-zx2c4-com-wireguard-windows" - ;; ,go-golang-zx2c4-com-wireguard-windows) - go-golang-zx2c4-com-wireguard - go-golang-org-x-text - go-golang-org-x-sys - go-golang-org-x-net - go-golang-org-x-crypto - go-golang-org-x-tools - go-netns - go-netlink - go-github-com-olekukonko-tablewriter - go-github-com-mitchellh-mapstructure - go-github-com-mattn-go-runewidth - go-github-com-mattn-go-isatty - go-github-com-mattn-go-colorable - go-github-com-kardianos-minwinsvc - go-github-com-hjson-hjson-go - go-github-com-hashicorp-go-syslog - go-github-com-gologme-log - go-github-com-fatih-color - go-github-com-cheggaaa-pb-v3 - go-github-com-vividcortex-ewma - go-github-com-arceliar-phony - go-github-com-arceliar-ironwood)) + (let ((p (package-input-rewriting + `((,go-golang-org-x-sys . ,go-golang-org-x-sys-0.8)) + #:deep? #true))) + (cons go-golang-org-x-sys-0.8 + (map p + (list go-golang-zx2c4-com-wireguard + go-golang-org-x-text + go-golang-org-x-net + go-golang-org-x-crypto + go-golang-org-x-tools + go-netns + go-netlink + go-github-com-bits-and-blooms-bitset + go-github-com-bits-and-blooms-bloom + go-github-com-quic-go-quic-go + go-github-com-hjson-hjson-go + go-github-com-olekukonko-tablewriter + go-github-com-mitchellh-mapstructure + go-github-com-mattn-go-runewidth + go-github-com-mattn-go-isatty + go-github-com-mattn-go-colorable + go-github-com-kardianos-minwinsvc + go-github-com-hjson-hjson-go + go-github-com-hashicorp-go-syslog + go-github-com-gologme-log + go-github-com-fatih-color + go-github-com-cheggaaa-pb-v3 + go-github-com-vividcortex-ewma + go-github-com-arceliar-phony + go-github-com-arceliar-ironwood))))) (home-page "https://yggdrasil-network.github.io/blog.html") (synopsis "Experiment in scalable routing as an encrypted IPv6 overlay network") diff --git a/gnu/packages/patches/yggdrasil-extra-config.patch b/gnu/packages/patches/yggdrasil-extra-config.patch index 7934e2b50f..44c58a8fbd 100644 --- a/gnu/packages/patches/yggdrasil-extra-config.patch +++ b/gnu/packages/patches/yggdrasil-extra-config.patch @@ -1,108 +1,62 @@ -From 779f980451d20079b34812f7006f2d7230738ad0 Mon Sep 17 00:00:00 2001 -From: csepp -Date: Wed, 3 Nov 2021 21:14:54 +0100 +From 5aeabc1a8a8c5ecea3f5d0b7bcfa0aa0767ac92d Mon Sep 17 00:00:00 2001 +Message-ID: <5aeabc1a8a8c5ecea3f5d0b7bcfa0aa0767ac92d.1699726745.git.avityazev@posteo.org> +From: Aleksandr Vityazev +Date: Sat, 11 Nov 2023 19:50:46 +0300 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(-) + cmd/yggdrasil/main.go | 12 ++++++++++++ + src/config/config.go | 2 +- + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/yggdrasil/main.go b/cmd/yggdrasil/main.go -index 58b8230..b9df98a 100644 +index a225755..3f53dda 100644 --- a/cmd/yggdrasil/main.go +++ b/cmd/yggdrasil/main.go -@@ -43,11 +43,12 @@ type node struct { - admin *admin.AdminSocket - } - --func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf bool) *config.NodeConfig { -+func readConfig(log *log.Logger, useconf bool, useconffile string, extraconffile string, normaliseconf bool) *config.NodeConfig { - // Use a configuration file. If -useconf, the configuration will be read - // from stdin. If -useconffile, the configuration will be read from the - // filesystem. - var conf []byte -+ var extraconf []byte - var err error - if useconffile != "" { - // Read the file from the filesystem -@@ -59,6 +60,21 @@ func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf - if err != nil { - panic(err) - } -+ if extraconffile != "" { -+ extraconf, err = os.ReadFile(extraconffile); -+ } -+ if err != nil { -+ panic(err) -+ } -+ // Generate a new configuration - this gives us a set of sane defaults - -+ // then parse the configuration we loaded above on top of it. The effect -+ // of this is that any configuration item that is missing from the provided -+ // configuration will use a sane default. -+ cfg := defaults.GenerateConfig() -+ var confs [2][]byte -+ confs[0]=conf -+ confs[1]=extraconf -+ for _, conf := range confs { if len(conf)>0 { - // 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 -@@ -72,11 +88,6 @@ func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf - panic(err) - } - } -- // Generate a new configuration - this gives us a set of sane defaults - -- // then parse the configuration we loaded above on top of it. The effect -- // of this is that any configuration item that is missing from the provided -- // configuration will use a sane default. -- cfg := defaults.GenerateConfig() - var dat map[string]interface{} - if err := hjson.Unmarshal(conf, &dat); err != nil { - panic(err) -@@ -136,6 +147,7 @@ func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf - if err = mapstructure.Decode(dat, &cfg); err != nil { - panic(err) - } -+ }} - return cfg - } - -@@ -192,6 +204,7 @@ type yggArgs struct { - getaddr bool - getsnet bool - useconffile string -+ extraconffile string - logto string - loglevel string - } -@@ -200,6 +213,7 @@ func getArgs() yggArgs { +@@ -42,6 +42,7 @@ func main() { 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") + extraconffile := flag.String("extraconffile", "", "extra (usually private) HJSON/JSON config from specified file path") normaliseconf := flag.Bool("normaliseconf", false, "use in combination with either -useconf or -useconffile, outputs your configuration normalised") + exportkey := flag.Bool("exportkey", false, "use in combination with either -useconf or -useconffile, outputs your private key in PEM format") 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)") -@@ -213,6 +227,7 @@ func getArgs() yggArgs { - genconf: *genconf, - useconf: *useconf, - useconffile: *useconffile, -+ extraconffile: *extraconffile, - normaliseconf: *normaliseconf, - confjson: *confjson, - autoconf: *autoconf, -@@ -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 -- cfg = readConfig(logger, args.useconf, args.useconffile, args.normaliseconf) -+ cfg = readConfig(logger, args.useconf, args.useconffile, args.extraconffile, args.normaliseconf) - // 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 +@@ -137,6 +138,17 @@ func main() { + return + } + ++ if *extraconffile !="" { ++ f, err := os.Open(*extraconffile) ++ if err != nil { ++ panic(err) ++ } ++ if _, err := cfg.ReadFrom(f); err != nil { ++ panic(err) ++ } ++ _ = f.Close() ++ } ++ + privateKey := ed25519.PrivateKey(cfg.PrivateKey) + publicKey := privateKey.Public().(ed25519.PublicKey) + +diff --git a/src/config/config.go b/src/config/config.go +index e899a35..76b9ec8 100644 +--- a/src/config/config.go ++++ b/src/config/config.go +@@ -112,7 +112,7 @@ func (cfg *NodeConfig) ReadFrom(r io.Reader) (int64, error) { + // then parse the configuration we loaded above on top of it. The effect + // of this is that any configuration item that is missing from the provided + // configuration will use a sane default. +- *cfg = *GenerateConfig() ++ // *cfg = *GenerateConfig() + if err := cfg.UnmarshalHJSON(conf); err != nil { + return n, err + } + +base-commit: b759683b76985665b5218346abab35f08d9f4d38 -- -2.33.1 +2.41.0 -- cgit v1.2.3