Package: guix-patches;
Reported by: Zhu Zihao <all_but_last <at> 163.com>
Date: Wed, 10 Nov 2021 12:37:02 UTC
Severity: normal
Tags: patch
Done: Oleg Pykhalov <go.wigust <at> gmail.com>
Bug is archived. No further changes may be made.
Message #62 received at 51747 <at> debbugs.gnu.org (full text, mbox):
From: Zhu Zihao <all_but_last <at> 163.com> To: Maxime Devos <maximedevos <at> telenet.be> Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, 51747 <at> debbugs.gnu.org Subject: Re: [bug#51747] [PATCH]: gnu: nix: Update to 2.4. Date: Sat, 15 Jan 2022 00:51:29 +0800
[Message part 1 (text/plain, inline)]
Patches updated. The test is disabled by default, when I tried enable it test it fails, It looks like that the RPATH of test binary is not complete. Just leave it disabled. I have no idea to give user a hint of differnce between cpuid and libcpuid. Maybe add a comment or add it to description. But I don't think user can find these hints in first sight.
[signature.asc (application/pgp-signature, inline)]
[0001-gnu-Add-libcpuid.patch (text/x-patch, inline)]
From 0de84768a9d5f46d25d9442e8d1fbad4b55674b9 Mon Sep 17 00:00:00 2001 From: Zhu Zihao <all_but_last <at> 163.com> Date: Tue, 11 Jan 2022 22:56:14 +0800 Subject: [PATCH 1/6] gnu: Add libcpuid. * gnu/packages/hardware.scm (libcpuid): New variable. --- gnu/packages/hardware.scm | 49 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm index 8727f0f20a..e5a2c5c13f 100644 --- a/gnu/packages/hardware.scm +++ b/gnu/packages/hardware.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2021 Raghav Gururajan <rg <at> raghavgururajan.name> ;;; Copyright © 2021 Vinicius Monego <monego <at> posteo.net> ;;; Copyright © 2021, 2022 John Kehayias <john.kehayias <at> protonmail.com> +;;; Copyright © 2022 Zhu Zihao <all_but_last <at> 163.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -70,7 +71,8 @@ (define-module (gnu packages hardware) #:use-module (guix svn-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) - #:use-module (guix utils)) + #:use-module (guix utils) + #:use-module (srfi srfi-1)) ;; This is a module for packages related to physical hardware that don't (yet) ;; have a more specific home like gps.scm, security-token.scm, &c. @@ -953,3 +955,48 @@ (define-public tpm2-tss libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm and libtss2-tcti-mssim.") (license license:bsd-2))) + +(define-public libcpuid + ;; We need to remove blobs from the source, first we have to isolate the blob + ;; source in build system. + ;; See https://github.com/anrieff/libcpuid/pull/159. + (let ((commit "2e61160983f32ba840b2246d3c3850c44626ab0d") + (revision "1")) + (package + (name "libcpuid") + (version (git-version "0.5.1" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/anrieff/libcpuid") + (commit commit))) + (sha256 + (base32 "1mphvkiqq6z33sq6i490fq27sbyylacwrf8bg7ccvpcjms208sww")) + (modules '((guix build utils))) + (snippet + ;; Now remove blobs. + #~(begin + (delete-file "libcpuid/msrdriver.c") + (delete-file-recursively "contrib/MSR Driver"))) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (arguments + (list + #:tests? #f ;no test + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'absolutize + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "libcpuid/rdmsr.c" + (("modprobe") + (search-input-file inputs "bin/modprobe")))))))) + (inputs (list kmod)) + (supported-systems + (filter (lambda (t) (or (target-x86-64? t) (target-x86-32? t))) + %supported-systems)) + (home-page "https://libcpuid.sourceforge.net/") + (synopsis "Small library for x86 CPU detection and feature extraction") + (description "Libcpuid is a small C library to get vendor, model, branding +string, code name and other information from x86 CPU.") + (license license:bsd-2)))) -- 2.34.0
[0002-gnu-lowdown-Update-to-0.10.0-1-1de10c1.patch (text/x-patch, inline)]
From a89d730d8422e703293d4569c15f4e1ede6e0d28 Mon Sep 17 00:00:00 2001 From: Zhu Zihao <all_but_last <at> 163.com> Date: Tue, 11 Jan 2022 23:01:38 +0800 Subject: [PATCH 2/6] gnu: lowdown: Update to 0.10.0-1-1de10c1. * gnu/packages/markup.scm (lowdown): Update to 0.10.0-1-1de10c1. --- gnu/packages/markup.scm | 60 ++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/gnu/packages/markup.scm b/gnu/packages/markup.scm index 5f2f525cd2..563ad1e8e1 100644 --- a/gnu/packages/markup.scm +++ b/gnu/packages/markup.scm @@ -119,34 +119,40 @@ (define-public markdown "See License.text in the distribution.")))) (define-public lowdown - (package - (name "lowdown") - (version "0.10.0") - (source - (origin - (method url-fetch) - (uri (string-append "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-" - version ".tar.gz")) - (sha256 - (base32 "15v2kk4ffqw3n6y6n9plch4qcib3ynnhw0ih8wn2v9qgn4jssp5p")))) - (build-system gnu-build-system) - (arguments - `(#:test-target "regress" - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (invoke "./configure" - (string-append "PREFIX=" out) - (string-append "MANDIR=" out "/share/man")))))))) - (native-inputs - (list which)) - (home-page "https://kristaps.bsd.lv/lowdown/") - (synopsis "Simple Markdown translator") - (description "Lowdown is a Markdown translator producing HTML5, + (let ((commit "1de10c1d71bfb4348ae0beaec8b1547d5e114969") + (revision "1")) + (package + (name "lowdown") + (version (git-version "0.10.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/kristapsdz/lowdown") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1wh07nkiihvp1m79sj4qlnqklnn0rfp3hwls8sqcp0bfd96wpa1h")))) + (build-system gnu-build-system) + (arguments + `(#:test-target "regress" + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (invoke "./configure" + (string-append "PREFIX=" out) + (string-append "MANDIR=" out "/share/man")))))) + #:make-flags '("CFLAGS=-fPIC")))) + + (native-inputs + (list which)) + (home-page "https://kristaps.bsd.lv/lowdown/") + (synopsis "Simple Markdown translator") + (description "Lowdown is a Markdown translator producing HTML5, roff documents in the ms and man formats, LaTeX, gemini, and terminal output.") - (license license:isc))) + (license license:isc)))) (define-public discount (package -- 2.34.0
[0003-gnu-lowdown-Use-G-expression.patch (text/x-patch, inline)]
From 20f81d5df49aed828453c70bf48f73f46ea243ba Mon Sep 17 00:00:00 2001 From: Zhu Zihao <all_but_last <at> 163.com> Date: Wed, 12 Jan 2022 00:52:25 +0800 Subject: [PATCH 3/6] gnu: lowdown: Use G-expression. * gnu/packages/markup.scm(lowdown)[arguments]: Convert to G-expression. --- gnu/packages/markup.scm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gnu/packages/markup.scm b/gnu/packages/markup.scm index 563ad1e8e1..7a776b9101 100644 --- a/gnu/packages/markup.scm +++ b/gnu/packages/markup.scm @@ -29,6 +29,7 @@ (define-module (gnu packages markup) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) @@ -135,17 +136,16 @@ (define-public lowdown (base32 "1wh07nkiihvp1m79sj4qlnqklnn0rfp3hwls8sqcp0bfd96wpa1h")))) (build-system gnu-build-system) (arguments - `(#:test-target "regress" - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (invoke "./configure" - (string-append "PREFIX=" out) - (string-append "MANDIR=" out "/share/man")))))) - #:make-flags '("CFLAGS=-fPIC")))) - + (list + #:test-target "regress" + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda _ + (invoke "./configure" + (string-append "PREFIX=" #$output) + (string-append "MANDIR=" #$output "/share/man"))))) + #:make-flags #~(list "CFLAGS=-fPIC"))) (native-inputs (list which)) (home-page "https://kristaps.bsd.lv/lowdown/") -- 2.34.0
[0004-gnu-nix-Update-to-2.4.patch (text/x-patch, inline)]
From dcabfb785372d0b0af11e75d62896522f42ec359 Mon Sep 17 00:00:00 2001 From: Zhu Zihao <all_but_last <at> 163.com> Date: Tue, 11 Jan 2022 23:10:01 +0800 Subject: [PATCH 4/6] gnu: nix: Update to 2.4. * gnu/packages/package-management.scm (nix): Update to 2.4. [source]: Switch to Github repository since upstream no longer provides tarball. [native-inputs]: Add autoconf, autoconf-archive, automake, bison, flex, gcc, googletest, jq, libtool. [inputs]: Add libarchive, libcpuid, lowdown, zlib. * gnu/packages/patches/nix-dont-build-html-doc.diff: New file. * gnu/local.mk(dist_patch_DATA): Add corresponding entry. --- gnu/local.mk | 1 + gnu/packages/package-management.scm | 66 +++++++++++++------ .../patches/nix-dont-build-html-doc.diff | 26 ++++++++ 3 files changed, 73 insertions(+), 20 deletions(-) create mode 100644 gnu/packages/patches/nix-dont-build-html-doc.diff diff --git a/gnu/local.mk b/gnu/local.mk index feadac4bad..9284212f01 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1515,6 +1515,7 @@ dist_patch_DATA = \ %D%/packages/patches/nettle-3.5-check-_pkcs1_sec_decrypt-msg-len.patch \ %D%/packages/patches/nettle-3.5-CVE-2021-3580-pt1.patch \ %D%/packages/patches/nettle-3.5-CVE-2021-3580-pt2.patch \ + %D%/packages/patches/nix-dont-build-html-doc.diff \ %D%/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch \ %D%/packages/patches/ngircd-handle-zombies.patch \ %D%/packages/patches/ngless-unliftio.patch \ diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 8a4f5155ed..03f741dc2c 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2021 Ivan Gankevich <i.gankevich <at> spbu.ru> ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> ;;; Copyright © 2021 John Kehayias <john.kehayias <at> protonmail.com> +;;; Copyright © 2022 Zhu Zihao <all_but_last <at> 163.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -62,6 +63,8 @@ (define-module (gnu packages package-management) #:use-module (gnu packages dbm) #:use-module (gnu packages docbook) #:use-module (gnu packages file) + #:use-module (gnu packages flex) + #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) @@ -70,6 +73,7 @@ (define-module (gnu packages package-management) #:use-module (gnu packages gtk) #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) + #:use-module (gnu packages hardware) #:use-module (gnu packages hurd) #:use-module (gnu packages imagemagick) #:use-module (gnu packages less) @@ -77,6 +81,7 @@ (define-module (gnu packages package-management) #:use-module (gnu packages linux) #:use-module (gnu packages lisp) #:use-module (gnu packages man) + #:use-module (gnu packages markup) #:use-module (gnu packages nettle) #:use-module (gnu packages networking) #:use-module (gnu packages ninja) @@ -657,14 +662,18 @@ (define-public guix-icons (define-public nix (package (name "nix") - (version "2.3.16") - (source (origin - (method url-fetch) - (uri (string-append "https://releases.nixos.org/nix/nix-" - version "/nix-" version ".tar.xz")) - (sha256 - (base32 - "1g5aqavr6i3c1xln53w1pdh1kvlxrpnknb105m4jbd85kyv83rky")))) + (version "2.4") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "http://github.com/NixOS/nix") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1abgfw5ndqklm0x533li32l4azifz3f6lhaxm6s74b704043r7m2")) + (patches + (search-patches "nix-dont-build-html-doc.diff")))) (build-system gnu-build-system) (arguments `(#:configure-flags '("--sysconfdir=/etc" "--enable-gc") @@ -680,18 +689,35 @@ (define-public nix (string-append "sysconfdir=" etc) (string-append "profiledir=" etc "/profile.d") make-flags))))))) - (native-inputs (list pkg-config)) - (inputs (list boost - brotli - bzip2 - curl - editline - libgc - libseccomp - libsodium - openssl - sqlite - xz)) + (native-inputs + (list autoconf + autoconf-archive + automake + bison + flex + googletest + jq + libtool + pkg-config)) + (inputs + (append (list boost + brotli + bzip2 + curl + editline + libarchive + libgc + libseccomp + libsodium + lowdown + openssl + sqlite + xz + zlib) + (if (or (target-x86-64?) + (target-x86-32?)) + (list libcpuid) + '()))) (home-page "https://nixos.org/nix/") (synopsis "The Nix package manager") (description diff --git a/gnu/packages/patches/nix-dont-build-html-doc.diff b/gnu/packages/patches/nix-dont-build-html-doc.diff new file mode 100644 index 0000000000..79142bc215 --- /dev/null +++ b/gnu/packages/patches/nix-dont-build-html-doc.diff @@ -0,0 +1,26 @@ +"--enable-doc-gen" configure flag will enable HTML document generation that requires mdbook. +We can't simply disable it because we need manpages. + +Author: Zhu Zihao <all_but_last <at> 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 + $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-builtins > $@.tmp + @mv $@.tmp $@ + +-# Generate the HTML manual. +-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 + 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 + + endif -- 2.34.0
[0005-gnu-nix-Use-G-expression.patch (text/x-patch, inline)]
From 25b4055977e28a3efc8f0ee4af2906e4e923c7d9 Mon Sep 17 00:00:00 2001 From: Zhu Zihao <all_but_last <at> 163.com> Date: Wed, 12 Jan 2022 00:42:32 +0800 Subject: [PATCH 5/6] gnu: nix: Use G-expression. * gnu/packages/package-management.scm (nix)[arguments]: Convert to G-expression. --- gnu/packages/package-management.scm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 03f741dc2c..594d6e9d4b 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -676,19 +676,19 @@ (define-public nix (search-patches "nix-dont-build-html-doc.diff")))) (build-system gnu-build-system) (arguments - `(#:configure-flags '("--sysconfdir=/etc" "--enable-gc") - #:phases - (modify-phases %standard-phases - (replace 'install - ;; Don't try & fail to create subdirectories in /etc, but keep them - ;; in the output as examples. - (lambda* (#:key (make-flags '()) outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (etc (string-append out "/etc"))) - (apply invoke "make" "install" - (string-append "sysconfdir=" etc) - (string-append "profiledir=" etc "/profile.d") - make-flags))))))) + (list + #:configure-flags #~(list "--sysconfdir=/etc" "--enable-gc") + #:phases + #~(modify-phases %standard-phases + (replace 'install + ;; Don't try & fail to create subdirectories in /etc, but keep them + ;; in the output as examples. + (lambda* (#:key (make-flags '()) outputs #:allow-other-keys) + (let ((etc (string-append #$output "/etc"))) + (apply invoke "make" "install" + (string-append "sysconfdir=" etc) + (string-append "profiledir=" etc "/profile.d") + make-flags))))))) (native-inputs (list autoconf autoconf-archive -- 2.34.0
[0006-gnu-nix-Update-to-2.5.1.patch (text/x-patch, inline)]
From d81e689fa1acd5eb4a2fee325609216a24a9b887 Mon Sep 17 00:00:00 2001 From: Zhu Zihao <all_but_last <at> 163.com> Date: Fri, 14 Jan 2022 17:30:22 +0800 Subject: [PATCH 6/6] gnu: nix: Update to 2.5.1. * gnu/packages/package-management.scm(nix): Update to 2.5.1. --- gnu/packages/package-management.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 594d6e9d4b..9882f0a411 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -662,7 +662,7 @@ (define-public guix-icons (define-public nix (package (name "nix") - (version "2.4") + (version "2.5.1") (source (origin (method git-fetch) @@ -671,7 +671,7 @@ (define-public nix (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1abgfw5ndqklm0x533li32l4azifz3f6lhaxm6s74b704043r7m2")) + (base32 "1m8rmv8i6lg83pmalvjlq1fn8mcghn3ngjv3kw1kqsa45ymj5sqq")) (patches (search-patches "nix-dont-build-html-doc.diff")))) (build-system gnu-build-system) -- 2.34.0
[Message part 9 (text/plain, inline)]
-- Retrieve my PGP public key: gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F Zihao
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.