From fe6067fc248673d6509b557ff010778f7762382f Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sun, 18 Oct 2020 15:00:55 -0700 Subject: gnu: u-boot: Update to 2020.10. * gnu/packages/bootloaders (u-boot): Update to 2020.10. * gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch: Refresh patch. --- gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch index 29dec4f5e9..d6c1987718 100644 --- a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch +++ b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch @@ -32,9 +32,9 @@ Index: u-boot/configs/sifive_fu540_defconfig =================================================================== --- u-boot.orig/configs/sifive_fu540_defconfig +++ u-boot/configs/sifive_fu540_defconfig -@@ -12,3 +12,5 @@ CONFIG_DISPLAY_BOARDINFO=y - CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" - CONFIG_SYS_RELOC_GD_ENV_ADDR=y +@@ -27,3 +27,5 @@ CONFIG_SPL_DM_SEQ_ALIAS=y + CONFIG_SPL_CLK=y CONFIG_DM_MTD=y + CONFIG_DM_RESET=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" -- cgit v1.2.3 From c87646400dbc304e3eaa6c469c11341f8f44ce88 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Tue, 22 Sep 2020 22:59:47 -0400 Subject: gnu: Add farstream. * gnu/packages/freedesktop.scm (farstream): New variable. * gnu/packages/patches/farstream-make.patch: New file. * gnu/local.mk (dist_PATCH_DATA): Add it. Signed-off-by: Julien Lepiller --- gnu/local.mk | 1 + gnu/packages/freedesktop.scm | 87 +++++++++++++++++++++++++++++++ gnu/packages/patches/farstream-make.patch | 39 ++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 gnu/packages/patches/farstream-make.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 5a79c79d6f..607f78b1f3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -953,6 +953,7 @@ dist_patch_DATA = \ %D%/packages/patches/exiv2-CVE-2017-14859-14862-14864.patch \ %D%/packages/patches/extempore-unbundle-external-dependencies.patch \ %D%/packages/patches/extundelete-e2fsprogs-1.44.patch \ + %D%/packages/patches/farstream-make.patch \ %D%/packages/patches/fastcap-mulGlobal.patch \ %D%/packages/patches/fastcap-mulSetup.patch \ %D%/packages/patches/fasthenry-spAllocate.patch \ diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index cfb87178fb..6caff14cf2 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -21,6 +21,7 @@ ;;; Copyright © 2020 Rene Saavedra ;;; Copyright © 2020 Nicolò Balzarotti ;;; Copyright © 2020 Anders Thuné +;;; Copyright © 2020 Raghav Gururajan ;;; ;;; This file is part of GNU Guix. ;;; @@ -71,6 +72,7 @@ (define-module (gnu packages freedesktop) #:use-module (gnu packages gnome) #:use-module (gnu packages gperf) #:use-module (gnu packages graphviz) + #:use-module (gnu packages gstreamer) #:use-module (gnu packages gtk) #:use-module (gnu packages image) #:use-module (gnu packages libffi) @@ -79,6 +81,7 @@ (define-module (gnu packages freedesktop) #:use-module (gnu packages linux) #:use-module (gnu packages man) #:use-module (gnu packages m4) + #:use-module (gnu packages networking) #:use-module (gnu packages nss) #:use-module (gnu packages package-management) #:use-module (gnu packages perl) @@ -98,6 +101,90 @@ (define-module (gnu packages freedesktop) #:use-module (gnu packages xorg) #:use-module (srfi srfi-1)) +(define-public farstream + (package + (name "farstream") + (version "0.2.9") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://gitlab.freedesktop.org/farstream/farstream.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1sd8syldyq6bphfdm129s3gq554vfv7vh1vcwzk48gjryf101awk")) + (patches + (search-patches "farstream-make.patch")))) + (build-system glib-or-gtk-build-system) + (outputs '("out" "doc")) + (arguments + `(#:tests? #f ; https://gitlab.freedesktop.org/farstream/farstream/-/issues/18 + #:configure-flags + (list + "--enable-gtk-doc" + "--enable-glib-asserts" + (string-append "--with-html-dir=" + (assoc-ref %outputs "doc") + "/share/gtk-doc/html")) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'copy-common + (lambda _ + (delete-file "autogen.sh") + (copy-recursively + (assoc-ref %build-inputs "common") + "common") + #t)) + (add-after 'unpack 'patch-docbook-xml + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "docs" + (substitute* '("libs/farstream-libs-docs.sgml" + "plugins/farstream-plugins-docs.sgml") + (("http://www.oasis-open.org/docbook/xml/4.1.2/") + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/")))) + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("common" + ,(origin + (method git-fetch) + (uri + (git-reference + (url "https://gitlab.freedesktop.org/gstreamer/common.git") + (commit "88e512ca7197a45c4114f7fa993108f23245bf50"))) + (file-name + (git-file-name "common" "latest.88e512c")) + (sha256 + (base32 "1nk94pnskjyngqcfb9p32g4yvf4nzpjszisw24r9azl0pawqpsn6")))) + ("docbook-xml" ,docbook-xml-4.1.2) + ("docbook-xsl" ,docbook-xsl) + ("gobject-introspection" ,gobject-introspection) + ("gtk-doc" ,gtk-doc) + ("libtool" ,libtool) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("python" ,python-wrapper) + ("xsltproc" ,libxslt))) + (inputs + `(("glib" ,glib) + ("gtk+" ,gtk+) + ("gupnp-igd" ,gupnp-igd) + ("libnice" ,libnice))) + (propagated-inputs + `(("gstreamer" ,gstreamer) + ("gst-plugins-bad" ,gst-plugins-bad) + ("gst-plugins-base" ,gst-plugins-base) + ("gst-plugins-good" ,gst-plugins-good))) + (synopsis "The Farstream VVoIP framework") + (description "Farstream is a collection of GStreamer modules and libraries +for videoconferencing.") + (home-page "https://www.freedesktop.org/wiki/Software/Farstream/") + (license license:lgpl2.1+))) + (define-public libglib-testing (package (name "libglib-testing") diff --git a/gnu/packages/patches/farstream-make.patch b/gnu/packages/patches/farstream-make.patch new file mode 100644 index 0000000000..6c1e9e7119 --- /dev/null +++ b/gnu/packages/patches/farstream-make.patch @@ -0,0 +1,39 @@ +This patch comes from upstream: +https://gitlab.freedesktop.org/farstream/farstream/-/merge_requests/4 + +From 54987d445ea714b467d901b7daf8c09ed0644189 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 12 Mar 2020 14:07:23 +0100 +Subject: [PATCH] build: Adapt to backwards incompatible change in GNU Make 4.3 + +GNU Make 4.3 has a backwards incompatible change affecting the use of +number signs or hashes (ie., #) inside function invocations. See: +https://lists.gnu.org/archive/html/info-gnu/2020-01/msg00004.html + +In this case, it would expand the '\#' in the '\n\#include \"$(h)\"' +argument to the foreach call to '\#', not '#'. This would lead to +spurious backslashes in front of the '#include' directives in the +generated fs-enumtypes.c file. + +Spotted by Ernestas Kulik. +--- + common-modified/gst-glib-gen.mak | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/common-modified/gst-glib-gen.mak b/common-modified/gst-glib-gen.mak +index 14f1ba37..2247a41c 100644 +--- a/common-modified/gst-glib-gen.mak ++++ b/common-modified/gst-glib-gen.mak +@@ -6,7 +6,8 @@ + #glib_gen_prefix=gst_color_balance + #glib_gen_basename=colorbalance + +-enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\") ++hash:=\# ++enum_headers=$(foreach h,$(glib_enum_headers),\n$(hash)include \"$(h)\") + + # these are all the rules generating the relevant files + $(glib_gen_basename)-enumtypes.h: $(glib_enum_headers) +-- +GitLab + -- cgit v1.2.3 From 2c1216207efb1198cdebe1072875169876f9cac9 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 20 Oct 2020 03:39:24 -0400 Subject: gnu: icecat: Update to 78.4.0-guix0-preview1 [security fixes]. Includes fixes for CVE-2020-15683 and CVE-2020-15969. * gnu/packages/gnuzilla.scm (%icecat-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. * gnu/packages/patches/icecat-makeicecat.patch: Adapt to new version. --- gnu/packages/gnuzilla.scm | 12 ++++++------ gnu/packages/patches/icecat-makeicecat.patch | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 4dbe864598..f74992e2e3 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -550,8 +550,8 @@ (define* (computed-origin-method gexp-promise hash-algo hash #:system system #:guile-for-build guile))) -(define %icecat-version "78.3.1-guix0-preview1") -(define %icecat-build-id "20200926000000") ;must be of the form YYYYMMDDhhmmss +(define %icecat-version "78.4.0-guix0-preview1") +(define %icecat-build-id "20201019000000") ;must be of the form YYYYMMDDhhmmss ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat' @@ -573,11 +573,11 @@ (define icecat-source "firefox-" upstream-firefox-version ".source.tar.xz")) (sha256 (base32 - "1savwk91vhvg096w289xwpjvqbbd2ibfad90081hirlzd1kpvljz")))) + "1z3hj45bnd12z3g6ajv9qrgclca7fymi1sxj9l9nh9q6y6xz0g4f")))) - (upstream-icecat-base-version "78.3.1") ; maybe older than base-version + (upstream-icecat-base-version "78.4.0") ; maybe older than base-version ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version)) - (gnuzilla-commit "cd2af837fce69145effef83def6993d244887b03") + (gnuzilla-commit "05adddbf87a5ee11de7cd90794c331a178bcfd5c") (gnuzilla-source (origin (method git-fetch) @@ -589,7 +589,7 @@ (define icecat-source (string-take gnuzilla-commit 8))) (sha256 (base32 - "0266gp8vs4avlfdnr8dj7b47msxv1vkd0xpnifp04v4scvgj0yaj")))) + "128h0gnn1adinjkfmskxdjkvyh60li8czlar2xdjn2b6myiq5yny")))) ;; 'search-patch' returns either a valid file name or #f, so wrap it ;; in 'assume-valid-file-name' to avoid 'local-file' warnings. diff --git a/gnu/packages/patches/icecat-makeicecat.patch b/gnu/packages/patches/icecat-makeicecat.patch index c90950d5ef..e0cdde61ec 100644 --- a/gnu/packages/patches/icecat-makeicecat.patch +++ b/gnu/packages/patches/icecat-makeicecat.patch @@ -25,7 +25,7 @@ index 8be2362..48716f2 100755 -wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc -gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 -gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc --echo -n 5fd27d67689fe60803022035e556146d2dbce5e53d21c14d026fc31dd2e45be9 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +-echo -n 8e3cf0bbf1062768134db2eb10ab774731ca5ec6694b65def82234bb0a9170fc firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - - -echo Extracting Firefox tarball -tar -xf firefox-${FFVERSION}esr.source.tar.xz @@ -37,7 +37,7 @@ index 8be2362..48716f2 100755 +# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc +# gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 +# gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc -+# echo -n 5fd27d67689fe60803022035e556146d2dbce5e53d21c14d026fc31dd2e45be9 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - ++# echo -n 8e3cf0bbf1062768134db2eb10ab774731ca5ec6694b65def82234bb0a9170fc firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +# +# echo Extracting Firefox tarball +# tar -xf firefox-${FFVERSION}esr.source.tar.xz -- cgit v1.2.3 From cad55e91fd5a481279e6286a2728761b8da7c07a Mon Sep 17 00:00:00 2001 From: Malte Frank Gerdes Date: Sat, 10 Oct 2020 15:31:14 +0200 Subject: gnu: openocd: Update to 9a877a83a1c8b1f105cdc0de46c5cbc4d9e8799e. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/embedded.scm (openocd): Update to 9a877a83a1c8b1f105cdc0de46c5cbc4d9e8799e. [version]: Substitute release with current master. [source]: Remove openocd-nrf52.patch [arguments]: Replace bootstrap build phase. * gnu/local.mk: Remove openocd-nrf52.patch. * gnu/packages/patches/openocd-nrf52.patch: Remove file. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 2 +- gnu/packages/embedded.scm | 124 ++--- gnu/packages/patches/openocd-nrf52.patch | 827 ------------------------------- 3 files changed, 65 insertions(+), 888 deletions(-) delete mode 100644 gnu/packages/patches/openocd-nrf52.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 607f78b1f3..31385d0db6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -37,6 +37,7 @@ # Copyright © 2020 Brice Waegeneire # Copyright © 2020 Tanguy Le Carrour # Copyright © 2020 Martin Becze +# Copyright © 2020 Malte Frank Gerdes # # This file is part of GNU Guix. # @@ -1393,7 +1394,6 @@ dist_patch_DATA = \ %D%/packages/patches/openfoam-4.1-cleanup.patch \ %D%/packages/patches/openjdk-10-idlj-reproducibility.patch \ %D%/packages/patches/openmpi-mtl-priorities.patch \ - %D%/packages/patches/openocd-nrf52.patch \ %D%/packages/patches/openssh-hurd.patch \ %D%/packages/patches/openresolv-restartcmd-guix.patch \ %D%/packages/patches/openscad-parser-boost-1.72.patch \ diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index 1eacb72a45..cc26b17ea6 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -514,67 +514,71 @@ (define-public jimtcl (license license:bsd-2))) (define-public openocd - (package - (name "openocd") - (version "0.10.0") - (source (origin - (method url-fetch) - (uri (string-append "mirror://sourceforge/openocd/openocd/" - version "/openocd-" version ".tar.gz")) - (sha256 - (base32 - "09p57y3c2spqx4vjjlz1ljm1lcd0j9q8g76ywxqgn3yc34wv18zd")) - ;; FIXME: Remove after nrf52 patch is merged. - (patches - (search-patches "openocd-nrf52.patch")))) - (build-system gnu-build-system) - (native-inputs - `(("autoconf" ,autoconf) - ("automake" ,automake) - ("libtool" ,libtool) - ("pkg-config" ,pkg-config))) - (inputs - `(("hidapi" ,hidapi) - ("jimtcl" ,jimtcl) - ("libftdi" ,libftdi) - ("libjaylink" ,libjaylink) - ("libusb-compat" ,libusb-compat))) - (arguments - '(#:configure-flags - (append (list "--disable-werror" - "--enable-sysfsgpio" - "--disable-internal-jimtcl" - "--disable-internal-libjaylink") - (map (lambda (programmer) - (string-append "--enable-" programmer)) - '("amtjtagaccel" "armjtagew" "buspirate" "ftdi" - "gw16012" "jlink" "opendous" "osbdm" - "parport" "aice" "cmsis-dap" "dummy" "jtag_vpi" - "remote-bitbang" "rlink" "stlink" "ti-icdi" "ulink" - "usbprog" "vsllink" "usb-blaster-2" "usb_blaster" - "presto" "openjtag"))) - #:phases - (modify-phases %standard-phases - ;; Required because of patched sources. - (add-before 'configure 'autoreconf - (lambda _ (invoke "autoreconf" "-vfi") #t)) - (add-after 'autoreconf 'change-udev-group - (lambda _ - (substitute* "contrib/60-openocd.rules" - (("plugdev") "dialout")) - #t)) - (add-after 'install 'install-udev-rules - (lambda* (#:key outputs #:allow-other-keys) - (install-file "contrib/60-openocd.rules" - (string-append - (assoc-ref outputs "out") - "/lib/udev/rules.d/")) - #t))))) - (home-page "http://openocd.org") - (synopsis "On-Chip Debugger") - (description "OpenOCD provides on-chip programming and debugging support + (let ((commit "9a877a83a1c8b1f105cdc0de46c5cbc4d9e8799e") + (revision "0")) + (package + (name "openocd") + (version (string-append "0.10.0-" revision "." + (string-take commit 7))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.code.sf.net/p/openocd/code") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "1q536cp80v2bcy6xwk08f1r2ljyw13jchx3a1z7d3ni3vqql7rc6")))) + (build-system gnu-build-system) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ("which" ,base:which) + ("pkg-config" ,pkg-config))) + (inputs + `(("hidapi" ,hidapi) + ("jimtcl" ,jimtcl) + ("libftdi" ,libftdi) + ("libjaylink" ,libjaylink) + ("libusb-compat" ,libusb-compat))) + (arguments + '(#:configure-flags + (append (list "--disable-werror" + "--enable-sysfsgpio" + "--disable-internal-jimtcl" + "--disable-internal-libjaylink") + (map (lambda (programmer) + (string-append "--enable-" programmer)) + '("amtjtagaccel" "armjtagew" "buspirate" "ftdi" + "gw16012" "jlink" "opendous" "osbdm" + "parport" "aice" "cmsis-dap" "dummy" "jtag_vpi" + "remote-bitbang" "rlink" "stlink" "ti-icdi" "ulink" + "usbprog" "vsllink" "usb-blaster-2" "usb_blaster" + "presto" "openjtag"))) + #:phases + (modify-phases %standard-phases + (replace 'bootstrap + (lambda _ + (patch-shebang "bootstrap") + (invoke "./bootstrap" "nosubmodule"))) + (add-after 'autoreconf 'change-udev-group + (lambda _ + (substitute* "contrib/60-openocd.rules" + (("plugdev") "dialout")) + #t)) + (add-after 'install 'install-udev-rules + (lambda* (#:key outputs #:allow-other-keys) + (install-file "contrib/60-openocd.rules" + (string-append + (assoc-ref outputs "out") + "/lib/udev/rules.d/")) + #t))))) + (home-page "http://openocd.org") + (synopsis "On-Chip Debugger") + (description "OpenOCD provides on-chip programming and debugging support with a layered architecture of JTAG interface and TAP support.") - (license license:gpl2+))) + (license license:gpl2+)))) ;; The commits for all propeller tools are the stable versions published at ;; https://github.com/propellerinc/propgcc in the release_1_0. According to diff --git a/gnu/packages/patches/openocd-nrf52.patch b/gnu/packages/patches/openocd-nrf52.patch deleted file mode 100644 index 0ec4348cb4..0000000000 --- a/gnu/packages/patches/openocd-nrf52.patch +++ /dev/null @@ -1,827 +0,0 @@ -This patch adds support for nRF52 series devices. It is patchset 7 from -, which has been tested, but not -merged yet in master. - -From: Michael Dietz -Date: Mon, 30 May 2016 12:50:44 +0000 (-0700) -Subject: Added support for nRF52 Series Devices. -X-Git-Url: http://openocd.zylin.com/gitweb?p=openocd.git;a=commitdiff_plain;h=9ba15633e221d9d72e320372ba8f49d3f30d4bce - -Added support for nRF52 Series Devices. - -Both nrf52.c and nrf52.cfg are based off of previous nRF51 files. -- Some possible race conditions with NVMC have been fixed in nRF52.c -- Removed nrf51_get_probed_chip_if_halted() as the core does not have to be halted to perform operations where it is called. -- Only registers that are needed by openOCD are defined, some registers in nRF51 don't exist in nRF52 and are removed. -- Some all around cleanup has been done. -- The protection mechanism is completely different on nRF52 and this has not been implemented yet - just prints a warning and returns for now. - -Change-Id: I4dd42c86f33f450709bb981806c2655f04aa6201 -Signed-off-by: Michael Dietz ---- - -diff --git a/src/flash/nor/Makefile.am b/src/flash/nor/Makefile.am -index 727e4f2..839667c 100644 ---- a/src/flash/nor/Makefile.am -+++ b/src/flash/nor/Makefile.am -@@ -36,6 +36,7 @@ NOR_DRIVERS = \ - %D%/niietcm4.c \ - %D%/non_cfi.c \ - %D%/nrf51.c \ -+ %D%/nrf52.c \ - %D%/numicro.c \ - %D%/ocl.c \ - %D%/pic32mx.c \ -diff --git a/src/flash/nor/drivers.c b/src/flash/nor/drivers.c -index 56a5cb2..071273e 100644 ---- a/src/flash/nor/drivers.c -+++ b/src/flash/nor/drivers.c -@@ -48,6 +48,7 @@ extern struct flash_driver mdr_flash; - extern struct flash_driver mrvlqspi_flash; - extern struct flash_driver niietcm4_flash; - extern struct flash_driver nrf51_flash; -+extern struct flash_driver nrf52_flash; - extern struct flash_driver numicro_flash; - extern struct flash_driver ocl_flash; - extern struct flash_driver pic32mx_flash; -@@ -100,6 +101,7 @@ static struct flash_driver *flash_drivers[] = { - &mrvlqspi_flash, - &niietcm4_flash, - &nrf51_flash, -+ &nrf52_flash, - &numicro_flash, - &ocl_flash, - &pic32mx_flash, -diff --git a/src/flash/nor/nrf52.c b/src/flash/nor/nrf52.c -new file mode 100644 -index 0000000..7f2bd35 ---- /dev/null -+++ b/src/flash/nor/nrf52.c -@@ -0,0 +1,733 @@ -+/*************************************************************************** -+ * Copyright (C) 2013 Synapse Product Development * -+ * Andrey Smirnov * -+ * Angus Gratton * -+ * Erdem U. Altunyurt * -+ * * -+ * This program is free software; you can redistribute it and/or modify * -+ * it under the terms of the GNU General Public License as published by * -+ * the Free Software Foundation; either version 2 of the License, or * -+ * (at your option) any later version. * -+ * * -+ * This program is distributed in the hope that it will be useful, * -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of * -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -+ * GNU General Public License for more details. * -+ * * -+ * You should have received a copy of the GNU General Public License * -+ * along with this program. If not, see . * -+ ***************************************************************************/ -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ -+#include -+ -+#include "imp.h" -+#include -+#include -+#include -+ -+/* nRF52 Register addresses used by openOCD. */ -+#define NRF52_FLASH_BASE_ADDR (0x0) -+ -+#define NRF52_FICR_BASE_ADDR (0x10000000) -+#define NRF52_FICR_CODEPAGESIZE_ADDR (NRF52_FICR_BASE_ADDR | 0x010) -+#define NRF52_FICR_CODESIZE_ADDR (NRF52_FICR_BASE_ADDR | 0x014) -+ -+#define NRF52_UICR_BASE_ADDR (0x10001000) -+ -+#define NRF52_NVMC_BASE_ADDR (0x4001E000) -+#define NRF52_NVMC_READY_ADDR (NRF52_NVMC_BASE_ADDR | 0x400) -+#define NRF52_NVMC_CONFIG_ADDR (NRF52_NVMC_BASE_ADDR | 0x504) -+#define NRF52_NVMC_ERASEPAGE_ADDR (NRF52_NVMC_BASE_ADDR | 0x508) -+#define NRF52_NVMC_ERASEALL_ADDR (NRF52_NVMC_BASE_ADDR | 0x50C) -+#define NRF52_NVMC_ERASEUICR_ADDR (NRF52_NVMC_BASE_ADDR | 0x514) -+ -+/* nRF52 bit fields. */ -+enum nrf52_nvmc_config_bits { -+ NRF52_NVMC_CONFIG_REN = 0x0, -+ NRF52_NVMC_CONFIG_WEN = 0x01, -+ NRF52_NVMC_CONFIG_EEN = 0x02 -+}; -+ -+enum nrf52_nvmc_ready_bits { -+ NRF52_NVMC_BUSY = 0x0, -+ NRF52_NVMC_READY = 0x01 -+}; -+ -+/* nRF52 state information. */ -+struct nrf52_info { -+ uint32_t code_page_size; /* Size of FLASH page in bytes. */ -+ uint32_t code_memory_size; /* Size of Code FLASH region in bytes. */ -+ -+ struct { -+ bool probed; -+ int (*write) (struct flash_bank *bank, -+ struct nrf52_info *chip, -+ const uint8_t *buffer, uint32_t offset, uint32_t count); -+ } bank[2]; /* There are two regions in nRF52 FLASH - Code and UICR. */ -+ struct target *target; -+}; -+ -+static int nrf52_protect_check(struct flash_bank *bank); -+ -+static int nrf52_probe(struct flash_bank *bank) -+{ -+ int res; -+ struct nrf52_info *chip = bank->driver_priv; -+ assert(chip != NULL); -+ -+ res = target_read_u32(chip->target, -+ NRF52_FICR_CODEPAGESIZE_ADDR, -+ &chip->code_page_size); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Couldn't read code page size"); -+ return res; -+ } -+ -+ res = target_read_u32(chip->target, -+ NRF52_FICR_CODESIZE_ADDR, -+ &chip->code_memory_size); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Couldn't read code memory size"); -+ return res; -+ } -+ -+ chip->code_memory_size = chip->code_memory_size * chip->code_page_size; -+ -+ if (bank->base == NRF52_FLASH_BASE_ADDR) { -+ bank->size = chip->code_memory_size; -+ bank->num_sectors = bank->size / chip->code_page_size; -+ bank->sectors = calloc(bank->num_sectors, -+ sizeof((bank->sectors)[0])); -+ if (!bank->sectors) -+ return ERROR_FLASH_BANK_NOT_PROBED; -+ -+ /* Fill out the sector information: All nRF51 sectors are the same size. */ -+ for (int i = 0; i < bank->num_sectors; i++) { -+ bank->sectors[i].size = chip->code_page_size; -+ bank->sectors[i].offset = i * chip->code_page_size; -+ -+ /* Mark as unknown. */ -+ bank->sectors[i].is_erased = -1; -+ bank->sectors[i].is_protected = -1; -+ } -+ -+ nrf52_protect_check(bank); -+ -+ chip->bank[0].probed = true; -+ } else { /* This is the UICR bank. */ -+ bank->size = chip->code_page_size; -+ bank->num_sectors = 1; -+ bank->sectors = calloc(bank->num_sectors, -+ sizeof((bank->sectors)[0])); -+ if (!bank->sectors) -+ return ERROR_FLASH_BANK_NOT_PROBED; -+ -+ bank->sectors[0].size = bank->size; -+ bank->sectors[0].offset = 0; -+ -+ bank->sectors[0].is_erased = -1; -+ bank->sectors[0].is_protected = -1; -+ -+ chip->bank[1].probed = true; -+ } -+ -+ return ERROR_OK; -+} -+ -+static int nrf52_bank_is_probed(struct flash_bank *bank) -+{ -+ struct nrf52_info *chip = bank->driver_priv; -+ assert(chip != NULL); -+ -+ return chip->bank[bank->bank_number].probed; -+} -+ -+static int nrf52_auto_probe(struct flash_bank *bank) -+{ -+ if (!nrf52_bank_is_probed(bank)) -+ return nrf52_probe(bank); -+ else -+ return ERROR_OK; -+} -+ -+static int nrf52_wait_for_nvmc(struct nrf52_info *chip) -+{ -+ int res; -+ uint32_t ready; -+ int timeout = 100; -+ -+ do { -+ res = target_read_u32(chip->target, NRF52_NVMC_READY_ADDR, &ready); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Couldn't read NVMC_READY register"); -+ return res; -+ } -+ -+ if (ready == NRF52_NVMC_READY) -+ return ERROR_OK; -+ -+ alive_sleep(1); -+ } while (timeout--); -+ -+ LOG_DEBUG("Timed out waiting for the NVMC to be ready"); -+ return ERROR_FLASH_BUSY; -+} -+ -+static int nrf52_nvmc_erase_enable(struct nrf52_info *chip) -+{ -+ int res; -+ -+ res = nrf52_wait_for_nvmc(chip); -+ if (res != ERROR_OK) -+ return res; -+ -+ res = target_write_u32(chip->target, -+ NRF52_NVMC_CONFIG_ADDR, -+ NRF52_NVMC_CONFIG_EEN); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Failed to configure the NVMC for erasing"); -+ return res; -+ } -+ -+ return res; -+} -+ -+static int nrf52_nvmc_write_enable(struct nrf52_info *chip) -+{ -+ int res; -+ -+ res = nrf52_wait_for_nvmc(chip); -+ if (res != ERROR_OK) -+ return res; -+ -+ res = target_write_u32(chip->target, -+ NRF52_NVMC_CONFIG_ADDR, -+ NRF52_NVMC_CONFIG_WEN); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Failed to configure the NVMC for writing"); -+ return res; -+ } -+ -+ return res; -+} -+ -+static int nrf52_nvmc_read_only(struct nrf52_info *chip) -+{ -+ int res; -+ -+ res = nrf52_wait_for_nvmc(chip); -+ if (res != ERROR_OK) -+ return res; -+ -+ res = target_write_u32(chip->target, -+ NRF52_NVMC_CONFIG_ADDR, -+ NRF52_NVMC_CONFIG_REN); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Failed to configure the NVMC for read-only"); -+ return res; -+ } -+ -+ return res; -+} -+ -+static int nrf52_nvmc_generic_erase(struct nrf52_info *chip, -+ uint32_t erase_register, -+ uint32_t erase_value) -+{ -+ int res; -+ -+ res = nrf52_nvmc_erase_enable(chip); -+ if (res != ERROR_OK) -+ return res; -+ -+ res = target_write_u32(chip->target, -+ erase_register, -+ erase_value); -+ if (res != ERROR_OK) -+ LOG_ERROR("Failed to write NVMC erase register"); -+ -+ return nrf52_nvmc_read_only(chip); -+} -+ -+static int nrf52_protect_check(struct flash_bank *bank) -+{ -+ LOG_WARNING("nrf52_protect_check() is not implemented for nRF52 series devices yet"); -+ return ERROR_OK; -+} -+ -+static int nrf52_protect(struct flash_bank *bank, int set, int first, int last) -+{ -+ LOG_WARNING("nrf52_protect() is not implemented for nRF52 series devices yet"); -+ return ERROR_OK; -+} -+ -+static struct flash_sector *nrf52_find_sector_by_address(struct flash_bank *bank, uint32_t address) -+{ -+ struct nrf52_info *chip = bank->driver_priv; -+ assert(chip != NULL); -+ -+ for (int i = 0; i < bank->num_sectors; i++) -+ if (bank->sectors[i].offset <= address && -+ address < (bank->sectors[i].offset + chip->code_page_size)) { -+ return &bank->sectors[i]; -+ } -+ -+ return NULL; -+} -+ -+static int nrf52_erase_all(struct nrf52_info *chip) -+{ -+ LOG_DEBUG("Erasing all non-volatile memory"); -+ return nrf52_nvmc_generic_erase(chip, -+ NRF52_NVMC_ERASEALL_ADDR, -+ 0x01); -+} -+ -+static int nrf52_erase_page(struct flash_bank *bank, -+ struct nrf52_info *chip, -+ struct flash_sector *sector) -+{ -+ int res; -+ -+ LOG_DEBUG("Erasing page at 0x%"PRIx32, sector->offset); -+ if (sector->is_protected == 1) { -+ LOG_ERROR("Cannot erase protected sector at 0x%" PRIx32, sector->offset); -+ return ERROR_FAIL; -+ } -+ -+ if (bank->base == NRF52_UICR_BASE_ADDR) { -+ res = nrf52_nvmc_generic_erase(chip, -+ NRF52_NVMC_ERASEUICR_ADDR, -+ 0x00000001); -+ } else { -+ res = nrf52_nvmc_generic_erase(chip, -+ NRF52_NVMC_ERASEPAGE_ADDR, -+ sector->offset); -+ } -+ -+ if (res == ERROR_OK) -+ sector->is_erased = 1; -+ return res; -+} -+ -+static const uint8_t nrf52_flash_write_code[] = { -+ /* See contrib/loaders/flash/cortex-m0.S */ -+ /* : */ -+ 0x0d, 0x68, /* ldr r5, [r1, #0] */ -+ 0x00, 0x2d, /* cmp r5, #0 */ -+ 0x0b, 0xd0, /* beq.n 1e */ -+ 0x4c, 0x68, /* ldr r4, [r1, #4] */ -+ 0xac, 0x42, /* cmp r4, r5 */ -+ 0xf9, 0xd0, /* beq.n 0 */ -+ 0x20, 0xcc, /* ldmia r4!, {r5} */ -+ 0x20, 0xc3, /* stmia r3!, {r5} */ -+ 0x94, 0x42, /* cmp r4, r2 */ -+ 0x01, 0xd3, /* bcc.n 18 */ -+ 0x0c, 0x46, /* mov r4, r1 */ -+ 0x08, 0x34, /* adds r4, #8 */ -+ /* : */ -+ 0x4c, 0x60, /* str r4, [r1, #4] */ -+ 0x04, 0x38, /* subs r0, #4 */ -+ 0xf0, 0xd1, /* bne.n 0 */ -+ /* : */ -+ 0x00, 0xbe /* bkpt 0x0000 */ -+}; -+ -+ -+/* Start a low level flash write for the specified region */ -+static int nrf52_ll_flash_write(struct nrf52_info *chip, uint32_t offset, const uint8_t *buffer, uint32_t bytes) -+{ -+ struct target *target = chip->target; -+ uint32_t buffer_size = 8192; -+ struct working_area *write_algorithm; -+ struct working_area *source; -+ uint32_t address = NRF52_FLASH_BASE_ADDR + offset; -+ struct reg_param reg_params[4]; -+ struct armv7m_algorithm armv7m_info; -+ int retval = ERROR_OK; -+ -+ LOG_DEBUG("Writing buffer to flash offset=0x%"PRIx32" bytes=0x%"PRIx32, offset, bytes); -+ assert(bytes % 4 == 0); -+ -+ /* allocate working area with flash programming code */ -+ if (target_alloc_working_area(target, sizeof(nrf52_flash_write_code), -+ &write_algorithm) != ERROR_OK) { -+ LOG_WARNING("no working area available, falling back to slow memory writes"); -+ -+ for (; bytes > 0; bytes -= 4) { -+ retval = target_write_memory(chip->target, -+ offset, 4, 1, buffer); -+ if (retval != ERROR_OK) -+ return retval; -+ -+ retval = nrf52_wait_for_nvmc(chip); -+ if (retval != ERROR_OK) -+ return retval; -+ -+ offset += 4; -+ buffer += 4; -+ } -+ -+ return ERROR_OK; -+ } -+ -+ LOG_WARNING("using fast async flash loader. This is currently supported"); -+ LOG_WARNING("only with ST-Link and CMSIS-DAP. If you have issues, add"); -+ LOG_WARNING("\"set WORKAREASIZE 0\" before sourcing nrf52.cfg to disable it"); -+ -+ retval = target_write_buffer(target, write_algorithm->address, -+ sizeof(nrf52_flash_write_code), -+ nrf52_flash_write_code); -+ if (retval != ERROR_OK) -+ return retval; -+ -+ /* memory buffer */ -+ while (target_alloc_working_area(target, buffer_size, &source) != ERROR_OK) { -+ buffer_size /= 2; -+ buffer_size &= ~3UL; /* Make sure it's 4 byte aligned */ -+ if (buffer_size <= 256) { -+ /* free working area, write algorithm already allocated */ -+ target_free_working_area(target, write_algorithm); -+ -+ LOG_WARNING("No large enough working area available, can't do block memory writes"); -+ return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; -+ } -+ } -+ -+ armv7m_info.common_magic = ARMV7M_COMMON_MAGIC; -+ armv7m_info.core_mode = ARM_MODE_THREAD; -+ -+ init_reg_param(®_params[0], "r0", 32, PARAM_IN_OUT); /* byte count */ -+ init_reg_param(®_params[1], "r1", 32, PARAM_OUT); /* buffer start */ -+ init_reg_param(®_params[2], "r2", 32, PARAM_OUT); /* buffer end */ -+ init_reg_param(®_params[3], "r3", 32, PARAM_IN_OUT); /* target address */ -+ -+ buf_set_u32(reg_params[0].value, 0, 32, bytes); -+ buf_set_u32(reg_params[1].value, 0, 32, source->address); -+ buf_set_u32(reg_params[2].value, 0, 32, source->address + source->size); -+ buf_set_u32(reg_params[3].value, 0, 32, address); -+ -+ retval = target_run_flash_async_algorithm(target, buffer, bytes/4, 4, -+ 0, NULL, -+ 4, reg_params, -+ source->address, source->size, -+ write_algorithm->address, 0, -+ &armv7m_info); -+ -+ target_free_working_area(target, source); -+ target_free_working_area(target, write_algorithm); -+ -+ destroy_reg_param(®_params[0]); -+ destroy_reg_param(®_params[1]); -+ destroy_reg_param(®_params[2]); -+ destroy_reg_param(®_params[3]); -+ -+ return retval; -+} -+ -+/* Check and erase flash sectors in specified range, then start a low level page write. -+ start/end must be sector aligned. -+*/ -+static int nrf52_write_pages(struct flash_bank *bank, uint32_t start, uint32_t end, const uint8_t *buffer) -+{ -+ int res; -+ uint32_t offset; -+ struct flash_sector *sector; -+ struct nrf52_info *chip = bank->driver_priv; -+ assert(chip != NULL); -+ -+ assert(start % chip->code_page_size == 0); -+ assert(end % chip->code_page_size == 0); -+ -+ /* Erase all sectors */ -+ for (offset = start; offset < end; offset += chip->code_page_size) { -+ sector = nrf52_find_sector_by_address(bank, offset); -+ -+ if (sector == NULL) { -+ LOG_ERROR("Invalid sector @ 0x%08"PRIx32, offset); -+ return ERROR_FLASH_SECTOR_INVALID; -+ } -+ -+ if (sector->is_protected == 1) { -+ LOG_ERROR("Can't erase protected sector @ 0x%08"PRIx32, offset); -+ return ERROR_FAIL; -+ } -+ -+ if (sector->is_erased != 1) { /* 1 = erased, 0= not erased, -1 = unknown */ -+ res = nrf52_erase_page(bank, chip, sector); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Failed to erase sector @ 0x%08"PRIx32, sector->offset); -+ return res; -+ } -+ } -+ sector->is_erased = 1; -+ } -+ -+ res = nrf52_nvmc_write_enable(chip); -+ if (res != ERROR_OK) -+ return res; -+ -+ res = nrf52_ll_flash_write(chip, start, buffer, (end - start)); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Failed to write FLASH"); -+ nrf52_nvmc_read_only(chip); -+ return res; -+ } -+ -+ return nrf52_nvmc_read_only(chip); -+} -+ -+static int nrf52_erase(struct flash_bank *bank, int first, int last) -+{ -+ int res = ERROR_OK; -+ struct nrf52_info *chip = bank->driver_priv; -+ assert(chip != NULL); -+ -+ /* For each sector to be erased */ -+ for (int s = first; s <= last && res == ERROR_OK; s++) -+ res = nrf52_erase_page(bank, chip, &bank->sectors[s]); -+ -+ return res; -+} -+ -+static int nrf52_code_flash_write(struct flash_bank *bank, -+ struct nrf52_info *chip, -+ const uint8_t *buffer, uint32_t offset, uint32_t count) -+{ -+ int res; -+ /* Need to perform reads to fill any gaps we need to preserve in the first page, -+ before the start of buffer, or in the last page, after the end of buffer */ -+ uint32_t first_page = offset / chip->code_page_size; -+ uint32_t last_page = DIV_ROUND_UP(offset+count, chip->code_page_size); -+ -+ uint32_t first_page_offset = first_page * chip->code_page_size; -+ uint32_t last_page_offset = last_page * chip->code_page_size; -+ -+ LOG_DEBUG("Padding write from 0x%08"PRIx32"-0x%08"PRIx32" as 0x%08"PRIx32"-0x%08"PRIx32, -+ offset, offset+count, first_page_offset, last_page_offset); -+ -+ uint32_t page_cnt = last_page - first_page; -+ uint8_t buffer_to_flash[page_cnt * chip->code_page_size]; -+ -+ /* Fill in any space between start of first page and start of buffer */ -+ uint32_t pre = offset - first_page_offset; -+ if (pre > 0) { -+ res = target_read_memory(bank->target, first_page_offset, 1, pre, buffer_to_flash); -+ if (res != ERROR_OK) -+ return res; -+ } -+ -+ /* Fill in main contents of buffer */ -+ memcpy(buffer_to_flash + pre, buffer, count); -+ -+ /* Fill in any space between end of buffer and end of last page */ -+ uint32_t post = last_page_offset - (offset + count); -+ if (post > 0) { -+ /* Retrieve the full row contents from Flash */ -+ res = target_read_memory(bank->target, offset + count, 1, post, buffer_to_flash + pre + count); -+ if (res != ERROR_OK) -+ return res; -+ } -+ -+ return nrf52_write_pages(bank, first_page_offset, last_page_offset, buffer_to_flash); -+} -+ -+static int nrf52_uicr_flash_write(struct flash_bank *bank, -+ struct nrf52_info *chip, -+ const uint8_t *buffer, uint32_t offset, uint32_t count) -+{ -+ int res; -+ uint32_t nrf52_uicr_size = chip->code_page_size; -+ uint8_t uicr[nrf52_uicr_size]; -+ struct flash_sector *sector = &bank->sectors[0]; -+ -+ if ((offset + count) > nrf52_uicr_size) -+ return ERROR_FAIL; -+ -+ res = target_read_memory(bank->target, NRF52_UICR_BASE_ADDR, 1, nrf52_uicr_size, uicr); -+ -+ if (res != ERROR_OK) -+ return res; -+ -+ if (sector->is_erased != 1) { -+ res = nrf52_erase_page(bank, chip, sector); -+ if (res != ERROR_OK) -+ return res; -+ } -+ -+ memcpy(&uicr[offset], buffer, count); -+ -+ res = nrf52_nvmc_write_enable(chip); -+ if (res != ERROR_OK) -+ return res; -+ -+ res = nrf52_ll_flash_write(chip, NRF52_UICR_BASE_ADDR, uicr, nrf52_uicr_size); -+ if (res != ERROR_OK) { -+ nrf52_nvmc_read_only(chip); -+ return res; -+ } -+ -+ return nrf52_nvmc_read_only(chip); -+} -+ -+ -+static int nrf52_write(struct flash_bank *bank, const uint8_t *buffer, -+ uint32_t offset, uint32_t count) -+{ -+ struct nrf52_info *chip = bank->driver_priv; -+ assert(chip != NULL); -+ -+ return chip->bank[bank->bank_number].write(bank, chip, buffer, offset, count); -+} -+ -+ -+FLASH_BANK_COMMAND_HANDLER(nrf52_flash_bank_command) -+{ -+ static struct nrf52_info *chip; -+ -+ assert(bank != NULL); -+ -+ switch (bank->base) { -+ case NRF52_FLASH_BASE_ADDR: -+ bank->bank_number = 0; -+ break; -+ case NRF52_UICR_BASE_ADDR: -+ bank->bank_number = 1; -+ break; -+ default: -+ LOG_ERROR("Invalid bank address 0x%08" PRIx32, bank->base); -+ return ERROR_FAIL; -+ } -+ -+ if (!chip) { -+ /* Create a new chip */ -+ chip = calloc(1, sizeof(*chip)); -+ assert(chip != NULL); -+ -+ chip->target = bank->target; -+ } -+ -+ switch (bank->base) { -+ case NRF52_FLASH_BASE_ADDR: -+ chip->bank[bank->bank_number].write = nrf52_code_flash_write; -+ break; -+ case NRF52_UICR_BASE_ADDR: -+ chip->bank[bank->bank_number].write = nrf52_uicr_flash_write; -+ break; -+ } -+ -+ chip->bank[bank->bank_number].probed = false; -+ bank->driver_priv = chip; -+ -+ return ERROR_OK; -+} -+ -+COMMAND_HANDLER(nrf52_handle_mass_erase_command) -+{ -+ int res; -+ struct flash_bank *bank = NULL; -+ struct target *target = get_current_target(CMD_CTX); -+ -+ res = get_flash_bank_by_addr(target, NRF52_FLASH_BASE_ADDR, true, &bank); -+ if (res != ERROR_OK) -+ return res; -+ -+ assert(bank != NULL); -+ -+ struct nrf52_info *chip = bank->driver_priv; -+ assert(chip != NULL); -+ -+ res = nrf52_erase_all(chip); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Failed to erase the chip"); -+ nrf52_protect_check(bank); -+ return res; -+ } -+ -+ for (int i = 0; i < bank->num_sectors; i++) -+ bank->sectors[i].is_erased = 1; -+ -+ res = nrf52_protect_check(bank); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Failed to check chip's write protection"); -+ return res; -+ } -+ -+ res = get_flash_bank_by_addr(target, NRF52_UICR_BASE_ADDR, true, &bank); -+ if (res != ERROR_OK) -+ return res; -+ -+ bank->sectors[0].is_erased = 1; -+ -+ return ERROR_OK; -+} -+ -+static int nrf52_info(struct flash_bank *bank, char *buf, int buf_size) -+{ -+ int res; -+ uint32_t ficr[2]; -+ struct nrf52_info *chip = bank->driver_priv; -+ assert(chip != NULL); -+ -+ res = target_read_u32(chip->target, NRF52_FICR_CODEPAGESIZE_ADDR, &ficr[0]); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Couldn't read NVMC_READY register"); -+ return res; -+ } -+ -+ res = target_read_u32(chip->target, NRF52_FICR_CODESIZE_ADDR, &ficr[1]); -+ if (res != ERROR_OK) { -+ LOG_ERROR("Couldn't read NVMC_READY register"); -+ return res; -+ } -+ -+ snprintf(buf, buf_size, -+ "\n--------nRF52 Series Device--------\n\n" -+ "\n[factory information control block]\n" -+ "code page size: %"PRIu32"B\n" -+ "code memory size: %"PRIu32"kB\n", -+ ficr[0], -+ (ficr[1] * ficr[0]) / 1024); -+ -+ return ERROR_OK; -+} -+ -+static const struct command_registration nrf52_exec_command_handlers[] = { -+ { -+ .name = "mass_erase", -+ .handler = nrf52_handle_mass_erase_command, -+ .mode = COMMAND_EXEC, -+ .help = "Erase all flash contents of the chip.", -+ }, -+ COMMAND_REGISTRATION_DONE -+}; -+ -+static const struct command_registration nrf52_command_handlers[] = { -+ { -+ .name = "nrf52", -+ .mode = COMMAND_ANY, -+ .help = "nrf52 flash command group", -+ .usage = "", -+ .chain = nrf52_exec_command_handlers, -+ }, -+ COMMAND_REGISTRATION_DONE -+}; -+ -+struct flash_driver nrf52_flash = { -+ .name = "nrf52", -+ .commands = nrf52_command_handlers, -+ .flash_bank_command = nrf52_flash_bank_command, -+ .info = nrf52_info, -+ .erase = nrf52_erase, -+ .protect = nrf52_protect, -+ .write = nrf52_write, -+ .read = default_flash_read, -+ .probe = nrf52_probe, -+ .auto_probe = nrf52_auto_probe, -+ .erase_check = default_flash_blank_check, -+ .protect_check = nrf52_protect_check, -+}; -diff --git a/tcl/target/nrf52.cfg b/tcl/target/nrf52.cfg -index c1cbf1a..41a22ff 100644 ---- a/tcl/target/nrf52.cfg -+++ b/tcl/target/nrf52.cfg -@@ -10,6 +10,13 @@ if { [info exists CHIPNAME] } { - set _CHIPNAME nrf52 - } - -+# Work-area is a space in RAM used for flash programming, by default use 16kB. -+if { [info exists WORKAREASIZE] } { -+ set _WORKAREASIZE $WORKAREASIZE -+} else { -+ set _WORKAREASIZE 0x4000 -+} -+ - if { [info exists CPUTAPID] } { - set _CPUTAPID $CPUTAPID - } else { -@@ -22,7 +29,15 @@ set _TARGETNAME $_CHIPNAME.cpu - target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME - - adapter_khz 10000 -+$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 - - if { ![using_hla] } { - cortex_m reset_config sysresetreq - } -+ -+flash bank $_CHIPNAME.flash nrf52 0x00000000 0 1 1 $_TARGETNAME -+flash bank $_CHIPNAME.uicr nrf52 0x10001000 0 1 1 $_TARGETNAME -+ -+adapter_khz 1000 -+ -+$_TARGETNAME configure -event reset-end {} -- cgit v1.2.3 From 3b026eb3b1dd92c653d1a640b1280b96cfea3084 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 23 Oct 2020 09:34:50 -0400 Subject: Revert "gnu: u-boot: Update to 2020.10." This reverts commit fe6067fc248673d6509b557ff010778f7762382f. This commit broke u-boot-tools. --- gnu/packages/bootloaders.scm | 4 ++-- gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 05380fc42b..d1de5cea4e 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -446,7 +446,7 @@ (define-public dtc (define u-boot (package (name "u-boot") - (version "2020.10") + (version "2020.07") (source (origin (method url-fetch) (uri (string-append @@ -454,7 +454,7 @@ (define u-boot "u-boot-" version ".tar.bz2")) (sha256 (base32 - "08m6f1bh4pdcqbxf983qdb66ccd5vak5cbzc114yf3jwq2yinj0d")))) + "0sjzy262x93aaqd6z24ziaq19xjjjk5f577ivf768vmvwsgbzxf1")))) (native-inputs `(("bc" ,bc) ("bison" ,bison) diff --git a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch index d6c1987718..29dec4f5e9 100644 --- a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch +++ b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch @@ -32,9 +32,9 @@ Index: u-boot/configs/sifive_fu540_defconfig =================================================================== --- u-boot.orig/configs/sifive_fu540_defconfig +++ u-boot/configs/sifive_fu540_defconfig -@@ -27,3 +27,5 @@ CONFIG_SPL_DM_SEQ_ALIAS=y - CONFIG_SPL_CLK=y +@@ -12,3 +12,5 @@ CONFIG_DISPLAY_BOARDINFO=y + CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" + CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM_MTD=y - CONFIG_DM_RESET=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" -- cgit v1.2.3 From d24e37f36e2a89c0613bf5064e59b9236bca2ae1 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Fri, 23 Oct 2020 17:41:55 +0300 Subject: gnu: rcs: Update to 5.10.0. * gnu/packages/version-control.scm (rcs): Update to 5.10.0. [source]: Update patches. [arguments]: Remove field. * gnu/packages/patches/rcs-5.9.4-noreturn.patch: Remove file. * gnu/packages/patches/rcs-5.10.0-no-stdin.patch: Add file. * gnu/local.mk (dist_patch_DATA): Register changes. --- gnu/local.mk | 2 +- gnu/packages/patches/rcs-5.10.0-no-stdin.patch | 57 ++++++++++++++++ gnu/packages/patches/rcs-5.9.4-noreturn.patch | 94 -------------------------- gnu/packages/version-control.scm | 15 +--- 4 files changed, 61 insertions(+), 107 deletions(-) create mode 100644 gnu/packages/patches/rcs-5.10.0-no-stdin.patch delete mode 100644 gnu/packages/patches/rcs-5.9.4-noreturn.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 31385d0db6..1a01360d72 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1542,7 +1542,7 @@ dist_patch_DATA = \ %D%/packages/patches/raptor2-heap-overflow.patch \ %D%/packages/patches/ratpoints-sturm_and_rp_private.patch \ %D%/packages/patches/ratpoison-shell.patch \ - %D%/packages/patches/rcs-5.9.4-noreturn.patch \ + %D%/packages/patches/rcs-5.10.0-no-stdin.patch \ %D%/packages/patches/rct-add-missing-headers.patch \ %D%/packages/patches/readline-link-ncurses.patch \ %D%/packages/patches/readline-6.2-CVE-2014-2524.patch \ diff --git a/gnu/packages/patches/rcs-5.10.0-no-stdin.patch b/gnu/packages/patches/rcs-5.10.0-no-stdin.patch new file mode 100644 index 0000000000..56edfe7b65 --- /dev/null +++ b/gnu/packages/patches/rcs-5.10.0-no-stdin.patch @@ -0,0 +1,57 @@ +http://git.savannah.gnu.org/cgit/rcs.git/patch/?id=8883c4f5a29be18e9ea09bd27a7b660830de45bb + + +From 8883c4f5a29be18e9ea09bd27a7b660830de45bb Mon Sep 17 00:00:00 2001 +From: Thien-Thi Nguyen +Date: Fri, 23 Oct 2020 09:23:49 -0400 +Subject: [v] Don't test signal handling if stdin not ok. + + + +* tests/t632: If stdin is not open and connected to +a tty, skip the signal handling portion of the test. +--- + tests/ChangeLog | 9 +++++++++ + tests/t632 | 9 +++++++++ + 2 files changed, 18 insertions(+) + +diff --git a/tests/ChangeLog b/tests/ChangeLog +index c3715c0..0565058 100644 +--- a/tests/ChangeLog ++++ b/tests/ChangeLog +@@ -1,3 +1,12 @@ ++2020-10-23 Thien-Thi Nguyen ++ ++ [v] Don't test signal handling if stdin not ok. ++ ++ ++ ++ * t632: If stdin is not open and connected to ++ a tty, skip the signal handling portion of the test. ++ + 2020-10-20 Thien-Thi Nguyen + + Release: 5.10.0 +diff --git a/tests/t632 b/tests/t632 +index df6acc9..677ec8c 100644 +--- a/tests/t632 ++++ b/tests/t632 +@@ -40,6 +40,15 @@ echo | co -l -I $w \ + # (This is skipped if GNU coreutils timeout(1) is not available.) + ## + ++# ++# The timeout test needs co(1) to block on input. ++# If stdin is not open and connected to a tty, skip out. ++if test -t 0 ; then ++ echo STDIN OK ++else ++ exit 0 ++fi ++ + # TODO: Don't be lame! Pick one: + # (a) Mimic timeout(1) w/ sh commands. + # (b) Incorporate heart of timeout(1) into ./btdt and use that. +-- +cgit v1.2.1 + diff --git a/gnu/packages/patches/rcs-5.9.4-noreturn.patch b/gnu/packages/patches/rcs-5.9.4-noreturn.patch deleted file mode 100644 index 0c0c044ed5..0000000000 --- a/gnu/packages/patches/rcs-5.9.4-noreturn.patch +++ /dev/null @@ -1,94 +0,0 @@ -Builds with GCC-5 failed due to misplaced `_Noreturn (__attribute__((noreturn)))` -statement. - -Patch copied from upstream source repository: - -http://git.savannah.gnu.org/cgit/rcs.git/commit/?h=p&id=260704a9164dd34cf7128d6b1e88075ffa3be054 - -Upstream bug URL: - -https://savannah.gnu.org/bugs/?49568 - -commit 260704a9164dd34cf7128d6b1e88075ffa3be054 -Author: Thien-Thi Nguyen -Date: Thu Jun 18 21:25:53 2015 +0200 - - [C slog] Move ‘exiting’ to beginning of func decl. - - Apparently, ‘gcc --std=c11’ does not abide the ‘exiting’ - attribute appearing at the end of the func decl. - Reported by Romain Francoise. - See also . - - * src/b-complain.h (generic_fatal, fatal_syntax, fatal_sys) - * src/b-fb.h (Ierror, Oerror) - * src/base.h (unexpected_EOF, thank_you_and_goodnight): - Move ‘exiting’ attribute to beginning of func decl. - -diff --git a/src/b-complain.h b/src/b-complain.h -index 0ffd157..ea0ffc5 100644 ---- a/src/b-complain.h -+++ b/src/b-complain.h -@@ -32,12 +32,14 @@ extern void generic_warn (char const *who, char const *fmt, ...) - printf_string (2, 3); - extern void generic_error (char const *who, char const *fmt, ...) - printf_string (2, 3); -+exiting - extern void generic_fatal (char const *who, char const *fmt, ...) -- printf_string (2, 3) exiting; -+ printf_string (2, 3); -+exiting - extern void fatal_syntax (size_t lno, char const *fmt, ...) -- printf_string (2, 3) exiting; --extern void fatal_sys (char const *who) -- exiting; -+ printf_string (2, 3); -+exiting -+extern void fatal_sys (char const *who); - - /* Idioms. Here, prefix P stands for "program" (general operation); - M for "manifestation"; R for "repository". */ -diff --git a/src/b-fb.h b/src/b-fb.h -index c9850e7..bf5eaf8 100644 ---- a/src/b-fb.h -+++ b/src/b-fb.h -@@ -21,9 +21,11 @@ - */ - - extern int change_mode (int fd, mode_t mode); --extern void Ierror (void) exiting; -+exiting -+extern void Ierror (void); - extern void testIerror (FILE *f); --extern void Oerror (void) exiting; -+exiting -+extern void Oerror (void); - extern void testOerror (FILE *o); - extern FILE *fopen_safer (char const *filename, char const *type); - extern void Ozclose (FILE **p); -diff --git a/src/base.h b/src/base.h -index 163ee09..5e7a9f8 100644 ---- a/src/base.h -+++ b/src/base.h -@@ -755,8 +755,8 @@ int dorewrite (bool lockflag, int changed); - int donerewrite (int changed, time_t newRCStime); - void ORCSclose (void); - void ORCSerror (void); --void unexpected_EOF (void) -- exiting; -+exiting -+void unexpected_EOF (void); - void initdiffcmd (struct diffcmd *dc); - int getdiffcmd (struct fro *finfile, bool delimiter, - FILE *foutfile, struct diffcmd *dc); -@@ -831,8 +831,8 @@ char const *date2str (char const date[datesize], - char datebuf[datesize + zonelenmax]); - - /* rcsutil */ --void thank_you_and_goodnight (int const how) -- exiting; -+exiting -+void thank_you_and_goodnight (int const how); - /* These are for ‘thank_you_and_goodnight’. */ - #define TYAG_ORCSERROR (1 << 3) - #define TYAG_DIRTMPUNLINK (1 << 2) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index fe61bc8fce..0e0e59d1a2 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -1799,26 +1799,17 @@ (define-public subversion (define-public rcs (package (name "rcs") - (version "5.9.4") + (version "5.10.0") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/rcs/rcs-" version ".tar.xz")) (sha256 (base32 - "1zsx7bb0rgvvvisiy4zlixf56ay8wbd9qqqcp1a1g0m1gl6mlg86")) - (patches (search-patches "rcs-5.9.4-noreturn.patch")))) + "1if5pa4iip2p70gljm54nggfdnsfjxa4cqz8fpj07lvsijary39s")) + (patches (search-patches "rcs-5.10.0-no-stdin.patch")))) (build-system gnu-build-system) (native-inputs `(("ed" ,ed))) - (arguments - `(#:phases (modify-phases %standard-phases - (add-before 'check 'disable-t810 - ;; See https://savannah.gnu.org/bugs/index.php?52288 - ;; Back-porting the fix is non-trivial, so disable for now. - (lambda _ - (substitute* "tests/Makefile" - ((" t810 \\\\\n") "")) - #t))))) (home-page "https://www.gnu.org/software/rcs/") (synopsis "Per-file local revision control system") (description -- cgit v1.2.3 From 26c5e5af701b82b198c7dabf75e8c96937418e1a Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sun, 18 Oct 2020 15:00:55 -0700 Subject: gnu: u-boot: Update to 2020.10. * gnu/packages/bootloaders (u-boot): Update to 2020.10. * gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch: Refresh patch. --- gnu/packages/bootloaders.scm | 4 ++-- gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index d1de5cea4e..05380fc42b 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -446,7 +446,7 @@ (define-public dtc (define u-boot (package (name "u-boot") - (version "2020.07") + (version "2020.10") (source (origin (method url-fetch) (uri (string-append @@ -454,7 +454,7 @@ (define u-boot "u-boot-" version ".tar.bz2")) (sha256 (base32 - "0sjzy262x93aaqd6z24ziaq19xjjjk5f577ivf768vmvwsgbzxf1")))) + "08m6f1bh4pdcqbxf983qdb66ccd5vak5cbzc114yf3jwq2yinj0d")))) (native-inputs `(("bc" ,bc) ("bison" ,bison) diff --git a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch index 29dec4f5e9..d6c1987718 100644 --- a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch +++ b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch @@ -32,9 +32,9 @@ Index: u-boot/configs/sifive_fu540_defconfig =================================================================== --- u-boot.orig/configs/sifive_fu540_defconfig +++ u-boot/configs/sifive_fu540_defconfig -@@ -12,3 +12,5 @@ CONFIG_DISPLAY_BOARDINFO=y - CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" - CONFIG_SYS_RELOC_GD_ENV_ADDR=y +@@ -27,3 +27,5 @@ CONFIG_SPL_DM_SEQ_ALIAS=y + CONFIG_SPL_CLK=y CONFIG_DM_MTD=y + CONFIG_DM_RESET=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" -- cgit v1.2.3 From a9291a28b233dba20a523da679bb446643abf977 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 25 Oct 2020 10:20:55 +0000 Subject: gnu: netcdf: Update to 4.7.4. This will fix an issue building qgis. * gnu/packages/maths.scm (netcdf): Update to 4.7.4. [source]: Remove the netcdf-tst_h_par.patch, also change the naming of the source tarball, as the name seems to have changed for recent releases. [inputs]: Update hdf5 and add curl. * gnu/packages/patches/netcdf-tst_h_par.patch: Delete. * gnu/local.mk (dist_patch_DATA): Remove deleted patch. --- gnu/local.mk | 1 - gnu/packages/maths.scm | 18 ++++++++---------- gnu/packages/patches/netcdf-date-time.patch | 6 +++--- gnu/packages/patches/netcdf-tst_h_par.patch | 21 --------------------- 4 files changed, 11 insertions(+), 35 deletions(-) delete mode 100644 gnu/packages/patches/netcdf-tst_h_par.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 1a01360d72..0ada3b727b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1355,7 +1355,6 @@ dist_patch_DATA = \ %D%/packages/patches/m4-gnulib-libio.patch \ %D%/packages/patches/ncompress-fix-softlinks.patch \ %D%/packages/patches/netcdf-date-time.patch \ - %D%/packages/patches/netcdf-tst_h_par.patch \ %D%/packages/patches/netpbm-CVE-2017-2586.patch \ %D%/packages/patches/netpbm-CVE-2017-2587.patch \ %D%/packages/patches/netsurf-message-timestamp.patch \ diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index f7565dd885..d2631501aa 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1538,17 +1538,17 @@ (define-public itpp (define-public netcdf (package (name "netcdf") - (version "4.4.1.1") + (version "4.7.4") (source (origin (method url-fetch) - (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/" - "netcdf-" version ".tar.gz")) + (uri (string-append + "https://www.unidata.ucar.edu/downloads/netcdf/ftp/" + "netcdf-c-" version ".tar.gz")) (sha256 (base32 - "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d")) - (patches (search-patches "netcdf-date-time.patch" - "netcdf-tst_h_par.patch")))) + "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf")) + (patches (search-patches "netcdf-date-time.patch")))) (build-system gnu-build-system) (native-inputs `(("m4" ,m4) @@ -1556,10 +1556,8 @@ (define-public netcdf ("graphviz" ,graphviz))) (inputs `(("hdf4" ,hdf4-alt) - - ;; XXX: The 'tst_nccopy4.sh' test fails when using hdf5-1.10. - ("hdf5" ,hdf5-1.8) - + ("hdf5" ,hdf5) + ("curl" ,curl) ("zlib" ,zlib) ("libjpeg" ,libjpeg-turbo))) (arguments diff --git a/gnu/packages/patches/netcdf-date-time.patch b/gnu/packages/patches/netcdf-date-time.patch index a4e7925aa1..0bdfc55299 100644 --- a/gnu/packages/patches/netcdf-date-time.patch +++ b/gnu/packages/patches/netcdf-date-time.patch @@ -3,9 +3,9 @@ @@ -13,7 +13,7 @@ #endif - /* Tell the user the version of netCDF. */ + /** @internal The version string for the library, used by + * nc_inq_libvers(). */ -static const char nc_libvers[] = PACKAGE_VERSION " of "__DATE__" "__TIME__" $"; -+static const char nc_libvers[] = PACKAGE_VERSION" $"; ++static const char nc_libvers[] = PACKAGE_VERSION " $"; /** - \defgroup lib_version Library Version diff --git a/gnu/packages/patches/netcdf-tst_h_par.patch b/gnu/packages/patches/netcdf-tst_h_par.patch deleted file mode 100644 index ac14a4c0a2..0000000000 --- a/gnu/packages/patches/netcdf-tst_h_par.patch +++ /dev/null @@ -1,21 +0,0 @@ -From a83702834938b23cc2e843589aa223e2024a7e6f Mon Sep 17 00:00:00 2001 -From: Orion Poplawski -Date: Tue, 29 Nov 2016 11:48:01 -0700 -Subject: [PATCH] Add missing #include "err_macros.h" to tst_h_par.c - ---- - h5_test/tst_h_par.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/h5_test/tst_h_par.c b/h5_test/tst_h_par.c -index c3da7f4..a419d55 100644 ---- a/h5_test/tst_h_par.c -+++ b/h5_test/tst_h_par.c -@@ -11,6 +11,7 @@ - $Id: tst_h_par.c,v 1.15 2010/05/25 13:53:04 ed Exp $ - */ - #include -+#include "err_macros.h" - #include - - /* Defining USE_MPE causes the MPE trace library to be used (and you -- cgit v1.2.3 From e33c4286ebcc0dcc79985a32c6c2d5ad623d1fbe Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 26 Oct 2020 20:47:29 +0100 Subject: gnu: gdb: Add version 10.1. * gnu/packages/gdb.scm (gdb-9.2): Rename to... (gdb-10): ... this, and upgrade to 10.1. [inputs]: New field. (gdb-minimal): Adjust accordingly. * gnu/packages/patches/gdb-hurd.patch: Remove. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/gdb.scm | 12 ++++--- gnu/packages/patches/gdb-hurd.patch | 69 ------------------------------------- 3 files changed, 7 insertions(+), 75 deletions(-) delete mode 100644 gnu/packages/patches/gdb-hurd.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 0ada3b727b..220b7bd21d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1024,7 +1024,6 @@ dist_patch_DATA = \ %D%/packages/patches/gcc-9-strmov-store-file-names.patch \ %D%/packages/patches/gd-fix-tests-on-i686.patch \ %D%/packages/patches/gd-brect-bounds.patch \ - %D%/packages/patches/gdb-hurd.patch \ %D%/packages/patches/gdm-default-session.patch \ %D%/packages/patches/genimage-signedness.patch \ %D%/packages/patches/geoclue-config.patch \ diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm index 2eecfb581d..c01c65ce20 100644 --- a/gnu/packages/gdb.scm +++ b/gnu/packages/gdb.scm @@ -152,22 +152,24 @@ (define-public gdb ;; enough to avoid massive rebuilds. gdb-9.1) -(define-public gdb-9.2 +(define-public gdb-10 (package (inherit gdb) - (version "9.2") + (version "10.1") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/gdb/gdb-" version ".tar.xz")) - (patches (search-patches "gdb-hurd.patch")) (sha256 (base32 - "0mf5fn8v937qwnal4ykn3ji1y2sxk0fa1yfqi679hxmpg6pdf31n")))))) + "1h32dckz1y8fnyxh22iyw8h3hnhxr79v1ng85px3ljn1xv71wbzq")))) + (inputs + `(("guile" ,guile-3.0) + ,@(alist-delete "guile" (package-inputs gdb)))))) (define-public gdb-minimal (package/inherit - gdb-9.2 + gdb-10 (name "gdb-minimal") (inputs (fold alist-delete (package-inputs gdb) '("libxml2" "ncurses" "python-wrapper" "source-highlight"))))) diff --git a/gnu/packages/patches/gdb-hurd.patch b/gnu/packages/patches/gdb-hurd.patch deleted file mode 100644 index 0af8d4dc28..0000000000 --- a/gnu/packages/patches/gdb-hurd.patch +++ /dev/null @@ -1,69 +0,0 @@ -Taken from upstream, removed ChangeLog. - -From 6930bffe3373690b3431d6291f9f7c116d6a1ec4 Mon Sep 17 00:00:00 2001 -From: Samuel Thibault -Date: Sat, 30 May 2020 18:35:59 +0000 -Subject: [PATCH] hurd: fix gnu_debug_flag type -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes - -../../gdb/gnu-nat.c:96:6: error: conflicting declaration ‘bool gnu_debug_flag’ - 96 | bool gnu_debug_flag = false; -../../gdb/gnu-nat.c: In function ‘void _initialize_gnu_nat()’: -../../gdb/gnu-nat.c:3511:7: error: cannot - -gdb/ChangeLog: - - * gnu-nat.h (gnu_debug_flag): Set type to bool. ---- - gdb/ChangeLog | 4 ++++ - gdb/gnu-nat.h | 2 +- - 2 files changed, 5 insertions(+), 1 deletion(-) - -diff --git a/gdb/gnu-nat.h b/gdb/gnu-nat.h -index 77c57817b2..766f716587 100644 ---- a/gdb/gnu-nat.h -+++ b/gdb/gnu-nat.h -@@ -111,7 +111,7 @@ extern char *proc_string (struct proc *proc); - __proc_pid (__proc), __proc->tid, \ - host_address_to_string (__proc) , ##args); } while (0) - --extern int gnu_debug_flag; -+extern bool gnu_debug_flag; - - #define debug(msg, args...) \ - do { if (gnu_debug_flag) \ --- -Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org -Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com - -commit 366f550a593c7e6bae3699a4b6d65fe937af5603 -Author: Samuel Thibault -Date: Sat May 30 18:41:30 2020 +0000 - - hurd: add missing include - - Fixes - - ../../gdb/gnu-nat.c:2522:14: error: ‘target_gdbarch’ was not declared in this scope; did you mean ‘target_detach’? - 2522 | paddress (target_gdbarch (), memaddr), pulongest (len), - - gdb/Changelog: - - * gnu-nat.c: Include "gdbarch.h". - -diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c -index 3b438a9a43..9b93488b41 100644 ---- a/gdb/gnu-nat.c -+++ b/gdb/gnu-nat.c -@@ -64,6 +64,7 @@ extern "C" - #include "language.h" - #include "target.h" - #include "gdbsupport/gdb_wait.h" -+#include "gdbarch.h" - #include "gdbcmd.h" - #include "gdbcore.h" - #include "gdbthread.h" -- cgit v1.2.3 From d1ecb3bded7ddbbccd9a8720a9aa8cf10809fa5e Mon Sep 17 00:00:00 2001 From: Malte Frank Gerdes Date: Fri, 23 Oct 2020 15:11:52 +0200 Subject: gnu: benchmark: Update to 1.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/benchmark.scm (benchmark): Update to 1.5.2 [native-inputs]: Add googletest-source. [arguments]: Add phase 'unpack-googletest. * gnu/packages/patches/benchmark-unbundle-googletst.patch: Delete file. * gnu/packages/local.mk: Remove benchmark-unbundle-googletest.patch. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 - gnu/packages/benchmark.scm | 21 +++++-- .../patches/benchmark-unbundle-googletest.patch | 69 ---------------------- 3 files changed, 15 insertions(+), 76 deletions(-) delete mode 100644 gnu/packages/patches/benchmark-unbundle-googletest.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 220b7bd21d..aae8e7edcc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -825,7 +825,6 @@ dist_patch_DATA = \ %D%/packages/patches/beets-werkzeug-compat.patch \ %D%/packages/patches/behave-skip-a-couple-of-tests.patch \ %D%/packages/patches/beignet-correct-file-names.patch \ - %D%/packages/patches/benchmark-unbundle-googletest.patch \ %D%/packages/patches/biber-fix-encoding-write.patch \ %D%/packages/patches/biber-sortinithash.patch \ %D%/packages/patches/bidiv-update-fribidi.patch \ diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index f9648b5f7c..8a8309ce52 100644 --- a/gnu/packages/benchmark.scm +++ b/gnu/packages/benchmark.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2019 Gábor Boskovits ;;; Copyright © 2019 Ludovic Courtès ;;; Copyright © 2020 Vincent Legoll +;;; Copyright © 2020 malte Frank Gerdes ;;; ;;; This file is part of GNU Guix. ;;; @@ -213,7 +214,7 @@ (define-public multitime (define-public benchmark (package (name "benchmark") - (version "1.5.0") + (version "1.5.2") (source (origin (method git-fetch) (uri (git-reference @@ -222,16 +223,24 @@ (define-public benchmark (file-name (git-file-name name version)) (sha256 (base32 - "0r9dbg4cbk47gwmayys31a83m3y67k0kh1f6pl8i869rbd609ndh")) - (patches (search-patches "benchmark-unbundle-googletest.patch")))) + "13rxagpzw6bal6ajlmrxlh9kgfvcixn6j734b2bvfqz7lch8n0pa")))) (build-system cmake-build-system) (native-inputs - `(("googletest" ,googletest))) + `(("googletest-source" ,(package-source googletest)) + ("googletest" ,googletest))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'unpack-googletest + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively (assoc-ref inputs "googletest-source") + "googletest") + #t))))) (home-page "https://github.com/google/benchmark") (synopsis "Microbenchmark support library") (description - "Benchmark is a library to benchmark code snippets, -similar to unit tests.") + "Benchmark is a library to benchmark code snippets, similar to unit +tests.") (license license:asl2.0))) (define-public bonnie++ diff --git a/gnu/packages/patches/benchmark-unbundle-googletest.patch b/gnu/packages/patches/benchmark-unbundle-googletest.patch deleted file mode 100644 index 4dce8f59f1..0000000000 --- a/gnu/packages/patches/benchmark-unbundle-googletest.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 5eb306618196ea78b8c9390e22ea2edce20760fe Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= -Date: Fri, 14 Jun 2019 22:15:49 +0200 -Subject: [PATCH] Remove googletest lookup from build system. - ---- - cmake/GoogleTest.cmake | 18 +++++++++--------- - cmake/GoogleTest.cmake.in | 12 ++++++------ - 2 files changed, 15 insertions(+), 15 deletions(-) - -diff --git a/cmake/GoogleTest.cmake b/cmake/GoogleTest.cmake -index fb7c6be..a6c473b 100644 ---- a/cmake/GoogleTest.cmake -+++ b/cmake/GoogleTest.cmake -@@ -27,15 +27,15 @@ endif() - # settings on Windows - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - --include(${GOOGLETEST_PREFIX}/googletest-paths.cmake) -+#include(${GOOGLETEST_PREFIX}/googletest-paths.cmake) - - # Add googletest directly to our build. This defines - # the gtest and gtest_main targets. --add_subdirectory(${GOOGLETEST_SOURCE_DIR} -- ${GOOGLETEST_BINARY_DIR} -- EXCLUDE_FROM_ALL) -- --set_target_properties(gtest PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $) --set_target_properties(gtest_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $) --set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $) --set_target_properties(gmock_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $) -+#add_subdirectory(${GOOGLETEST_SOURCE_DIR} -+# ${GOOGLETEST_BINARY_DIR} -+# EXCLUDE_FROM_ALL) -+ -+#set_target_properties(gtest PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $) -+#set_target_properties(gtest_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $) -+#set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $) -+#set_target_properties(gmock_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $) -diff --git a/cmake/GoogleTest.cmake.in b/cmake/GoogleTest.cmake.in -index 28818ee..13b0888 100644 ---- a/cmake/GoogleTest.cmake.in -+++ b/cmake/GoogleTest.cmake.in -@@ -31,7 +31,7 @@ if(EXISTS "${GOOGLETEST_PATH}" AND IS_DIRECTORY "${GOOGLETEST_PATH}" - ) - else() - if(NOT ALLOW_DOWNLOADING_GOOGLETEST) -- message(SEND_ERROR "Did not find Google Test sources! Either pass correct path in GOOGLETEST_PATH, or enable ALLOW_DOWNLOADING_GOOGLETEST, or disable BENCHMARK_ENABLE_GTEST_TESTS / BENCHMARK_ENABLE_TESTING.") -+ message(WARNING "Did not find Google Test sources! Either pass correct path in GOOGLETEST_PATH, or enable ALLOW_DOWNLOADING_GOOGLETEST, or disable BENCHMARK_ENABLE_GTEST_TESTS / BENCHMARK_ENABLE_TESTING.") - else() - message(WARNING "Did not find Google Test sources! Fetching from web...") - ExternalProject_Add( -@@ -51,8 +51,8 @@ else() - endif() - endif() - --ExternalProject_Get_Property(googletest SOURCE_DIR BINARY_DIR) --file(WRITE googletest-paths.cmake --"set(GOOGLETEST_SOURCE_DIR \"${SOURCE_DIR}\") --set(GOOGLETEST_BINARY_DIR \"${BINARY_DIR}\") --") -+#ExternalProject_Get_Property(googletest SOURCE_DIR BINARY_DIR) -+#file(WRITE googletest-paths.cmake -+#"set(GOOGLETEST_SOURCE_DIR \"${SOURCE_DIR}\") -+#set(GOOGLETEST_BINARY_DIR \"${BINARY_DIR}\") -+#") --- -2.22.0 - -- cgit v1.2.3 From ab96f929c6979e9476181ab73256f993674c9a55 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 26 Oct 2020 22:49:29 +0100 Subject: gnu: python-robotframework: Shorten patch file name. * gnu/packages/patches/python-robotframework-honor-source-date-epoch.patch: Rename to... * gnu/packages/patches/python-robotframework-source-date-epoch.patch: ... this. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/python-xyz.scm (python-robotframework)[source]: Likewise. --- gnu/local.mk | 2 +- ...on-robotframework-honor-source-date-epoch.patch | 62 ---------------------- .../python-robotframework-source-date-epoch.patch | 62 ++++++++++++++++++++++ gnu/packages/python-xyz.scm | 2 +- 4 files changed, 64 insertions(+), 64 deletions(-) delete mode 100644 gnu/packages/patches/python-robotframework-honor-source-date-epoch.patch create mode 100644 gnu/packages/patches/python-robotframework-source-date-epoch.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index aae8e7edcc..e9b6181c94 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1512,7 +1512,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-pycrypto-time-clock.patch \ %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \ - %D%/packages/patches/python-robotframework-honor-source-date-epoch.patch \ + %D%/packages/patches/python-robotframework-source-date-epoch.patch \ %D%/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch \ %D%/packages/patches/python2-subprocess32-disable-input-test.patch \ %D%/packages/patches/python-tinycss2-flake8-compat.patch \ diff --git a/gnu/packages/patches/python-robotframework-honor-source-date-epoch.patch b/gnu/packages/patches/python-robotframework-honor-source-date-epoch.patch deleted file mode 100644 index ccd87911d8..0000000000 --- a/gnu/packages/patches/python-robotframework-honor-source-date-epoch.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 3cc41c05fad5601c0dd1832f64a6e9efca017727 Mon Sep 17 00:00:00 2001 -From: Maxim Cournoyer -Date: Mon, 1 Apr 2019 11:36:04 -0400 -Subject: [PATCH] robottime: Honor the SOURCE_DATE_EPOCH environment variable. - -Honoring the SOURCE_DATE_EPOCH environment variable allows building -the documentation using libdoc reproducibly, by setting the generated -timestamp to a fixed value. - -For more background on reproducible builds and the SOURCE_DATE_EPOCH -environment variable, see: -https://reproducible-builds.org/specs/source-date-epoch/. - -* src/robot/utils/robottime.py: import `os'. -(TimestampCache._get_epoch): Retrieve date from SOURCE_DATE_EPOCH if -it is defined, otherwise from time.time(). -* utest/output/test_logger.py (TestLogger.test_write_to_one_logger): -Check for the existance of a timestamp attribute instead of checking -for its content as the later is easy to break when using the -SOURCE_DATE_EPOCH environment variable. ---- - src/robot/utils/robottime.py | 3 +++ - utest/output/test_logger.py | 2 +- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/robot/utils/robottime.py b/src/robot/utils/robottime.py -index 06432a4a6..91526f826 100644 ---- a/src/robot/utils/robottime.py -+++ b/src/robot/utils/robottime.py -@@ -14,6 +14,7 @@ - # limitations under the License. - - import datetime -+import os - import time - import re - -@@ -395,6 +396,8 @@ class TimestampCache(object): - - # Seam for mocking - def _get_epoch(self): -+ if os.getenv('SOURCE_DATE_EPOCH'): -+ return float(os.getenv('SOURCE_DATE_EPOCH')) - return time.time() - - def _use_cache(self, secs, *separators): -diff --git a/utest/output/test_logger.py b/utest/output/test_logger.py -index 92fe6d77d..e980227aa 100644 ---- a/utest/output/test_logger.py -+++ b/utest/output/test_logger.py -@@ -46,7 +46,7 @@ class TestLogger(unittest.TestCase): - logger = LoggerMock(('Hello, world!', 'INFO')) - self.logger.register_logger(logger) - self.logger.write('Hello, world!', 'INFO') -- assert_true(logger.msg.timestamp.startswith('20')) -+ assert_true(hasattr(logger.msg, 'timestamp')) - - def test_write_to_one_logger_with_trace_level(self): - logger = LoggerMock(('expected message', 'TRACE')) --- -2.20.1 - diff --git a/gnu/packages/patches/python-robotframework-source-date-epoch.patch b/gnu/packages/patches/python-robotframework-source-date-epoch.patch new file mode 100644 index 0000000000..ccd87911d8 --- /dev/null +++ b/gnu/packages/patches/python-robotframework-source-date-epoch.patch @@ -0,0 +1,62 @@ +From 3cc41c05fad5601c0dd1832f64a6e9efca017727 Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer +Date: Mon, 1 Apr 2019 11:36:04 -0400 +Subject: [PATCH] robottime: Honor the SOURCE_DATE_EPOCH environment variable. + +Honoring the SOURCE_DATE_EPOCH environment variable allows building +the documentation using libdoc reproducibly, by setting the generated +timestamp to a fixed value. + +For more background on reproducible builds and the SOURCE_DATE_EPOCH +environment variable, see: +https://reproducible-builds.org/specs/source-date-epoch/. + +* src/robot/utils/robottime.py: import `os'. +(TimestampCache._get_epoch): Retrieve date from SOURCE_DATE_EPOCH if +it is defined, otherwise from time.time(). +* utest/output/test_logger.py (TestLogger.test_write_to_one_logger): +Check for the existance of a timestamp attribute instead of checking +for its content as the later is easy to break when using the +SOURCE_DATE_EPOCH environment variable. +--- + src/robot/utils/robottime.py | 3 +++ + utest/output/test_logger.py | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/robot/utils/robottime.py b/src/robot/utils/robottime.py +index 06432a4a6..91526f826 100644 +--- a/src/robot/utils/robottime.py ++++ b/src/robot/utils/robottime.py +@@ -14,6 +14,7 @@ + # limitations under the License. + + import datetime ++import os + import time + import re + +@@ -395,6 +396,8 @@ class TimestampCache(object): + + # Seam for mocking + def _get_epoch(self): ++ if os.getenv('SOURCE_DATE_EPOCH'): ++ return float(os.getenv('SOURCE_DATE_EPOCH')) + return time.time() + + def _use_cache(self, secs, *separators): +diff --git a/utest/output/test_logger.py b/utest/output/test_logger.py +index 92fe6d77d..e980227aa 100644 +--- a/utest/output/test_logger.py ++++ b/utest/output/test_logger.py +@@ -46,7 +46,7 @@ class TestLogger(unittest.TestCase): + logger = LoggerMock(('Hello, world!', 'INFO')) + self.logger.register_logger(logger) + self.logger.write('Hello, world!', 'INFO') +- assert_true(logger.msg.timestamp.startswith('20')) ++ assert_true(hasattr(logger.msg, 'timestamp')) + + def test_write_to_one_logger_with_trace_level(self): + logger = LoggerMock(('expected message', 'TRACE')) +-- +2.20.1 + diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 63dadb2676..6c5ccac647 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -3684,7 +3684,7 @@ (define-public python-robotframework (sha256 (base32 "0if0h3myb9m3hgmn1phrhq8pfp89kfqsaq32vmfdjkyjdj7y59ds")) (patches (search-patches - "python-robotframework-honor-source-date-epoch.patch")))) + "python-robotframework-source-date-epoch.patch")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases -- cgit v1.2.3 From f161bd2cd7af6a0a7027a2e4ed97912027d5033d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 26 Oct 2020 22:53:30 +0100 Subject: gnu: Remove unused patch. This patch was unused since commit e4070d404d5daa71fcc83a7fecc9b58570d280c2. * gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch: Remove. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - ...ml-bisect-fix-camlp4-in-another-directory.patch | 283 --------------------- 2 files changed, 284 deletions(-) delete mode 100644 gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index e9b6181c94..c6aa58b24f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1373,7 +1373,6 @@ dist_patch_DATA = \ %D%/packages/patches/nvi-db4.patch \ %D%/packages/patches/nyacc-binary-literals.patch \ %D%/packages/patches/oath-toolkit-glibc-compat.patch \ - %D%/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch \ %D%/packages/patches/ocaml-bitstring-fix-configure.patch \ %D%/packages/patches/ocaml-CVE-2015-8869.patch \ %D%/packages/patches/ocaml-Add-a-.file-directive.patch \ diff --git a/gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch b/gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch deleted file mode 100644 index fd9a4c9401..0000000000 --- a/gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch +++ /dev/null @@ -1,283 +0,0 @@ -From bc3b353cb2f26cf10aa5c5caebddf6d3d5b1e318 Mon Sep 17 00:00:00 2001 -From: Julien Lepiller -Date: Fri, 21 Sep 2018 22:31:29 +0200 -Subject: [PATCH] fix camlp4 in another directory - ---- - Makefile | 11 ++++++----- - configure | 13 ++++++++++++- - tests/Makefile | 2 +- - tests/camlp4-comments/Makefile | 2 +- - tests/camlp4-exclude-file/Makefile | 2 +- - tests/camlp4-exclude/Makefile | 2 +- - tests/camlp4-instrument-fast/Makefile | 2 +- - tests/camlp4-instrument/Makefile | 2 +- - tests/combine-expr/Makefile | 2 +- - tests/ppx-comments/Makefile | 2 +- - tests/ppx-exclude-file/Makefile | 2 +- - tests/ppx-exclude/Makefile | 2 +- - tests/ppx-instrument-fast/Makefile | 2 +- - tests/ppx-instrument/Makefile | 2 +- - tests/report/Makefile | 2 +- - 15 files changed, 31 insertions(+), 19 deletions(-) - -diff --git a/Makefile b/Makefile -index b0980ee..6697922 100644 ---- a/Makefile -+++ b/Makefile -@@ -25,7 +25,7 @@ PATH_BUILD=$(PATH_BASE)/_build - PATH_OCAMLDOC=$(PATH_BASE)/ocamldoc - PATH_SRC=$(PATH_BASE)/src - PATH_TESTS=$(PATH_BASE)/tests --PATH_INSTALL=$(PATH_OCAML_PREFIX)/lib/ocaml/bisect -+PATH_INSTALL=$(PREFIX)/lib/ocaml/bisect - - - # DEFINITIONS -@@ -33,7 +33,8 @@ PATH_INSTALL=$(PATH_OCAML_PREFIX)/lib/ocaml/bisect - PROJECT_NAME=bisect - OCAMLBUILD=ocamlbuild - OCAMLBUILD_ENV=WARNINGS=$(WARNINGS) PATH_OCAML_PREFIX=$(PATH_OCAML_PREFIX) --OCAMLBUILD_FLAGS=-classic-display -no-links -+CAMLP4_INCLUDE=$(shell test -z $(CAMLP4_LIBDIR) || echo "-cflags -I,$(CAMLP4_LIBDIR)") -+OCAMLBUILD_FLAGS=-classic-display -no-links $(CAMLP4_INCLUDE) - MODULES_ODOCL=$(PROJECT_NAME).odocl - MODULES_MLPACK=$(PROJECT_NAME).mlpack - MODULES_MLPACK_PP=$(PROJECT_NAME)_pp.mlpack -@@ -80,11 +81,11 @@ veryclean: clean - rm -f $(PATH_OCAMLDOC)/*.html $(PATH_OCAMLDOC)/*.css - - install: FORCE -- cp $(PATH_BUILD)/src/report/report.byte $(PATH_OCAML_PREFIX)/bin/bisect-report; \ -+ cp $(PATH_BUILD)/src/report/report.byte $(PREFIX)/bin/bisect-report; \ - if [ "$(PPX)" = "TRUE" ]; then \ -- cp $(PATH_BUILD)/src/syntax/bisect_ppx.byte $(PATH_OCAML_PREFIX)/bin; \ -+ cp $(PATH_BUILD)/src/syntax/bisect_ppx.byte $(PREFIX)/bin; \ - fi; \ -- (which ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PATH_OCAML_PREFIX)/bin/bisect-report.opt || true); \ -+ (which ocamlopt && cp $(PATH_BUILD)/src/report/report.native $(PREFIX)/bin/bisect-report.opt || true); \ - if [ -x "$(PATH_OCAMLFIND)" ]; then \ - $(PATH_OCAMLFIND) query $(PROJECT_NAME) && $(PATH_OCAMLFIND) remove $(PROJECT_NAME) || true; \ - $(PATH_OCAMLFIND) install $(PROJECT_NAME) META -optional \ -diff --git a/configure b/configure -index bb7ebf4..43ef46b 100755 ---- a/configure -+++ b/configure -@@ -21,7 +21,9 @@ - # default values - ocamlbuild=`which ocamlbuild || echo '/usr/local/bin/ocamlbuild'` - bin_path=`dirname $ocamlbuild` -+prefix='' - ocaml_prefix=`dirname $bin_path` -+camlp4_prefix=`dirname $(dirname $(which camlp4of))` - ocamlfind=`which ocamlfind 2> /dev/null || echo ''` - native_dynlink='TRUE' - devel='FALSE' -@@ -32,8 +34,12 @@ ppx='FALSE' - while [ $# -gt 0 ] - do - case "$1" in -+ -prefix) -+ prefix="$2"; shift;; - -ocaml-prefix) - ocaml_prefix="$2"; shift;; -+ -camlp4-prefix) -+ camlp4_prefix="$2"; shift;; - -ocamlfind) - ocamlfind="$2"; shift;; - -no-native-dynlink) -@@ -45,7 +51,7 @@ do - -ppx) - ppx='TRUE';; - *) -- echo "usage: $0 [-ocaml-prefix ] [-ocamlfind ] [-no-native-dynlink] [-devel]"; -+ echo "usage: $0 [-prefix ] [-ocaml-prefix ] [-camlp4-prefix ] [-ocamlfind ] [-no-native-dynlink] [-devel]"; - exit 1;; - esac - shift -@@ -57,6 +63,9 @@ if [ "$no_camlp4" = "TRUE" -a "$ppx" = "FALSE" ]; then - exit 1 - fi - -+# prefix default value -+test -z $prefix && prefix=$ocaml_prefix -+ - # make options - make_quiet=`make -f - < Makefile.config -+echo "PREFIX=$prefix" >> Makefile.config - echo "PATH_OCAML_PREFIX=$ocaml_prefix" >> Makefile.config -+echo "PATH_CAMLP4_PREFIX=$camlp4_prefix" >> Makefile.config - echo "PATH_OCAMLFIND=$ocamlfind" >> Makefile.config - echo "NATIVE_DYNLINK=$native_dynlink" >> Makefile.config - echo "WARNINGS=$devel" >> Makefile.config -diff --git a/tests/Makefile b/tests/Makefile -index 1aba27f..9642323 100644 ---- a/tests/Makefile -+++ b/tests/Makefile -@@ -41,7 +41,7 @@ one: FORCE - else \ - echo "Running tests for '$(NAME)'..." | tee -a _log; \ - (cd $(NAME) && \ -- $(MAKE) PATH_OCAML_BIN=$(PATH_OCAML_PREFIX)/bin \ -+ $(MAKE) PATH_OCAML_BIN=$(PATH_OCAML_PREFIX)/bin PATH_CAMLP4_PREFIX=$(PATH_CAMLP4_PREFIX) \ - COMPILER=ocamlc EXECUTABLE=bytecode RUN=./ LIB_EXT=cma EXE_SUFFIX='' \ - REPORT=../../_build/src/report/report.byte && \ - cd ..) || echo '*** error' >> _log; \ -diff --git a/tests/camlp4-comments/Makefile b/tests/camlp4-comments/Makefile -index 33fca72..a918118 100644 ---- a/tests/camlp4-comments/Makefile -+++ b/tests/camlp4-comments/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cmp - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -o $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -o $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cmp -diff --git a/tests/camlp4-exclude-file/Makefile b/tests/camlp4-exclude-file/Makefile -index ab13983..e2520fa 100644 ---- a/tests/camlp4-exclude-file/Makefile -+++ b/tests/camlp4-exclude-file/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cmp - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -exclude-file exclusions -o $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -exclude-file exclusions -o $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cmp -diff --git a/tests/camlp4-exclude/Makefile b/tests/camlp4-exclude/Makefile -index 18aada4..d71a7bc 100644 ---- a/tests/camlp4-exclude/Makefile -+++ b/tests/camlp4-exclude/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cmp - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -exclude 'f.*' -o $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -exclude 'f.*' -o $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cmp -diff --git a/tests/camlp4-instrument-fast/Makefile b/tests/camlp4-instrument-fast/Makefile -index f60767f..8506e38 100644 ---- a/tests/camlp4-instrument-fast/Makefile -+++ b/tests/camlp4-instrument-fast/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cmp - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo -mode fast $$file -o $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo -mode fast $$file -o $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cmp -diff --git a/tests/camlp4-instrument/Makefile b/tests/camlp4-instrument/Makefile -index 33fca72..a918118 100644 ---- a/tests/camlp4-instrument/Makefile -+++ b/tests/camlp4-instrument/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cmp - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -o $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/camlp4o$(EXE_SUFFIX) str.cma ../../_build/bisect_pp.cmo $$file -o $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cmp -diff --git a/tests/combine-expr/Makefile b/tests/combine-expr/Makefile -index 46ae9eb..e8e2af2 100644 ---- a/tests/combine-expr/Makefile -+++ b/tests/combine-expr/Makefile -@@ -1,4 +1,4 @@ --COMPILE_FLAGS=-I ../../_build -pp '$(PATH_OCAML_BIN)/camlp4o str.cma -I ../../_build bisect_pp.cmo' bisect.$(LIB_EXT) $(FLAGS) -+COMPILE_FLAGS=-I ../../_build -pp '$(PATH_CAMLP4_PREFIX)/bin/camlp4o str.cma -I ../../_build bisect_pp.cmo' bisect.$(LIB_EXT) $(FLAGS) - - default: clean compile run report - -diff --git a/tests/ppx-comments/Makefile b/tests/ppx-comments/Makefile -index f8c645a..667526f 100644 ---- a/tests/ppx-comments/Makefile -+++ b/tests/ppx-comments/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cm* - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte' -dsource $$file 2> $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte' -dsource $$file 2> $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cm* -diff --git a/tests/ppx-exclude-file/Makefile b/tests/ppx-exclude-file/Makefile -index a575a77..0dd1a20 100644 ---- a/tests/ppx-exclude-file/Makefile -+++ b/tests/ppx-exclude-file/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cm* - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte -exclude-file exclusions' -dsource $$file 2> $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte -exclude-file exclusions' -dsource $$file 2> $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cm* -diff --git a/tests/ppx-exclude/Makefile b/tests/ppx-exclude/Makefile -index a517af4..f502a42 100644 ---- a/tests/ppx-exclude/Makefile -+++ b/tests/ppx-exclude/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cm* - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx "../../_build/src/syntax/bisect_ppx.byte -exclude 'f.*'" -dsource $$file 2> $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx "../../_build/src/syntax/bisect_ppx.byte -exclude 'f.*'" -dsource $$file 2> $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cm* -diff --git a/tests/ppx-instrument-fast/Makefile b/tests/ppx-instrument-fast/Makefile -index da78bb6..1195988 100644 ---- a/tests/ppx-instrument-fast/Makefile -+++ b/tests/ppx-instrument-fast/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cm* - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte -mode fast' -dsource $$file 2> $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte -mode fast' -dsource $$file 2> $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cm* -diff --git a/tests/ppx-instrument/Makefile b/tests/ppx-instrument/Makefile -index f8c645a..667526f 100644 ---- a/tests/ppx-instrument/Makefile -+++ b/tests/ppx-instrument/Makefile -@@ -2,7 +2,7 @@ default: - @rm -fr *.result *.cm* - @for file in *.ml; do \ - echo " testing '$$file' ..."; \ -- $(PATH_OCAML_BIN)/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte' -dsource $$file 2> $$file.result; \ -+ $(PATH_CAMLP4_PREFIX)/bin/ocamlc -c -I ../../_build -ppx '../../_build/src/syntax/bisect_ppx.byte' -dsource $$file 2> $$file.result; \ - diff -q $$file.reference $$file.result || exit 1; \ - done - @rm -fr *.result *.cm* -diff --git a/tests/report/Makefile b/tests/report/Makefile -index a7ffe44..a968bf9 100644 ---- a/tests/report/Makefile -+++ b/tests/report/Makefile -@@ -1,4 +1,4 @@ --COMPILE_FLAGS=-I ../../_build -pp '$(PATH_OCAML_BIN)/camlp4o str.cma -I ../../_build bisect_pp.cmo' bisect.$(LIB_EXT) $(FLAGS) -+COMPILE_FLAGS=-I ../../_build -pp '$(PATH_CAMLP4_PREFIX)/bin/camlp4o str.cma -I ../../_build bisect_pp.cmo' bisect.$(LIB_EXT) $(FLAGS) - XMLLINT=$(shell which xmllint) - - default: clean compile run report --- -2.18.0 - -- cgit v1.2.3 From e3908ec5fb96a1fbdc144f5585af49668960dfc8 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Sun, 25 Oct 2020 19:47:38 +0100 Subject: gnu: plasma-framework: Fix build errors in dependent packages. Fix build errors in dependent packages if PREFIX is different from ECM's PREFIX - which is the case in Guix. See for details. * gnu/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch: New file. * gnu/local.mk (dist_patch_DATA) Add it. * packages/kde-frameworks.scm (plasma-framework)[source]: Use this patch. --- gnu/local.mk | 1 + gnu/packages/kde-frameworks.scm | 3 ++- ...lasma-framework-fix-KF5PlasmaMacros.cmake.patch | 25 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index c6aa58b24f..4e425a3e7e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1410,6 +1410,7 @@ dist_patch_DATA = \ %D%/packages/patches/pam-mount-luks2-support.patch \ %D%/packages/patches/pango-skip-libthai-test.patch \ %D%/packages/patches/pciutils-hurd-configure.patch \ + %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \ %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch \ %D%/packages/patches/samba-fix-fcntl-hint-detection.patch \ %D%/packages/patches/sdl-pango-api_additions.patch \ diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm index c4479de995..cbcb8ff076 100644 --- a/gnu/packages/kde-frameworks.scm +++ b/gnu/packages/kde-frameworks.scm @@ -3449,7 +3449,8 @@ (define-public plasma-framework name "-" version ".tar.xz")) (sha256 (base32 - "06cxajsxj62g3c37ssrrcaxb9a12zbyp2kvrjqym329k5vd89272")))) + "06cxajsxj62g3c37ssrrcaxb9a12zbyp2kvrjqym329k5vd89272")) + (patches (search-patches "plasma-framework-fix-KF5PlasmaMacros.cmake.patch")))) (build-system cmake-build-system) (propagated-inputs `(("kpackage" ,kpackage) diff --git a/gnu/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch b/gnu/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch new file mode 100644 index 0000000000..bd55d512cf --- /dev/null +++ b/gnu/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch @@ -0,0 +1,25 @@ +From ff5ed26f21d304e867ab57781878069567deb23d Mon Sep 17 00:00:00 2001 +From: Hartmut Goebel +Date: Mon, 3 Aug 2020 19:49:58 +0000 +Subject: [PATCH] Fix build errors if PREFIX is different from ECM's PREFIX. + +See for details +--- + KF5PlasmaMacros.cmake | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/KF5PlasmaMacros.cmake b/KF5PlasmaMacros.cmake +index 494b42d56..80b3fd8dd 100644 +--- a/KF5PlasmaMacros.cmake ++++ b/KF5PlasmaMacros.cmake +@@ -1,6 +1,5 @@ + +-find_package(ECM 1.6.0 CONFIG REQUIRED) +-include(${ECM_KDE_MODULE_DIR}/KDEInstallDirs.cmake) ++include(KDEInstallDirs) + + set(PLASMA_RELATIVE_DATA_INSTALL_DIR "plasma") + set(PLASMA_DATA_INSTALL_DIR "${KDE_INSTALL_DATADIR}/${PLASMA_RELATIVE_DATA_INSTALL_DIR}") +-- +GitLab + -- cgit v1.2.3 From b4941e30e3a01a11bf0eac6fd1c68aa33b06aaf8 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Sun, 25 Oct 2020 21:29:52 +0100 Subject: gnu: kpackage: Fix build errors in dependent packages. Fix build errors in dependent packages if PREFIX is different from ECM's PREFIX - which is the case in Guix. See for details. * gnu/packages/patches/plasma-framework-fix-KF5PackageMacros.cmake.patch: New file. * gnu/local.mk (dist_patch_DATA) Add it. * packages/kde-frameworks.scm (package)[source]: Use this patch. --- gnu/local.mk | 1 + gnu/packages/kde-frameworks.scm | 3 ++- .../kpackage-fix-KF5PackageMacros.cmake.patch | 25 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/kpackage-fix-KF5PackageMacros.cmake.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 4e425a3e7e..21dbf3da8c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1197,6 +1197,7 @@ dist_patch_DATA = \ %D%/packages/patches/kmod-module-directory.patch \ %D%/packages/patches/kmscon-runtime-keymap-switch.patch \ %D%/packages/patches/kpackage-allow-external-paths.patch \ + %D%/packages/patches/kpackage-fix-KF5PackageMacros.cmake.patch \ %D%/packages/patches/kmplayer-aarch64.patch \ %D%/packages/patches/kmplayer-upstream_Fix-build-with-Qt-5.9.patch \ %D%/packages/patches/kobodeluxe-paths.patch \ diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm index cbcb8ff076..febdb1f4f0 100644 --- a/gnu/packages/kde-frameworks.scm +++ b/gnu/packages/kde-frameworks.scm @@ -1963,7 +1963,8 @@ (define-public kpackage "03rp7p7i8ihz5wg58gjs638jk7xbszknfiy2j3r979snc57g95mv")) ;; Default to: external paths/symlinks can be followed by a ;; package - (patches (search-patches "kpackage-allow-external-paths.patch")))) + (patches (search-patches "kpackage-allow-external-paths.patch" + "kpackage-fix-KF5PackageMacros.cmake.patch")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) diff --git a/gnu/packages/patches/kpackage-fix-KF5PackageMacros.cmake.patch b/gnu/packages/patches/kpackage-fix-KF5PackageMacros.cmake.patch new file mode 100644 index 0000000000..d677f19a70 --- /dev/null +++ b/gnu/packages/patches/kpackage-fix-KF5PackageMacros.cmake.patch @@ -0,0 +1,25 @@ +From 668010ebc9fd84d9dc60f90b9a4ebf3c7054977f Mon Sep 17 00:00:00 2001 +From: Hartmut Goebel +Date: Sun, 25 Oct 2020 20:11:13 +0000 +Subject: [PATCH] Fix build errors if PREFIX is different from ECM's PREFIX. + +See for details. +--- + KF5PackageMacros.cmake | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/KF5PackageMacros.cmake b/KF5PackageMacros.cmake +index f4c1d1d..acd3798 100644 +--- a/KF5PackageMacros.cmake ++++ b/KF5PackageMacros.cmake +@@ -1,6 +1,5 @@ + +-find_package(ECM 1.6.0 CONFIG REQUIRED) +-include(${ECM_KDE_MODULE_DIR}/KDEInstallDirs.cmake) ++include(KDEInstallDirs) + + set(KPACKAGE_RELATIVE_DATA_INSTALL_DIR "kpackage") + +-- +GitLab + -- cgit v1.2.3 From c94367eaaf1662eca13e0ffac5798318c3f8f3da Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Sat, 31 Oct 2020 17:52:04 +0100 Subject: gnu: sbcl-geco: Fix build. * gnu/packages/patches/sbcl-geco-fix-organism-class.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/lisp-xyz.scm (sbcl-geco)[source]: Use it. --- gnu/local.mk | 3 ++- gnu/packages/lisp-xyz.scm | 3 ++- gnu/packages/patches/sbcl-geco-fix-organism-class.patch | 13 +++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/sbcl-geco-fix-organism-class.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 3332f10df8..d4d04c01b8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -20,7 +20,7 @@ # Copyright © 2018, 2019, 2020 Oleg Pykhalov # Copyright © 2018 Stefan Stefanović # Copyright © 2018, 2020 Maxim Cournoyer -# Copyright © 2019 Guillaume Le Vaillant +# Copyright © 2019, 2020 Guillaume Le Vaillant # Copyright © 2019, 2020 John Soo # Copyright © 2019 Jonathan Brielmaier # Copyright © 2019 Evan Straw @@ -1572,6 +1572,7 @@ dist_patch_DATA = \ %D%/packages/patches/rust-reproducible-builds.patch \ %D%/packages/patches/rust-openssl-sys-no-vendor.patch \ %D%/packages/patches/rxvt-unicode-escape-sequences.patch \ + %D%/packages/patches/sbcl-geco-fix-organism-class.patch \ %D%/packages/patches/sbcl-graph-asdf-definitions.patch \ %D%/packages/patches/scalapack-blacs-mpi-deprecations.patch \ %D%/packages/patches/scheme48-tests.patch \ diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm index 260fecb12d..fb85416e38 100644 --- a/gnu/packages/lisp-xyz.scm +++ b/gnu/packages/lisp-xyz.scm @@ -14186,7 +14186,8 @@ (define-public sbcl-geco (uri (string-append "https://common-lisp.net/project/geco/download/" "geco-" version ".tar.gz")) (sha256 - (base32 "0kk0bzr1019cfmf2b1jl1rk9shv3gx5z1znifxllg9mb98yqsgw0")))) + (base32 "0kk0bzr1019cfmf2b1jl1rk9shv3gx5z1znifxllg9mb98yqsgw0")) + (patches (search-patches "sbcl-geco-fix-organism-class.patch")))) (build-system asdf-build-system/sbcl) (home-page "https://common-lisp.net/project/geco/") (synopsis "Genetic algorithm toolkit for Common Lisp") diff --git a/gnu/packages/patches/sbcl-geco-fix-organism-class.patch b/gnu/packages/patches/sbcl-geco-fix-organism-class.patch new file mode 100644 index 0000000000..817596241e --- /dev/null +++ b/gnu/packages/patches/sbcl-geco-fix-organism-class.patch @@ -0,0 +1,13 @@ +Fix the ORGANISM class so that SBCL >= 2.0.9 can compile it without error. + +--- a/classes.lisp 2020-10-28 12:11:10.725659464 +0100 ++++ b/classes.lisp 2020-10-31 17:34:36.822752447 +0100 +@@ -148,7 +148,7 @@ + :accessor score + :initarg :score + :initform 'nil +- :type number) ++ :type (or number null)) + (NORMALIZED-SCORE + :accessor normalized-score + :initarg :normalized-score -- cgit v1.2.3 From 95024494f31c3176bcd2238662e7b7868acc2882 Mon Sep 17 00:00:00 2001 From: Vitaliy Shatrov Date: Tue, 25 Aug 2020 18:26:38 +0700 Subject: gnu: Add bsd-games. * gnu/packages/games.scm (bsd-games): New variable. New patches, taken from Arch and Debian: * gnu/packages/patches/bsd-games-2.17-64bit.patch * gnu/packages/patches/bsd-games-bad-ntohl-cast.patch * gnu/packages/patches/bsd-games-gamescreen.h.patch * gnu/packages/patches/bsd-games-getline.patch * gnu/packages/patches/bsd-games-null-check.patch * gnu/packages/patches/bsd-games-number.c-and-test.patch * gnu/packages/patches/bsd-games-prevent-name-collisions.patch * gnu/packages/patches/bsd-games-stdio.h.patch New patches with our customizations (configure-config built after Arch's): * gnu/packages/patches/bsd-games-add-configure-config.patch * gnu/packages/patches/bsd-games-add-wrapper.patch * gnu/packages/patches/bsd-games-dont-install-empty-files.patch Signed-off-by: Nicolas Goaziou --- gnu/local.mk | 11 + gnu/packages/games.scm | 134 +++++++++++ gnu/packages/patches/bsd-games-2.17-64bit.patch | 43 ++++ .../patches/bsd-games-add-configure-config.patch | 22 ++ gnu/packages/patches/bsd-games-add-wrapper.patch | 251 +++++++++++++++++++++ .../patches/bsd-games-bad-ntohl-cast.patch | 22 ++ .../bsd-games-dont-install-empty-files.patch | 87 +++++++ gnu/packages/patches/bsd-games-gamescreen.h.patch | 14 ++ gnu/packages/patches/bsd-games-getline.patch | 194 ++++++++++++++++ gnu/packages/patches/bsd-games-null-check.patch | 24 ++ .../patches/bsd-games-number.c-and-test.patch | 183 +++++++++++++++ .../bsd-games-prevent-name-collisions.patch | 13 ++ gnu/packages/patches/bsd-games-stdio.h.patch | 14 ++ 13 files changed, 1012 insertions(+) create mode 100644 gnu/packages/patches/bsd-games-2.17-64bit.patch create mode 100644 gnu/packages/patches/bsd-games-add-configure-config.patch create mode 100644 gnu/packages/patches/bsd-games-add-wrapper.patch create mode 100644 gnu/packages/patches/bsd-games-bad-ntohl-cast.patch create mode 100644 gnu/packages/patches/bsd-games-dont-install-empty-files.patch create mode 100644 gnu/packages/patches/bsd-games-gamescreen.h.patch create mode 100644 gnu/packages/patches/bsd-games-getline.patch create mode 100644 gnu/packages/patches/bsd-games-null-check.patch create mode 100644 gnu/packages/patches/bsd-games-number.c-and-test.patch create mode 100644 gnu/packages/patches/bsd-games-prevent-name-collisions.patch create mode 100644 gnu/packages/patches/bsd-games-stdio.h.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index d4d04c01b8..2a994bd3b9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -822,6 +822,17 @@ dist_patch_DATA = \ %D%/packages/patches/bastet-change-source-of-unordered_set.patch \ %D%/packages/patches/bazaar-CVE-2017-14176.patch \ %D%/packages/patches/bc-fix-cross-compilation.patch \ + %D%/packages/patches/bsd-games-2.17-64bit.patch \ + %D%/packages/patches/bsd-games-add-configure-config.patch \ + %D%/packages/patches/bsd-games-add-wrapper.patch \ + %D%/packages/patches/bsd-games-bad-ntohl-cast.patch \ + %D%/packages/patches/bsd-games-dont-install-empty-files.patch \ + %D%/packages/patches/bsd-games-gamescreen.h.patch \ + %D%/packages/patches/bsd-games-getline.patch \ + %D%/packages/patches/bsd-games-null-check.patch \ + %D%/packages/patches/bsd-games-number.c-and-test.patch \ + %D%/packages/patches/bsd-games-prevent-name-collisions.patch \ + %D%/packages/patches/bsd-games-stdio.h.patch \ %D%/packages/patches/beancount-disable-googleapis-fonts.patch \ %D%/packages/patches/beets-werkzeug-compat.patch \ %D%/packages/patches/behave-skip-a-couple-of-tests.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 5f906d0a4e..eb29f2a8e5 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -116,6 +116,7 @@ (define-module (gnu packages games) #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) + #:use-module (gnu packages gnu-doc) #:use-module (gnu packages gnupg) #:use-module (gnu packages gnuzilla) #:use-module (gnu packages gperf) @@ -589,6 +590,139 @@ (define-public blobwars license:lgpl2.1+ license:bsd-2)))) +(define-public bsd-games + (package + (name "bsd-games") + (version "2.17.0") + (source + (origin + (method url-fetch) + (uri "https://ibiblio.org/pub/linux/games/bsd-games-2.17.tar.gz") + (sha256 + (base32 "0q7zdyyfvn15y0w4g54kq3gza89h61py727m8slmw73cxx594vq6")) + (patches + (search-patches + ;; thanks Arch, and Debian + "bsd-games-2.17-64bit.patch" + "bsd-games-bad-ntohl-cast.patch" + "bsd-games-gamescreen.h.patch" + "bsd-games-getline.patch" + "bsd-games-null-check.patch" + "bsd-games-number.c-and-test.patch" + "bsd-games-stdio.h.patch" + "bsd-games-prevent-name-collisions.patch" + ;; Guix customizations + "bsd-games-add-configure-config.patch" + "bsd-games-dont-install-empty-files.patch" + "bsd-games-add-wrapper.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("flex" ,flex) + ("bison" ,bison))) + (inputs + `(("curses" ,ncurses) + ("pager" ,less) + ("miscfiles" ,miscfiles) + ("openssl" ,openssl))) ;used only by 'factor' + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (doc (string-append out "/share/doc/bsd-games-" ,version)) + (man (string-append out "/share/man")) + (word-list (string-append (assoc-ref inputs "miscfiles") + "/share/web2")) + (static-data (string-append out "/share/games/bsd-games")) + ;; Not a "./" because of substitute* in 'patch-install + ;; below. The .// allow us not to mess with the games' + ;; code any further: we just use a wrapper script that + ;; cd's to a BSD_GAMES_DIR. :] + (save-files ".//")) + (substitute* "configure" + (("/usr/share/man") man) + (("/usr/share/doc/bsd-games") doc) + (("/usr/share/[^\n/]*") static-data) + (("/var/games") save-files) + (("/usr/bin/less") (which "less")) + (("(/usr/bin|/usr/games)") bin)) + (substitute* "config.params" (("WORD_LIST") word-list)) + (substitute* "wrapper" (("STATIC_DATA") static-data)) + (invoke "./configure")) + #t)) + (add-before 'install 'patch-install + ;; Some games need a writable directory containing pre-maded files. + ;; The files get installed to the Store. Then the wrapper kicks in. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (static-data (string-append out "/share/games/bsd-games")) + (save-files ".//")) + (substitute* "Makeconfig" ((save-files) static-data))) + #t)) + (add-after 'install 'install-documents + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (string-append out "/share/doc/bsd-games-" ,version))) + (rename-file "phantasia/COPYRIGHT" "phantasia-COPYRIGHT") + (for-each + (lambda(file) (install-file file doc)) + '("AUTHORS" "BUGS" "README" "SECURITY" "THANKS" + "phantasia-COPYRIGHT"))) + #t))))) + (home-page "https://github.com/vattam/BSDGames") + (synopsis "Collection of the old text-based games and amusements") + (description + "These are the BSD games. See the fortune-mod package for fortunes. + +Action: atc (keep the airplanes safe), hack (explore the dangerous Dungeon), +hunt (kill the others for the Pair of Boots, multi-player only), robots (avoid +the evil robots), sail (game of naval warfare with wooden ships), snake (steal +the $$ from the cave, anger the snake, and get out alive), tetris (game of +lining up the falling bricks of different shapes), and worm (eat, grow big, +and neither bite your tail, nor ram the wall). + +Amusements: banner (prints a large banner), bcd & morse & ppt (print a punch +card, or paper tape, or Morse codes), caesar & rot13 (ciphers and deciphers +the input), factor (factorizes a number), number (translates numbers into +text), pig (translates from English to Pig Latin), pom (should print the +Moon's phase), primes (generates primes), rain & worms (plays an screen-saver +in terminal), random (prints randomly choosen lines from files, or returns a +random exit-code), and wtf (explains what do some acronyms mean). + +Board: backgammon (lead the men out of board faster than the friend do), +boggle (find the words in the square of letters), dab (game of dots and +boxes), gomoku (game of five in a row), hangman (guess a word before man is +hanged), and monop (game of monopoly, hot-seat only). Also the card-games: +canfield, cribbage, fish (juniors game), and mille. + +Quests: adventure (search for treasures with the help of wizard), +battlestar (explore the world around, starting from dying spaceship), +phantasia (role-play as an rogue), trek (hunt the Klingons, and save the +Federation), and wump (hunt the big smelly Wumpus in a dark cave). + +Quizes: arithmetic, and quiz.") + ;; "Auxiliary and data files, distributed with the games in NetBSD, but + ;; not bearing copyright notices, probably fall under the terms of the UCB + ;; or NetBSD copyrights and licences. The file "fortune/Notes" contains a + ;; warning in regard to the fortune databases." + (license (list + ;; Most games. Files: countmail/countmail.6, dab/dab.6, + ;; lib/strlcpy.c, wargames/wargames.6 + license:bsd-3 + ;; dab and hunt. Files: adventure/extern.h, + ;; backgammon/backgammon/backlocal.h, caesar/rot13.in, + ;; countmail/countmail, dm/utmpentry.c, dm/utmpentry.h, + ;; hack/extern.h, robots/auto.c, sail/display.h, + ;; sail/restart.h, wargames/wargames + license:bsd-4 + ;; wtf (the game) + license:public-domain + ;; phantasia (all but phantasia/pathnames.h.in, which is bsd-3) + (license:fsf-free "file:///phantasia/COPYRIGHT"))))) + + (define-public bzflag (package (name "bzflag") diff --git a/gnu/packages/patches/bsd-games-2.17-64bit.patch b/gnu/packages/patches/bsd-games-2.17-64bit.patch new file mode 100644 index 0000000000..e286c1c531 --- /dev/null +++ b/gnu/packages/patches/bsd-games-2.17-64bit.patch @@ -0,0 +1,43 @@ +David Leverton writes about adventure/crc.c: + +The 'adventure' game from the games-misc/bsd-games-2.13 package crashes +when saving the game on AMD64 (and probably other 64-bit systems, but I +haven't checked). Find attached to fix this. + +http://bugs.gentoo.org/show_bug.cgi?id=77032 + + +About utmpentry.c: + +the utmpx structure defines the ut_tv member a little differently on +64bit hosts so that a 32bit and 64bit structure can be shared. So the +ut_tv is a custom 32bit structure rather than the native 64bit timeval +structure. Work around is to assign the submembers instead. + +http://bugs.gentoo.org/show_bug.cgi?id=102667 + +--- bsd-games/adventure/crc.c ++++ bsd-games/adventure/crc.c +@@ -134,7 +134,8 @@ + if (step >= sizeof(crctab) / sizeof(crctab[0])) + step = 0; + } +- crcval = (crcval << 8) ^ crctab[i]; ++ /* Mask to 32 bits. */ ++ crcval = ((crcval << 8) ^ crctab[i]) & 0xffffffff; + } +- return crcval & 0xffffffff; /* Mask to 32 bits. */ ++ return crcval; + } +--- bsd-games/dm/utmpentry.c ++++ bsd-games/dm/utmpentry.c +@@ -291,7 +291,8 @@ + e->line[sizeof(e->line) - 1] = '\0'; + (void)strncpy(e->host, up->ut_host, sizeof(up->ut_host)); + e->name[sizeof(e->host) - 1] = '\0'; +- e->tv = up->ut_tv; ++ e->tv.tv_sec = up->ut_tv.tv_sec; ++ e->tv.tv_usec = up->ut_tv.tv_usec; + adjust_size(e); + } + #endif diff --git a/gnu/packages/patches/bsd-games-add-configure-config.patch b/gnu/packages/patches/bsd-games-add-configure-config.patch new file mode 100644 index 0000000000..d8636addb6 --- /dev/null +++ b/gnu/packages/patches/bsd-games-add-configure-config.patch @@ -0,0 +1,22 @@ +Remove a few 'setenv's from the definition. + +diff -Naur bsd-games-2.17/config.params bsd-games-patch/config.params +--- bsd-games-2.17/config.params 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/config.params 2020-04-22 20:49:40.809695248 +0700 +@@ -0,0 +1,16 @@ ++bsd_games_cfg_do_chown=n ++bsd_games_cfg_non_interactive=y ++ ++# Fix some man-pages: cfscores, morse, ppt, rot13, snscore, teachgammon. ++bsd_games_cfg_use_dot_so=syml ++ ++# Don't build some games: ++# Countmail require some BSD-package called `from`. ++# DM is a toy to restrict access to bsd-games. ++# Fortune seems to be already packaged (fortune-mod). ++# Wargames isn't convenient as a game launcher. ++bsd_games_cfg_no_build_dirs="countmail dm fortune wargames" ++ ++# Those are substitute*'d with GNU miscfiles. ++bsd_games_cfg_hangman_wordsfile=WORD_LIST ++bsd_games_cfg_dictionary_src=WORD_LIST diff --git a/gnu/packages/patches/bsd-games-add-wrapper.patch b/gnu/packages/patches/bsd-games-add-wrapper.patch new file mode 100644 index 0000000000..ad3b1a9860 --- /dev/null +++ b/gnu/packages/patches/bsd-games-add-wrapper.patch @@ -0,0 +1,251 @@ +As we cannot install outside the Store, and those games do not create the +needed writable files on their own, we need a wrapper script. + +diff -Naur bsd-games-2.17/atc/Makefrag bsd-games-patch/atc/Makefrag +--- bsd-games-2.17/atc/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/atc/Makefrag 2020-04-23 20:24:04.446176222 +0700 +@@ -47,7 +47,8 @@ + mv atc/lex.yy.c $@ + + atc_install: atc_all +- $(INSTALL_SCORE_GAME) atc/atc $(INSTALL_PREFIX)$(GAMESDIR)/atc ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/atc ++ $(INSTALL_SCORE_GAME) atc/atc $(INSTALL_PREFIX)$(GAMESDIR)/.atc-real + $(HIDE_GAME) atc + $(INSTALL_SCORE_FILE) $(ATC_SCOREFILE) + $(INSTALL_MANUAL) atc/atc.6 +diff -Naur bsd-games-2.17/battlestar/Makefrag bsd-games-patch/battlestar/Makefrag +--- bsd-games-2.17/battlestar/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/battlestar/Makefrag 2020-04-23 20:24:04.482175771 +0700 +@@ -32,7 +32,8 @@ + battlestar_all: battlestar/battlestar battlestar/battlestar.6 + + battlestar_install: battlestar_all +- $(INSTALL_SCORE_GAME) battlestar/battlestar $(INSTALL_PREFIX)$(GAMESDIR)/battlestar ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/battlestar ++ $(INSTALL_SCORE_GAME) battlestar/battlestar $(INSTALL_PREFIX)$(GAMESDIR)/.battlestar-real + $(HIDE_GAME) battlestar + $(INSTALL_MANUAL) battlestar/battlestar.6 + $(INSTALL_SCORE_FILE) $(BATTLESTAR_SCOREFILE) +diff -Naur bsd-games-2.17/canfield/canfield/Makefrag bsd-games-patch/canfield/canfield/Makefrag +--- bsd-games-2.17/canfield/canfield/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/canfield/canfield/Makefrag 2020-04-23 20:24:04.522175270 +0700 +@@ -31,7 +31,8 @@ + canfield_canfield_all: canfield/canfield/canfield canfield/canfield/canfield.6 + + canfield_canfield_install: canfield_canfield_all +- $(INSTALL_SCORE_GAME) canfield/canfield/canfield $(INSTALL_PREFIX)$(GAMESDIR)/canfield ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/canfield ++ $(INSTALL_SCORE_GAME) canfield/canfield/canfield $(INSTALL_PREFIX)$(GAMESDIR)/.canfield-real + $(HIDE_GAME) canfield + $(INSTALL_MANUAL) canfield/canfield/canfield.6 + $(INSTALL_SCORE_FILE) $(CANFIELD_SCOREFILE) +diff -ur bsd-games-2.17.orig/canfield/cfscores/Makefrag bsd-games-2.17/canfield/cfscores/Makefrag +--- bsd-games-2.17.orig/canfield/cfscores/Makefrag 1970-01-01 07:00:01.000000000 +0700 ++++ bsd-games-2.17/canfield/cfscores/Makefrag 2020-08-06 12:20:10.592076477 +0700 +@@ -32,6 +32,7 @@ + canfield_cfscores_all: canfield/cfscores/cfscores + + canfield_cfscores_install: canfield_cfscores_all +- $(INSTALL_BINARY) canfield/cfscores/cfscores $(INSTALL_PREFIX)$(GAMESDIR)/cfscores ++ $(INSTALL_BINARY) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/cfscores ++ $(INSTALL_BINARY) canfield/cfscores/cfscores $(INSTALL_PREFIX)$(GAMESDIR)/.cfscores-real + $(HIDE_GAME) cfscores + $(INSTALL_MANUAL) canfield.6 cfscores.6 +diff -Naur bsd-games-2.17/cribbage/Makefrag bsd-games-patch/cribbage/Makefrag +--- bsd-games-2.17/cribbage/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/cribbage/Makefrag 2020-04-23 20:24:04.534175120 +0700 +@@ -31,7 +31,8 @@ + cribbage_all: cribbage/cribbage cribbage/cribbage.n cribbage/cribbage.6 + + cribbage_install: cribbage_all +- $(INSTALL_SCORE_GAME) cribbage/cribbage $(INSTALL_PREFIX)$(GAMESDIR)/cribbage ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/cribbage ++ $(INSTALL_SCORE_GAME) cribbage/cribbage $(INSTALL_PREFIX)$(GAMESDIR)/.cribbage-real + $(HIDE_GAME) cribbage + $(INSTALL_DATA) cribbage/cribbage.n $(INSTALL_PREFIX)$(CRIBBAGE_INSTRFILE) + $(INSTALL_SCORE_FILE) $(CRIBBAGE_SCOREFILE) +diff -Naur bsd-games-2.17/hack/Makefrag bsd-games-patch/hack/Makefrag +--- bsd-games-2.17/hack/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/hack/Makefrag 2020-04-23 20:24:04.590174419 +0700 +@@ -53,7 +53,8 @@ + hack/hack.zap.d hack/rnd.d: hack/hack.onames.h + + hack_install: hack_all +- $(INSTALL_SCORE_GAME) hack/hack $(INSTALL_PREFIX)$(GAMESDIR)/hack ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/hack ++ $(INSTALL_SCORE_GAME) hack/hack $(INSTALL_PREFIX)$(GAMESDIR)/.hack-real + $(HIDE_GAME) hack + $(INSTALL_HACK_DIR) $(INSTALL_PREFIX)$(HACK_DIR) + set -e; for f in data help hh rumors; do $(INSTALL_DATA) hack/$$f $(INSTALL_PREFIX)$(HACK_DIR)/$$f; done +diff -Naur bsd-games-2.17/phantasia/Makefrag bsd-games-patch/phantasia/Makefrag +--- bsd-games-2.17/phantasia/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/phantasia/Makefrag 2020-04-23 20:24:04.650173667 +0700 +@@ -38,7 +38,8 @@ + touch phantasia/scorefiles.stamp + + phantasia_install: phantasia_all +- $(INSTALL_SCORE_GAME) phantasia/phantasia $(INSTALL_PREFIX)$(GAMESDIR)/phantasia ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/phantasia ++ $(INSTALL_SCORE_GAME) phantasia/phantasia $(INSTALL_PREFIX)$(GAMESDIR)/.phantasia-real + $(HIDE_GAME) phantasia + (set -e; for f in $(phantasia_VFILES1); do \ + cp phantasia/$$f $(INSTALL_PREFIX)$(PHANTASIA_DIR)/$$f; \ +diff -Naur bsd-games-2.17/robots/Makefrag bsd-games-patch/robots/Makefrag +--- bsd-games-2.17/robots/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/robots/Makefrag 2020-04-23 20:24:04.702173016 +0700 +@@ -32,7 +32,8 @@ + robots_all: robots/robots robots/robots.6 + + robots_install: robots_all +- $(INSTALL_SCORE_GAME) robots/robots $(INSTALL_PREFIX)$(GAMESDIR)/robots ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/robots ++ $(INSTALL_SCORE_GAME) robots/robots $(INSTALL_PREFIX)$(GAMESDIR)/.robots-real + $(HIDE_GAME) robots + $(INSTALL_SCORE_FILE) $(ROBOTS_SCOREFILE) + $(INSTALL_MANUAL) robots/robots.6 +diff -Naur bsd-games-2.17/sail/Makefrag bsd-games-patch/sail/Makefrag +--- bsd-games-2.17/sail/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/sail/Makefrag 2020-04-23 20:24:04.710172917 +0700 +@@ -31,7 +31,8 @@ + sail_all: sail/sail sail/sail.6 + + sail_install: sail_all +- $(INSTALL_SCORE_GAME) sail/sail $(INSTALL_PREFIX)$(GAMESDIR)/sail ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/sail ++ $(INSTALL_SCORE_GAME) sail/sail $(INSTALL_PREFIX)$(GAMESDIR)/.sail-real + $(HIDE_GAME) sail + $(INSTALL_SCORE_FILE) $(SAIL_SCOREFILE) + $(INSTALL_SAIL_DIR) $(INSTALL_PREFIX)$(SAIL_DIR) +diff -Naur bsd-games-2.17/snake/snake/Makefrag bsd-games-patch/snake/snake/Makefrag +--- bsd-games-2.17/snake/snake/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/snake/snake/Makefrag 2020-04-23 20:24:04.722172766 +0700 +@@ -31,7 +31,8 @@ + snake_snake_all: snake/snake/snake snake/snake/snake.6 + + snake_snake_install: snake_snake_all +- $(INSTALL_SCORE_GAME) snake/snake/snake $(INSTALL_PREFIX)$(GAMESDIR)/snake ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/snake ++ $(INSTALL_SCORE_GAME) snake/snake/snake $(INSTALL_PREFIX)$(GAMESDIR)/.snake-real + $(HIDE_GAME) snake + $(INSTALL_SCORE_FILE) $(SNAKE_SCOREFILE) + $(INSTALL_SCORE_FILE) $(SNAKE_RAWSCOREFILE) +--- bsd-games-2.17.orig/snake/snscore/Makefrag 1970-01-01 07:00:01.000000000 +0700 ++++ bsd-games-2.17/snake/snscore/Makefrag 2020-08-06 12:33:09.636089394 +0700 +@@ -32,6 +32,7 @@ + snake_snscore_all: snake/snscore/snscore + + snake_snscore_install: snake_snscore_all +- $(INSTALL_BINARY) snake/snscore/snscore $(INSTALL_PREFIX)$(GAMESDIR)/snscore ++ $(INSTALL_BINARY) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/snscore ++ $(INSTALL_BINARY) snake/snscore/snscore $(INSTALL_PREFIX)$(GAMESDIR)/.snscore-real + $(HIDE_GAME) snscore + $(INSTALL_MANUAL) snake.6 snscore.6 +diff -Naur bsd-games-2.17/tetris/Makefrag bsd-games-patch/tetris/Makefrag +--- bsd-games-2.17/tetris/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/tetris/Makefrag 2020-04-23 20:24:04.734172616 +0700 +@@ -32,7 +32,8 @@ + tetris_all: tetris/tetris tetris/tetris.6 + + tetris_install: tetris_all +- $(INSTALL_SCORE_GAME) tetris/tetris $(INSTALL_PREFIX)$(GAMESDIR)/tetris-bsd ++ $(INSTALL_SCORE_GAME) wrapper $(INSTALL_PREFIX)$(GAMESDIR)/tetris-bsd ++ $(INSTALL_SCORE_GAME) tetris/tetris $(INSTALL_PREFIX)$(GAMESDIR)/.tetris-bsd-real + $(HIDE_GAME) tetris-bsd + $(INSTALL_SCORE_FILE) $(TETRIS_SCOREFILE) + ln -f tetris/tetris.6 tetris/tetris-bsd.6 +diff -Naur bsd-games-2.17/wrapper bsd-games-patch/wrapper +--- bsd-games-2.17/wrapper 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/wrapper 2020-04-23 20:24:37.153766719 +0700 +@@ -0,0 +1,91 @@ ++#!/bin/sh ++# This file works around limitations of our read-only Store. ++ ++set -e ++ ++check_empty_files () { ++ # those start empty ++ for f in ${@} ++ do ++ if [[ ! -f ${f} ]] ++ then ++ touch ${f} ++ echo "$(pwd)/${f} RESTORED" ++ fi ++ done ++} ++check_data_files () { ++ # those start with some initial data ++ for f in ${@} ++ do ++ if [[ ! -f ${f} ]] ++ then ++ cp STATIC_DATA/${game}/${f} ${f} ++ chmod u+w ${f} ++ echo "$(pwd)/${f} RESTORED" ++ fi ++ done ++} ++visit_dir () { ++ mkdir -p ${1} ++ cd ${1} ++} ++exit_with_variable_error () { ++ variables="${1}${2:+ or ${2}}" ++ echo "Guix: Please set up the ${variables} variable." ++ echo "Examples:" ++ echo " export ${1}=/var/multiplayer" ++ echo " export ${2:-${1}}=~/.local/share/bsd-games" ++ echo "You can place this in ~/.bashrc or a similar file for Your shell." ++ echo "For multiplayer this directory should be writable for all players." ++ exit 1 ++} ++ ++game=$(basename $0) ++if [[ ${game} == "hack" ]] ++then ++ if [[ -n ${HACKDIR} ]]; then visit_dir "${HACKDIR}" ++ elif [[ -n ${BSD_GAMES_DIR} ]]; then visit_dir "${BSD_GAMES_DIR}/hack" ++ else exit_with_variable_error "HACKDIR" "BSD_GAMES_DIR" ++ fi ++else ++ if [[ -n ${BSD_GAMES_DIR} ]]; then visit_dir "${BSD_GAMES_DIR}" ++ else exit_with_variable_error "BSD_GAMES_DIR" ++ fi ++fi ++ ++case ${game} in ++ ### Games with score-files ++ atc) ++ check_empty_files "atc_score";; ++ battlestar) ++ check_empty_files "battlestar.log";; ++ canfield) ++ check_empty_files "cfscores";; ++ cribbage) ++ check_empty_files "criblog";; ++ robots) ++ check_empty_files "robots_roll";; ++ snake) ++ check_empty_files "snakerawscores" "snake.log";; ++ tetris) ++ check_empty_files "tetris-bsd.scores";; ++ ### Games with saved state ++ hack) ++ check_empty_files "record" "perm" ++ check_data_files "data" "help" "hh" "rumors" ++ visit_dir "save" ++ cd ../../;; ++ phantasia) ++ visit_dir "phantasia" ++ check_empty_files "characs" "gold" "lastdead"\ ++ "mess" "motd" "scoreboard" "void" ++ check_data_files "monsters" ++ cd ../;; ++ sail) ++ visit_dir "sail" ++ check_empty_files "log" "syncfile" ++ cd ../;; ++esac ++ ++exec .${game}-real ${@} diff --git a/gnu/packages/patches/bsd-games-bad-ntohl-cast.patch b/gnu/packages/patches/bsd-games-bad-ntohl-cast.patch new file mode 100644 index 0000000000..caadfa5054 --- /dev/null +++ b/gnu/packages/patches/bsd-games-bad-ntohl-cast.patch @@ -0,0 +1,22 @@ +diff --git a/hunt/hunt/playit.c b/hunt/hunt/playit.c +index 9acf86e..881a4e7 100644 +--- a/hunt/hunt/playit.c ++++ b/hunt/hunt/playit.c +@@ -114,7 +114,7 @@ playit() + bad_con(); + /* NOTREACHED */ + } +- if (ntohl(version) != (unsigned long)HUNT_VERSION) { ++ if (ntohl(version) != (uint32_t)HUNT_VERSION) { + bad_ver(); + /* NOTREACHED */ + } +@@ -649,7 +649,7 @@ do_message() + bad_con(); + /* NOTREACHED */ + } +- if (ntohl(version) != (unsigned long)HUNT_VERSION) { ++ if (ntohl(version) != (uint32_t)HUNT_VERSION) { + bad_ver(); + /* NOTREACHED */ + } diff --git a/gnu/packages/patches/bsd-games-dont-install-empty-files.patch b/gnu/packages/patches/bsd-games-dont-install-empty-files.patch new file mode 100644 index 0000000000..4ee0578177 --- /dev/null +++ b/gnu/packages/patches/bsd-games-dont-install-empty-files.patch @@ -0,0 +1,87 @@ +Those games rely on user to provide the files to write scores in. +Those score-files are initially empty. Anyway, the Store is read-only. +So we do not install those empty files. + +diff -Naur bsd-games-2.17/install-score.in bsd-games-patch/install-score.in +--- bsd-games-2.17/install-score.in 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/install-score.in 2020-04-22 21:41:47.810544804 +0700 +@@ -1,45 +0,0 @@ +-# install-score.in - install a score file +-# +-# Copyright (c) 1997, 1998, 1999 Joseph Samuel Myers. +-# All rights reserved. +-# +-# Redistribution and use in source and binary forms, with or without +-# modification, are permitted provided that the following conditions +-# are met: +-# 1. Redistributions of source code must retain the above copyright +-# notice, this list of conditions and the following disclaimer. +-# 2. Redistributions in binary form must reproduce the above copyright +-# notice, this list of conditions and the following disclaimer in the +-# documentation and/or other materials provided with the distribution. +-# 3. The name of the author may not be used to endorse or promote products +-# derived from this software without specific prior written permission. +-# +-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +-# SUCH DAMAGE. +- +-set -e +- +-if [ "$1" = "-p" ]; then +- scorefile="@install_prefix@$2" +- perms=@vardata_perms_priv@ +-else +- scorefile="@install_prefix@$1" +- perms=@vardata_perms@ +-fi +- +-mkdir -p "$(dirname "$scorefile")" +- +-test -e "$scorefile" || touch "$scorefile" +-if [ @do_chown@ = y ]; then +- chown @vardata_owner@:@vardata_group@ "$scorefile" +-fi +-chmod "$perms" "$scorefile" +diff -Naur bsd-games-2.17/phantasia/Makefrag bsd-games-patch/phantasia/Makefrag +--- bsd-games-2.17/phantasia/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/phantasia/Makefrag 2020-04-22 21:26:00.162409464 +0700 +@@ -27,9 +27,8 @@ + # SUCH DAMAGE. + + phantasia_DIRS := $(GAMESDIR) $(MAN6DIR) $(PHANTASIA_DIR) +-phantasia_VFILES1 := gold lastdead mess monsters motd void +-phantasia_VFILES2 := scoreboard characs +-phantasia_CLEANFILES := $(phantasia_VFILES1) $(phantasia_VFILES2) scorefiles.stamp ++phantasia_VFILES1 := monsters ++phantasia_CLEANFILES := $(phantasia_VFILES1) scorefiles.stamp + + phantasia_all: phantasia/phantasia phantasia/phantasia.6 phantasia/scorefiles.stamp + +@@ -43,9 +42,4 @@ + (set -e; for f in $(phantasia_VFILES1); do \ + cp phantasia/$$f $(INSTALL_PREFIX)$(PHANTASIA_DIR)/$$f; \ + $(INSTALL_SCORE_FILE) $(PHANTASIA_DIR)/$$f; done) +- (set -e; for f in $(phantasia_VFILES2); do \ +- if [ ! -e $(PHANTASIA_DIR)/$$f ]; then \ +- cp phantasia/$$f $(INSTALL_PREFIX)$(PHANTASIA_DIR)/$$f; fi; done; \ +- $(INSTALL_SCORE_FILE) $(PHANTASIA_DIR)/scoreboard; \ +- $(INSTALL_SCORE_FILE) -p $(PHANTASIA_DIR)/characs) + $(INSTALL_MANUAL) phantasia/phantasia.6 +diff -Naur bsd-games-2.17/sail/Makefrag bsd-games-patch/sail/Makefrag +--- bsd-games-2.17/sail/Makefrag 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/sail/Makefrag 2020-04-22 21:26:48.701801676 +0700 +@@ -34,5 +34,4 @@ + $(INSTALL_SCORE_GAME) sail/sail $(INSTALL_PREFIX)$(GAMESDIR)/sail + $(HIDE_GAME) sail + $(INSTALL_SCORE_FILE) $(SAIL_SCOREFILE) +- $(INSTALL_SAIL_DIR) $(INSTALL_PREFIX)$(SAIL_DIR) + $(INSTALL_MANUAL) sail/sail.6 diff --git a/gnu/packages/patches/bsd-games-gamescreen.h.patch b/gnu/packages/patches/bsd-games-gamescreen.h.patch new file mode 100644 index 0000000000..d3c6b4ae50 --- /dev/null +++ b/gnu/packages/patches/bsd-games-gamescreen.h.patch @@ -0,0 +1,14 @@ +--- a/dab/gamescreen.h 2004-01-02 23:34:51.000000000 +0530 ++++ b/dab/gamescreen.h 2008-07-31 23:45:19.000000000 +0530 +@@ -70,9 +70,9 @@ + virtual void redraw(void) = 0; // Refresh + virtual int getinput(void) = 0; // Get user input + virtual void bell(void) = 0; // Beep +- virtual void score(size_t p, const PLAYER& p) = 0; // Post current score +- virtual void games(size_t p, const PLAYER& p) = 0; // Post games won +- virtual void total(size_t p, const PLAYER& p) = 0; // Post total score ++ virtual void score(size_t, const PLAYER&) = 0; // Post current score ++ virtual void games(size_t, const PLAYER&) = 0; // Post games won ++ virtual void total(size_t, const PLAYER&) = 0; // Post total score + virtual void ties(const PLAYER& p) = 0; // Post tie games + }; diff --git a/gnu/packages/patches/bsd-games-getline.patch b/gnu/packages/patches/bsd-games-getline.patch new file mode 100644 index 0000000000..d7c0b4034d --- /dev/null +++ b/gnu/packages/patches/bsd-games-getline.patch @@ -0,0 +1,194 @@ +diff -Naur bsd-games-2.17/boggle/boggle/bog.c bsd-games-2.17.1/boggle/boggle/bog.c +--- bsd-games-2.17/boggle/boggle/bog.c 2004-12-07 07:34:21.000000000 -0600 ++++ bsd-games-2.17.1/boggle/boggle/bog.c 2010-05-22 10:51:23.000000000 -0500 +@@ -336,7 +336,7 @@ + } + + while (1) { +- if (getline(buf) == NULL) { ++ if (boggle_getline(buf) == NULL) { + if (feof(stdin)) + clearerr(stdin); + break; +diff -Naur bsd-games-2.17/boggle/boggle/extern.h bsd-games-2.17.1/boggle/boggle/extern.h +--- bsd-games-2.17/boggle/boggle/extern.h 2004-01-27 14:52:07.000000000 -0600 ++++ bsd-games-2.17.1/boggle/boggle/extern.h 2010-05-22 10:51:23.000000000 -0500 +@@ -43,7 +43,7 @@ + long dictseek(FILE *, long, int); + void findword(void); + void flushin(FILE *); +-char *getline(char *); ++char *boggle_getline(char *); + void getword(char *); + int help(void); + int inputch(void); +diff -Naur bsd-games-2.17/boggle/boggle/mach.c bsd-games-2.17.1/boggle/boggle/mach.c +--- bsd-games-2.17/boggle/boggle/mach.c 2004-12-07 07:34:21.000000000 -0600 ++++ bsd-games-2.17.1/boggle/boggle/mach.c 2010-05-22 10:51:23.000000000 -0500 +@@ -168,7 +168,7 @@ + * - doesn't accept words longer than MAXWORDLEN or containing caps + */ + char * +-getline(q) ++boggle_getline(q) + char *q; + { + int ch, done; +diff -Naur bsd-games-2.17/cribbage/cribbage.h bsd-games-2.17.1/cribbage/cribbage.h +--- bsd-games-2.17/cribbage/cribbage.h 2004-02-08 16:29:14.000000000 -0600 ++++ bsd-games-2.17.1/cribbage/cribbage.h 2010-05-22 10:51:23.000000000 -0500 +@@ -77,7 +77,7 @@ + int fifteens(const CARD [], int); + void game(void); + void gamescore(void); +-char *getline(void); ++char *cribbage_getline(void); + int getuchar(void); + int incard(CARD *); + int infrom(const CARD [], int, const char *); +diff -Naur bsd-games-2.17/cribbage/crib.c bsd-games-2.17.1/cribbage/crib.c +--- bsd-games-2.17/cribbage/crib.c 2004-01-27 14:52:07.000000000 -0600 ++++ bsd-games-2.17.1/cribbage/crib.c 2010-05-22 10:51:23.000000000 -0500 +@@ -221,7 +221,7 @@ + if (!rflag) { /* player cuts deck */ + msg(quiet ? "Cut for crib? " : + "Cut to see whose crib it is -- low card wins? "); +- getline(); ++ cribbage_getline(); + } + i = (rand() >> 4) % CARDS; /* random cut */ + do { /* comp cuts deck */ +@@ -397,7 +397,7 @@ + if (!rflag) { /* random cut */ + msg(quiet ? "Cut the deck? " : + "How many cards down do you wish to cut the deck? "); +- getline(); ++ cribbage_getline(); + } + i = (rand() >> 4) % (CARDS - pos); + turnover = deck[i + pos]; +diff -Naur bsd-games-2.17/cribbage/io.c bsd-games-2.17.1/cribbage/io.c +--- bsd-games-2.17/cribbage/io.c 2004-12-07 07:34:21.000000000 -0600 ++++ bsd-games-2.17.1/cribbage/io.c 2010-05-22 10:51:23.000000000 -0500 +@@ -245,7 +245,7 @@ + + retval = FALSE; + rnk = sut = EMPTY; +- if (!(line = getline())) ++ if (!(line = cribbage_getline())) + goto gotit; + p = p1 = line; + while (*p1 != ' ' && *p1 != '\0') +@@ -346,7 +346,7 @@ + + for (sum = 0;;) { + msg(prompt); +- if (!(p = getline()) || *p == '\0') { ++ if (!(p = cribbage_getline()) || *p == '\0') { + msg(quiet ? "Not a number" : + "That doesn't look like a number"); + continue; +@@ -528,12 +528,12 @@ + } + + /* +- * getline: ++ * cribbage_getline: + * Reads the next line up to '\n' or EOF. Multiple spaces are + * compressed to one space; a space is inserted before a ',' + */ + char * +-getline() ++cribbage_getline() + { + char *sp; + int c, oy, ox; +diff -Naur bsd-games-2.17/gomoku/bdisp.c bsd-games-2.17.1/gomoku/bdisp.c +--- bsd-games-2.17/gomoku/bdisp.c 2003-12-16 20:47:37.000000000 -0600 ++++ bsd-games-2.17.1/gomoku/bdisp.c 2010-05-22 10:51:23.000000000 -0500 +@@ -241,7 +241,7 @@ + } + + int +-getline(buf, size) ++gomoku_getline(buf, size) + char *buf; + int size; + { +diff -Naur bsd-games-2.17/gomoku/gomoku.h bsd-games-2.17.1/gomoku/gomoku.h +--- bsd-games-2.17/gomoku/gomoku.h 2004-01-27 14:52:07.000000000 -0600 ++++ bsd-games-2.17.1/gomoku/gomoku.h 2010-05-22 10:51:23.000000000 -0500 +@@ -263,7 +263,7 @@ + + void bdinit(struct spotstr *); + void init_overlap(void); +-int getline(char *, int); ++int gomoku_getline(char *, int); + void ask(const char *); + void dislog(const char *); + void bdump(FILE *); +diff -Naur bsd-games-2.17/gomoku/main.c bsd-games-2.17.1/gomoku/main.c +--- bsd-games-2.17/gomoku/main.c 2004-01-27 14:52:07.000000000 -0600 ++++ bsd-games-2.17.1/gomoku/main.c 2010-05-22 10:51:23.000000000 -0500 +@@ -155,7 +155,7 @@ + if (inputfp == NULL && test == 0) { + for (;;) { + ask("black or white? "); +- getline(buf, sizeof(buf)); ++ gomoku_getline(buf, sizeof(buf)); + if (buf[0] == 'b' || buf[0] == 'B') { + color = BLACK; + break; +@@ -172,7 +172,7 @@ + } + } else { + setbuf(stdout, 0); +- getline(buf, sizeof(buf)); ++ gomoku_getline(buf, sizeof(buf)); + if (strcmp(buf, "black") == 0) + color = BLACK; + else if (strcmp(buf, "white") == 0) +@@ -244,7 +244,7 @@ + getinput: + if (interactive) + ask("move? "); +- if (!getline(buf, sizeof(buf))) { ++ if (!gomoku_getline(buf, sizeof(buf))) { + curmove = RESIGN; + break; + } +@@ -256,7 +256,7 @@ + FILE *fp; + + ask("save file name? "); +- (void)getline(buf, sizeof(buf)); ++ (void)gomoku_getline(buf, sizeof(buf)); + if ((fp = fopen(buf, "w")) == NULL) { + glog("cannot create save file"); + goto getinput; +@@ -309,14 +309,14 @@ + if (i != RESIGN) { + replay: + ask("replay? "); +- if (getline(buf, sizeof(buf)) && ++ if (gomoku_getline(buf, sizeof(buf)) && + (buf[0] == 'y' || buf[0] == 'Y')) + goto again; + if (strcmp(buf, "save") == 0) { + FILE *fp; + + ask("save file name? "); +- (void)getline(buf, sizeof(buf)); ++ (void)gomoku_getline(buf, sizeof(buf)); + if ((fp = fopen(buf, "w")) == NULL) { + glog("cannot create save file"); + goto replay; +@@ -367,7 +367,7 @@ + quit(); + top: + ask("cmd? "); +- if (!getline(fmtbuf, sizeof(fmtbuf))) ++ if (!gomoku_getline(fmtbuf, sizeof(fmtbuf))) + quit(); + switch (*fmtbuf) { + case '\0': diff --git a/gnu/packages/patches/bsd-games-null-check.patch b/gnu/packages/patches/bsd-games-null-check.patch new file mode 100644 index 0000000000..ba977c95bf --- /dev/null +++ b/gnu/packages/patches/bsd-games-null-check.patch @@ -0,0 +1,24 @@ +diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c +index 11f4c44..28321bc 100644 +--- a/hunt/hunt/hunt.c ++++ b/hunt/hunt/hunt.c +@@ -394,7 +394,8 @@ broadcast_vec(s, vector) + + vec_cnt = 0; + for (ip = ifp; ip; ip = ip->ifa_next) +- if ((ip->ifa_addr->sa_family == AF_INET) && ++ if (ip->ifa_addr && ++ (ip->ifa_addr->sa_family == AF_INET) && + (ip->ifa_flags & IFF_BROADCAST)) + vec_cnt++; + +@@ -405,7 +406,8 @@ broadcast_vec(s, vector) + + vec_cnt = 0; + for (ip = ifp; ip; ip = ip->ifa_next) +- if ((ip->ifa_addr->sa_family == AF_INET) && ++ if (ip->ifa_addr && ++ (ip->ifa_addr->sa_family == AF_INET) && + (ip->ifa_flags & IFF_BROADCAST)) + memcpy(&(*vector)[vec_cnt++], ip->ifa_broadaddr, + sizeof(struct sockaddr_in)); diff --git a/gnu/packages/patches/bsd-games-number.c-and-test.patch b/gnu/packages/patches/bsd-games-number.c-and-test.patch new file mode 100644 index 0000000000..1cf5ba2822 --- /dev/null +++ b/gnu/packages/patches/bsd-games-number.c-and-test.patch @@ -0,0 +1,183 @@ +Arch's patch, and a fix for the "number" game's test. +--- bsdgames-2.17.orig/number/number.c ++++ bsdgames-2.17/number/number.c +@@ -78,9 +78,9 @@ + + void convert(char *); + int main(int, char *[]); +-int number(const char *, int); +-void pfract(int); +-int unit(int, const char *); ++int number(const char *, int, int *); ++void pfract(int, int); ++int unit(int, const char *, int *); + void usage(void) __attribute__((__noreturn__)); + + int lflag; +@@ -131,7 +131,7 @@ + convert(line) + char *line; + { +- int flen, len, rval; ++ int flen, len, rval, singular; + char *p, *fraction; + + flen = 0; +@@ -174,7 +174,7 @@ + --len; + } + +- rval = len > 0 ? unit(len, line) : 0; ++ rval = len > 0 ? unit(len, line, &singular) : 0; + if (fraction != NULL && flen != 0) + for (p = fraction; *p != '\0'; ++p) + if (*p != '0') { +@@ -182,10 +182,10 @@ + (void)printf("%sand%s", + lflag ? " " : "", + lflag ? " " : "\n"); +- if (unit(flen, fraction)) { ++ if (unit(flen, fraction, &singular)) { + if (lflag) + (void)printf(" "); +- pfract(flen); ++ pfract(flen, singular); + rval = 1; + } + break; +@@ -197,9 +197,10 @@ + } + + int +-unit(len, p) ++unit(len, p, singular) + int len; + const char *p; ++ int *singular; + { + int off, rval; + +@@ -208,7 +209,7 @@ + if (len % 3) { + off = len % 3; + len -= off; +- if (number(p, off)) { ++ if (number(p, off, singular)) { + rval = 1; + (void)printf(" %s%s", + name3[len / 3], lflag ? " " : ".\n"); +@@ -217,14 +218,16 @@ + } + for (; len > 3; p += 3) { + len -= 3; +- if (number(p, 3)) { ++ if (number(p, 3, singular)) { + rval = 1; + (void)printf(" %s%s", + name3[len / 3], lflag ? " " : ".\n"); + } + } + } +- if (number(p, len)) { ++ if (number(p, len, singular)) { ++ if (rval) ++ *singular = 0; + if (!lflag) + (void)printf(".\n"); + rval = 1; +@@ -233,17 +236,20 @@ + } + + int +-number(p, len) ++number(p, len, singular) + const char *p; + int len; ++ int *singular; + { + int val, rval; + + rval = 0; ++ *singular = 1; + switch (len) { + case 3: + if (*p != '0') { + rval = 1; ++ *singular = 0; + (void)printf("%s hundred", name1[*p - '0']); + } + ++p; +@@ -262,33 +268,42 @@ + } + rval = 1; + } ++ if (val != 1) ++ *singular = 0; + break; + case 1: + if (*p != '0') { + rval = 1; + (void)printf("%s", name1[*p - '0']); + } ++ if (*p != '1') ++ *singular = 0; + } + return (rval); + } + + void +-pfract(len) ++pfract(len, singular) + int len; ++ int singular; + { + static const char *const pref[] = { "", "ten-", "hundred-" }; + + switch(len) { + case 1: +- (void)printf("tenths.\n"); ++ (void)printf("tenth"); + break; + case 2: +- (void)printf("hundredths.\n"); ++ (void)printf("hundredth"); + break; + default: +- (void)printf("%s%sths.\n", pref[len % 3], name3[len / 3]); ++ (void)printf("%s%sth", pref[len % 3], name3[len / 3]); + break; + } ++ if (!singular) { ++ printf("s"); ++ } ++ printf(".\n"); + } + + void +diff -Naur bsd-games-2.17/tests/number.-0.1 bsd-games-patch/tests/number.-0.1 +--- bsd-games-2.17/tests/number.-0.1 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/tests/number.-0.1 2020-04-17 15:14:27.831098084 +0700 +@@ -1,3 +1,3 @@ + minus + one. +-tenths. ++tenth. +diff -Naur bsd-games-2.17/tests/number.-0.2 bsd-games-patch/tests/number.-0.2 +--- bsd-games-2.17/tests/number.-0.2 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/tests/number.-0.2 2020-04-17 15:20:48.162336279 +0700 +@@ -0,0 +1,3 @@ ++minus ++two. ++tenths. +diff -Naur bsd-games-2.17/tests/number.test bsd-games-patch/tests/number.test +--- bsd-games-2.17/tests/number.test 1970-01-01 07:00:00.000000000 +0700 ++++ bsd-games-patch/tests/number.test 2020-04-17 15:20:22.774654155 +0700 +@@ -36,6 +36,8 @@ + testno 1 + number/number -- -0.1 >test.out 2>&1 || failtest + compare test.out tests/number.-0.1 ++number/number -- -0.2 >test.out 2>&1 || failtest ++compare test.out tests/number.-0.2 + rm -f test.out + + testno 2 diff --git a/gnu/packages/patches/bsd-games-prevent-name-collisions.patch b/gnu/packages/patches/bsd-games-prevent-name-collisions.patch new file mode 100644 index 0000000000..855ce59131 --- /dev/null +++ b/gnu/packages/patches/bsd-games-prevent-name-collisions.patch @@ -0,0 +1,13 @@ +There is already a "fish" shell. +diff -ur bsd-games-2.17.orig/fish/Makefrag bsd-games-2.17/fish/Makefrag +--- bsd-games-2.17.orig/fish/Makefrag 1970-01-01 07:00:01.000000000 +0700 ++++ bsd-games-2.17/fish/Makefrag 2020-08-06 19:18:43.204492847 +0700 +@@ -31,7 +31,7 @@ + fish_all: fish/fish fish/fish.instr fish/fish.6 + + fish_install: fish_all +- $(INSTALL_BINARY) fish/fish $(INSTALL_PREFIX)$(GAMESDIR)/fish ++ $(INSTALL_BINARY) fish/fish $(INSTALL_PREFIX)$(GAMESDIR)/fish-game + $(HIDE_GAME) fish + $(INSTALL_DATA) fish/fish.instr $(INSTALL_PREFIX)$(FISH_INSTRFILE) + $(INSTALL_MANUAL) fish/fish.6 diff --git a/gnu/packages/patches/bsd-games-stdio.h.patch b/gnu/packages/patches/bsd-games-stdio.h.patch new file mode 100644 index 0000000000..1c3a402042 --- /dev/null +++ b/gnu/packages/patches/bsd-games-stdio.h.patch @@ -0,0 +1,14 @@ +diff -ru a/include/stdio.h b/include/stdio.h +--- a/include/stdio.h 2000-08-04 10:24:39.000000000 +1000 ++++ b/include/stdio.h 2005-06-18 14:26:35.000000000 +1000 +@@ -34,6 +34,10 @@ + #include + #include_next + ++__BEGIN_DECLS ++ + #ifndef HAVE_fgetln + extern char *fgetln(FILE *stream, size_t *len); + #endif ++ ++__END_DECLS -- cgit v1.2.3 From 867e3830e6a3ee92317379e33d80c58a57107af4 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 23 Oct 2020 10:17:21 +0200 Subject: gnu: ungoogled-chromium: Add search path for installed extensions. * gnu/packages/patches/ungoogled-chromium-extension-search-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/chromium.scm (%guix-patches): New variable. (ungoogled-chromium-snippet): Apply %GUIX-PATCHES. (ungoogled-chromium)[arguments]: Don't hard-code extensions directory. [native-search-paths]: New field. --- gnu/local.mk | 1 + gnu/packages/chromium.scm | 18 +++++++------- .../ungoogled-chromium-extension-search-path.patch | 28 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 gnu/packages/patches/ungoogled-chromium-extension-search-path.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 2a994bd3b9..72f81a9913 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1653,6 +1653,7 @@ dist_patch_DATA = \ %D%/packages/patches/u-boot-riscv64-fix-extlinux.patch \ %D%/packages/patches/ucx-tcp-iface-ioctl.patch \ %D%/packages/patches/udiskie-no-appindicator.patch \ + %D%/packages/patches/ungoogled-chromium-extension-search-path.patch \ %D%/packages/patches/ungoogled-chromium-system-nspr.patch \ %D%/packages/patches/unison-fix-ocaml-4.08.patch \ %D%/packages/patches/unknown-horizons-python-3.8-distro.patch \ diff --git a/gnu/packages/chromium.scm b/gnu/packages/chromium.scm index f32a779805..b2191701df 100644 --- a/gnu/packages/chromium.scm +++ b/gnu/packages/chromium.scm @@ -334,6 +334,10 @@ (define %ungoogled-origin (base32 "18p9a7qffmy8m03nqva7maalgil13lj2mn0s56v3crbs4wk4lalj")))) +(define %guix-patches + (list (local-file (search-patch "ungoogled-chromium-system-nspr.patch")) + (local-file (search-patch "ungoogled-chromium-extension-search-path.patch")))) + ;; This is a source 'snippet' that does the following: ;; *) Applies various patches for unbundling purposes and libstdc++ compatibility. ;; *) Runs the ungoogled patch-, domain substitution-, and scrubbing scripts. @@ -356,9 +360,7 @@ (define ungoogled-chromium-snippet (invoke "patch" "-p1" "--force" "--input" patch "--no-backup-if-mismatch")) (append '#+%debian-patches '#+%arch-patches - '#+(list (local-file - (search-patch - "ungoogled-chromium-system-nspr.patch"))))) + '#+%guix-patches)) (with-directory-excursion #+%ungoogled-origin (format #t "Ungooglifying...~%") @@ -571,11 +573,6 @@ (define-public ungoogled-chromium (find-files (string-append "third_party/webrtc/modules" "/audio_coding/codecs/opus"))) - (substitute* "chrome/common/chrome_paths.cc" - (("/usr/share/chromium/extensions") - ;; TODO: Add ~/.guix-profile. - "/run/current-system/profile/share/chromium/extensions")) - ;; Many files try to include ICU headers from "third_party/icu/...". ;; Remove the "third_party/" prefix to use system headers instead. (substitute* (find-files "chrome" "\\.cc$") @@ -840,6 +837,11 @@ (define-public ungoogled-chromium ("udev" ,eudev) ("valgrind" ,valgrind) ("vulkan-headers" ,vulkan-headers))) + (native-search-paths + (list (search-path-specification + (variable "CHROMIUM_EXTENSION_DIRECTORY") + (separator #f) ;single entry + (files '("share/chromium/extensions"))))) ;; Building Chromium takes ... a very long time. On a single core, a busy ;; mid-end x86 system may need more than 24 hours to complete the build. diff --git a/gnu/packages/patches/ungoogled-chromium-extension-search-path.patch b/gnu/packages/patches/ungoogled-chromium-extension-search-path.patch new file mode 100644 index 0000000000..5ce219ccc7 --- /dev/null +++ b/gnu/packages/patches/ungoogled-chromium-extension-search-path.patch @@ -0,0 +1,28 @@ +Look for extensions in $CHROMIUM_EXTENSION_DIRECTORY instead of +/usr/share/chromium/extensions. + +--- a/chrome/common/chrome_paths.cc ++++ b/chrome/common/chrome_paths.cc +@@ -4,6 +4,7 @@ + + #include "chrome/common/chrome_paths.h" + ++#include "base/environment.h" + #include "base/files/file_util.h" + #include "base/logging.h" + #include "base/native_library.h" +@@ -511,7 +512,13 @@ + #endif + #if defined(OS_LINUX) || defined(OS_CHROMEOS) + case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: { +- cur = base::FilePath(kFilepathSinglePrefExtensions); ++ std::unique_ptr environment(base::Environment::Create()); ++ std::string extension_dir; ++ if (environment->GetVar("CHROMIUM_EXTENSION_DIRECTORY", &extension_dir)) { ++ cur = base::FilePath(extension_dir); ++ } else { ++ cur = base::FilePath(kFilepathSinglePrefExtensions); ++ } + break; + } + #endif -- cgit v1.2.3 From d814246e2ebc4bb65d3714fcd9a6285553a8c092 Mon Sep 17 00:00:00 2001 From: raingloom Date: Sat, 17 Oct 2020 20:57:57 +0200 Subject: gnu: Add yggdrasil. * gnu/packages/networking.scm (yggdrasil): New variable. * gnu/packages/patches/yggdrasil-extra-config.patch: New file. * gnu/local.mk (dist_PATCH_DATA): Add it. Signed-off-by: Julien Lepiller --- gnu/local.mk | 1 + gnu/packages/networking.scm | 95 +++++++++++++++++++++++ gnu/packages/patches/yggdrasil-extra-config.patch | 86 ++++++++++++++++++++ 3 files changed, 182 insertions(+) create mode 100644 gnu/packages/patches/yggdrasil-extra-config.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 72f81a9913..3a8f1e30fc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1725,6 +1725,7 @@ dist_patch_DATA = \ %D%/packages/patches/xsane-fix-snprintf-buffer-length.patch \ %D%/packages/patches/xsane-support-ipv6.patch \ %D%/packages/patches/xsane-tighten-default-umask.patch \ + %D%/packages/patches/yggdrasil-extra-config.patch \ %D%/packages/patches/zziplib-CVE-2018-16548.patch MISC_DISTRO_FILES = \ diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index fefb9a5bf8..f94c3e410f 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -97,6 +97,7 @@ (define-module (gnu packages networking) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gnupg) + #:use-module (gnu packages golang) #:use-module (gnu packages graphviz) #:use-module (gnu packages gstreamer) #:use-module (gnu packages gtk) @@ -3821,3 +3822,97 @@ (define-public nbd client and server. It allows you to use remote block devices over a TCP/IP network.") (license license:gpl2))) + +(define-public yggdrasil + (package + (name "yggdrasil") + (version "0.3.15") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/yggdrasil-network/yggdrasil-go") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0gk7gy8yq5nrnblv4imxzzm2hac4ri0hlw19ajfbc1zll5kj32gf")) + (patches (search-patches "yggdrasil-extra-config.patch")))) + (build-system go-build-system) + (arguments + '(#:import-path "github.com/yggdrasil-network/yggdrasil-go" + ;; TODO: figure out how tests are run + #:tests? #f + #:install-source? #f + #:phases (modify-phases %standard-phases + (replace 'build + (lambda _ + (for-each + (lambda (c) + (invoke + "go" "build" "-v" "-ldflags=-s -w" + (string-append + "github.com/yggdrasil-network/yggdrasil-go/cmd/" c))) + (list "yggdrasil" "yggdrasilctl")) + #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin/")) + (doc (string-append out "/share/doc/yggdrasil/"))) + (mkdir-p bin) + (for-each + (lambda (f) + (install-file f bin)) + (list "yggdrasil" "yggdrasilctl")) + (mkdir-p doc) + (copy-recursively + (string-append + "src/github.com/yggdrasil-network/yggdrasil-go/" + "doc/yggdrasil-network.github.io") + doc)) + #t))))) + ;; https://github.com/kardianos/minwinsvc is windows only + (propagated-inputs + `(("go-github-com-arceliar-phony" ,go-github-com-arceliar-phony) + ("go-github-com-cheggaaa-pb" ,go-github-com-cheggaaa-pb) + ("go-github-com-gologme-log" ,go-github-com-gologme-log) + ("go-github-com-hashicorp-go-syslog" ,go-github-com-hashicorp-go-syslog) + ("go-github-com-hjson-hjson-go" ,go-github-com-hjson-hjson-go) + ("go-github-com-kardianos-minwinsvc" ,go-github-com-kardianos-minwinsvc) + ("go-github-com-mitchellh-mapstructure" + ,go-github-com-mitchellh-mapstructure) + ("go-golang-org-x-crypto" ,go-golang-org-x-crypto) + ("go-golang-org-x-net" ,go-golang-org-x-net) + ("go-golang-org-x-text" ,go-golang-org-x-text) + ("go-golang-zx2c4-com-wireguard" ,go-golang-zx2c4-com-wireguard) + ("go-netlink" ,go-netlink) + ("go-netns" ,go-netns))) + (home-page "https://yggdrasil-network.github.io/blog.html") + (synopsis + "Experiment in scalable routing as an encrypted IPv6 overlay network") + (description + "Yggdrasil is an early-stage implementation of a fully end-to-end encrypted +IPv6 network. It is lightweight, self-arranging, supported on multiple +platforms and allows pretty much any IPv6-capable application to communicate +securely with other Yggdrasil nodes. Yggdrasil does not require you to have +IPv6 Internet connectivity - it also works over IPv4.") + (license + ;; As a special exception to the GNU Lesser General Public License + ;; version 3 ("LGPL3"), the copyright holders of this Library give you + ;; permission to convey to a third party a Combined Work that links + ;; statically or dynamically to this Library without providing any Minimal + ;; Corresponding Source or Minimal Application Code as set out in 4d or + ;; providing the installation information set out in section 4e, provided + ;; that you comply with the other provisions of LGPL3 and provided that you + ;; meet, for the Application the terms and conditions of the license(s) + ;; which apply to the Application. Except as stated in this special + ;; exception, the provisions of LGPL3 will continue to comply in full to + ;; this Library. If you modify this Library, you may apply this exception + ;; to your version of this Library, but you are not obliged to do so. If + ;; you do not wish to do so, delete this exception statement from your + ;; version. This exception does not (and cannot) modify any license terms + ;; which apply to the Application, with which you must still comply + license:lgpl3))) diff --git a/gnu/packages/patches/yggdrasil-extra-config.patch b/gnu/packages/patches/yggdrasil-extra-config.patch new file mode 100644 index 0000000000..c21ca29a84 --- /dev/null +++ b/gnu/packages/patches/yggdrasil-extra-config.patch @@ -0,0 +1,86 @@ +diff --git a/cmd/yggdrasil/main.go b/cmd/yggdrasil/main.go +index 813e950..08d35cc 100644 +--- a/cmd/yggdrasil/main.go ++++ b/cmd/yggdrasil/main.go +@@ -40,11 +40,12 @@ type node struct { + admin module.Module // admin.AdminSocket + } + +-func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config.NodeConfig { ++func readConfig(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 +@@ -56,6 +57,21 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config + if err != nil { + panic(err) + } ++ if *extraconffile != "" { ++ extraconf, err = ioutil.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 := config.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 +@@ -69,11 +85,6 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config + 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 := config.GenerateConfig() + var dat map[string]interface{} + if err := hjson.Unmarshal(conf, &dat); err != nil { + panic(err) +@@ -112,6 +123,7 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config + if err = mapstructure.Decode(dat, &cfg); err != nil { + panic(err) + } ++ }} + return cfg + } + +@@ -164,6 +176,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") + 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)") +@@ -187,7 +200,7 @@ func main() { + cfg = config.GenerateConfig() + case *useconffile != "" || *useconf: + // Read the configuration from either stdin or from the filesystem +- cfg = readConfig(useconf, useconffile, normaliseconf) ++ cfg = readConfig(useconf, useconffile, extraconffile, 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 +@@ -332,7 +345,7 @@ func main() { + goto exit + case _ = <-r: + if *useconffile != "" { +- cfg = readConfig(useconf, useconffile, normaliseconf) ++ cfg = readConfig(useconf, useconffile, extraconffile, normaliseconf) + logger.Infoln("Reloading configuration from", *useconffile) + n.core.UpdateConfig(cfg) + n.tuntap.UpdateConfig(cfg) -- cgit v1.2.3