unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: jgart via Guix-patches via <guix-patches@gnu.org>
To: 63893@debbugs.gnu.org
Cc: jgart <jgart@dismail.de>, Zhu Zihao <all_but_last@163.com>
Subject: [bug#63893] [PATCH v3 2/2] gnu: nix: Update to 2.16.1.
Date: Sun, 11 Jun 2023 09:29:26 -0500	[thread overview]
Message-ID: <1bb01ed6f9710f2cb8cdaac882154de33f56c971.1686493692.git.jgart@dismail.de> (raw)
In-Reply-To: <c7d35f4b59192643a00aeb9d357ec425f8fb5867.1686493692.git.jgart@dismail.de>

* gnu/packages/package-management.scm (nix): Update to 2.16.1.
[source]: Use HTTPS for package source.
[inputs]: Add nlohmann-json.
[native-inputs]: Add rapidcheck.
[arguments]<#:phases>: In phase "check", change the value of environment
variable  "NIX_STORE" to "/nix/store" temporarily.

* gnu/packages/patches/nix-dont-build-html-doc.diff: Update.

Co-authored-by: jgart <jgart@dismail.de>
---

Oops v3, forgot to add in the actual changes that were in the staging area ;()

 gnu/packages/package-management.scm           | 28 ++++++++++++----
 .../patches/nix-dont-build-html-doc.diff      | 33 ++++++++++++++-----
 2 files changed, 47 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 4791880375..bd989405c2 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -20,7 +20,8 @@
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
 ;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
-;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2022, 2023 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2023 jgart <jgart@dismail.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -56,6 +57,7 @@ (define-module (gnu packages package-management)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages cpio)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages databases)
@@ -731,16 +733,16 @@ (define-public guix-modules
 (define-public nix
   (package
     (name "nix")
-    (version "2.5.1")
+    (version "2.16.1")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "http://github.com/NixOS/nix")
+             (url "https://github.com/NixOS/nix")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1m8rmv8i6lg83pmalvjlq1fn8mcghn3ngjv3kw1kqsa45ymj5sqq"))
+        (base32 "1rca8ljd33dmvh9bqk6sy1zxk97aawcr6k1f7hlm4d1cd9mrcw7x"))
        (patches
         (search-patches "nix-dont-build-html-doc.diff"))))
     (build-system gnu-build-system)
@@ -757,7 +759,19 @@ (define-public nix
                 (apply invoke "make" "install"
                        (string-append "sysconfdir=" etc)
                        (string-append "profiledir=" etc "/profile.d")
-                       make-flags)))))))
+                       make-flags))))
+          (replace 'check
+            (lambda args
+              ;; Some test expect environment variable NIX_STORE to be
+              ;; "/nix/store"
+              (let ((original-NIX_STORE (getenv "NIX_STORE")))
+                (dynamic-wind
+                  (lambda ()
+                    (setenv "NIX_STORE" "/nix/store"))
+                  (lambda ()
+                    (apply (assoc-ref %standard-phases 'check) args))
+                  (lambda ()
+                    (setenv "NIX_STORE" original-NIX_STORE)))))))))
     (native-inputs
      (list autoconf
            autoconf-archive
@@ -767,7 +781,8 @@ (define-public nix
            googletest
            jq
            libtool
-           pkg-config))
+           pkg-config
+           rapidcheck))
     (inputs
      (append (list boost
                    brotli
@@ -779,6 +794,7 @@ (define-public nix
                    libseccomp
                    libsodium
                    lowdown
+                   nlohmann-json
                    openssl
                    sqlite
                    xz
diff --git a/gnu/packages/patches/nix-dont-build-html-doc.diff b/gnu/packages/patches/nix-dont-build-html-doc.diff
index 79142bc215..2eb45117b0 100644
--- a/gnu/packages/patches/nix-dont-build-html-doc.diff
+++ b/gnu/packages/patches/nix-dont-build-html-doc.diff
@@ -3,24 +3,41 @@ We can't simply disable it because we need manpages.
 
 Author: Zhu Zihao <all_but_last@163.com>
 
-diff --git a/doc/manual/local.mk b/doc/manual/local.mk
-index e43d9f2fb..c323d1847 100644
 --- a/doc/manual/local.mk
 +++ b/doc/manual/local.mk
-@@ -69,8 +69,6 @@ $(d)/builtins.json: $(bindir)/nix
+@@ -138,11 +138,6 @@
  	$(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-builtins > $@.tmp
  	@mv $@.tmp $@
  
 -# Generate the HTML manual.
+-.PHONY: manual-html
+-manual-html: $(docdir)/manual/index.html
 -install: $(docdir)/manual/index.html
- 
+-
  # Generate 'nix' manpages.
  install: $(mandir)/man1/nix3-manpages
-@@ -94,7 +92,5 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
+ man: doc/manual/generated/man1/nix3-manpages
+@@ -167,23 +162,4 @@
  	done
  	@touch $@
  
--$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/command-ref/conf-file.md $(d)/src/expressions/builtins.md $(call rwildcard, $(d)/src, *.md)
--	$(trace-gen) RUST_LOG=warn mdbook build doc/manual -d $(DESTDIR)$(docdir)/manual
- 
+-$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/contributing/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md
+-	$(trace-gen) \
+-		tmp="$$(mktemp -d)"; \
+-		cp -r doc/manual "$$tmp"; \
+-		find "$$tmp" -name '*.md' | while read -r file; do \
+-			$(call process-includes,$$file,$$file); \
+-		done; \
+-		find "$$tmp" -name '*.md' | while read -r file; do \
+-			docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/src)"; \
+-			sed -i "s,@docroot@,$$docroot,g" "$$file"; \
+-		done; \
+-		set -euo pipefail; \
+-		RUST_LOG=warn mdbook build "$$tmp/manual" -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
+-			| { grep -Fv "because fragment resolution isn't implemented" || :; }; \
+-		rm -rf "$$tmp/manual"
+-	@rm -rf $(DESTDIR)$(docdir)/manual
+-	@mv $(DESTDIR)$(docdir)/manual.tmp/html $(DESTDIR)$(docdir)/manual
+-	@rm -rf $(DESTDIR)$(docdir)/manual.tmp
+-
  endif
-- 
2.40.1





  reply	other threads:[~2023-06-11 14:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-04 16:29 [bug#63893] [PATCH]: gnu: nix: Update to 2.16.0 Zhu Zihao
     [not found] ` <handler.63893.B.168589626726853.ack@debbugs.gnu.org>
2023-06-04 16:37   ` [bug#63893] Acknowledgement ([PATCH]: gnu: nix: Update to 2.16.0.) Zhu Zihao
2023-06-04 16:41 ` [bug#63893] [PATCH 1/3] gnu: Add rapidcheck Zhu Zihao
2023-06-04 16:34   ` [bug#63893] [PATCH 3/3] gnu: nix: Use HTTPS for package source Zhu Zihao
2023-06-04 16:43   ` [bug#63893] [PATCH 2/3] gnu: nix: Update to 2.16.0 Zhu Zihao
2023-06-11 14:11 ` [bug#63893] [PATCH v2 1/2] gnu: Add rapidcheck jgart via Guix-patches via
2023-06-11 14:11   ` [bug#63893] [PATCH v2 2/2] gnu: nix: Update to 2.16.1 jgart via Guix-patches via
2023-06-13  9:17     ` Zhu Zihao
2023-06-11 14:29 ` [bug#63893] [PATCH v3 1/2] gnu: Add rapidcheck jgart via Guix-patches via
2023-06-11 14:29   ` jgart via Guix-patches via [this message]
2023-06-19 15:47     ` [bug#63893] [PATCH v3 2/2] gnu: nix: Update to 2.16.1 Zhu Zihao
2023-06-24 17:12     ` jgart via Guix-patches via
2023-06-24 17:20     ` jgart via Guix-patches via
2023-06-24 19:34       ` Sergey Trofimov
2023-06-25  3:01       ` jgart via Guix-patches via
2023-06-26 21:41 ` [bug#63893] " jgart via Guix-patches via
2023-06-26 22:16   ` Sergei Trofimovich
2023-06-27  6:03   ` jgart via Guix-patches via
2023-06-27  7:05     ` Sergei Trofimovich
2023-07-12  4:00 ` bug#63893: [PATCH v3 2/2] " jgart via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bb01ed6f9710f2cb8cdaac882154de33f56c971.1686493692.git.jgart@dismail.de \
    --to=guix-patches@gnu.org \
    --cc=63893@debbugs.gnu.org \
    --cc=all_but_last@163.com \
    --cc=jgart@dismail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).