[PATCH]: gnu: nix: Update to 2.4.

  • Done
  • quality assurance status badge
Details
3 participants
  • Zhu Zihao
  • Oleg Pykhalov
  • Maxime Devos
Owner
unassigned
Submitted by
Zhu Zihao
Severity
normal
Z
Z
Zhu Zihao wrote on 10 Nov 2021 13:35
[PATCH]: gnu: nix: Update to 2.4.
(address . guix-patches@gnu.org)
86sfw4chme.fsf@163.com

-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQTUepyLKuOQW1Y9kTW+QrNSqfaCHwUCYYu8yRUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQvkKzUqn2gh+VNQD+Mrga/R7+dhV1gEPnF4VhRZgqYG4S
th6FkmqX+k2AqjUA/iBREkIaRWxSrDXMtsPfhMGIPSerKQmQN6J3hl6Z+z8L
=F8Cz
-----END PGP SIGNATURE-----

From 935afdd36fee52fe3930991245ac67e48c0a00ff Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Wed, 10 Nov 2021 19:21:45 +0800
Subject: [PATCH 1/3] gnu: Add lowdown.

* gnu/packages/markup.scm(lowdown): New variables.
---
gnu/packages/markup.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/markup.scm b/gnu/packages/markup.scm
index 368976bfde..4ec606f892 100644
--- a/gnu/packages/markup.scm
+++ b/gnu/packages/markup.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020 EuAndreh <eu@euandre.org>
;;; Copyright © 2021 Noisytoot <noisytoot@disroot.org>
+;;; Copyright © 2021 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -36,6 +37,7 @@ (define-module (gnu packages markup)
#:use-module (guix utils)
#:use-module (gnu packages compression)
#:use-module (gnu packages)
+ #:use-module (gnu packages base)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
@@ -324,3 +326,35 @@ (define-public python-mistletoe
swap out renderers for different output formats, without touching any of the
core components.")
(license expat)))
+
+(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
+ `(#:tests? #f ;No test
+ #: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"))))))
+ ;; the shared library of nix is linked with lowdown.
+ #:make-flags '("CFLAGS=-fPIC")))
+ (native-inputs
+ `(("which" ,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 isc)))
--
2.33.1
From d38e131913a006d47d611ce6ebabfb1823d804b8 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Wed, 10 Nov 2021 19:31:28 +0800
Subject: [PATCH 2/3] gnu: Add libcpuid.

gnu/packages/hardware.scm(libcpuid): New variable.
---
gnu/packages/hardware.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 2bf3576d5a..df7fb4b716 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2021 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -834,3 +835,22 @@ (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
+ (package
+ (name "libcpuid")
+ (version "0.5.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/anrieff/libcpuid/releases/download/v"
+ version "/libcpuid-" version ".tar.gz"))
+ (sha256
+ (base32 "1nksdqk2w1c56lkrjcvh3nss9vq454j81j3yq14lwdn4x8bvmwfr"))))
+ (build-system gnu-build-system)
+ (supported-systems '("x86_64-linux" "i686-linux"))
+ (home-page "https://libcpuid.sourceforge.net/")
+ (synopsis "A 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.33.1
--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
Z
Z
Zhu Zihao wrote on 10 Nov 2021 14:53
Re: bug#51747: Acknowledgement ([PATCH]: gnu: nix: Update to 2.4. )
(address . 51747@debbugs.gnu.org)
864k8kcdzu.fsf@163.com
little fix.
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQTUepyLKuOQW1Y9kTW+QrNSqfaCHwUCYYvPJRUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQvkKzUqn2gh/WJAEAn+dYitfWbhiISGPRVT9pQHXIWxgF
Afs9Dcszz6ov3EEA/2p1RAA/gMp+jUnetkllBMZtRQQkLoN3u5xLtsfJ5pwP
=56lZ
-----END PGP SIGNATURE-----

From 073f513e233470da443b8ee71350e546110fd953 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Wed, 10 Nov 2021 19:21:45 +0800
Subject: [PATCH 1/3] gnu: Add lowdown.

* gnu/packages/markup.scm (lowdown): New variable.
---
gnu/packages/markup.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/markup.scm b/gnu/packages/markup.scm
index 368976bfde..35a4513432 100644
--- a/gnu/packages/markup.scm
+++ b/gnu/packages/markup.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020 EuAndreh <eu@euandre.org>
;;; Copyright © 2021 Noisytoot <noisytoot@disroot.org>
+;;; Copyright © 2021 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -36,6 +37,7 @@ (define-module (gnu packages markup)
#:use-module (guix utils)
#:use-module (gnu packages compression)
#:use-module (gnu packages)
+ #:use-module (gnu packages base)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
@@ -324,3 +326,35 @@ (define-public python-mistletoe
swap out renderers for different output formats, without touching any of the
core components.")
(license expat)))
+
+(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
+ `(#:tests? #f ;no test
+ #: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"))))))
+ ;; The shared library of nix is linked with lowdown's static archive.
+ #:make-flags '("CFLAGS=-fPIC")))
+ (native-inputs
+ `(("which" ,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 isc)))
--
2.33.1
From dcc74bc2cd71b84530bcba8353294c4851eab714 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Wed, 10 Nov 2021 19:31:28 +0800
Subject: [PATCH 2/3] gnu: Add libcpuid.

gnu/packages/hardware.scm (libcpuid): New variable.
---
gnu/packages/hardware.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 2bf3576d5a..fd7de013ef 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2021 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -834,3 +835,22 @@ (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
+ (package
+ (name "libcpuid")
+ (version "0.5.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/anrieff/libcpuid/releases/download/v"
+ version "/libcpuid-" version ".tar.gz"))
+ (sha256
+ (base32 "1nksdqk2w1c56lkrjcvh3nss9vq454j81j3yq14lwdn4x8bvmwfr"))))
+ (build-system gnu-build-system)
+ (supported-systems '("x86_64-linux" "i686-linux"))
+ (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.33.1
--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
Z
Z
Zhu Zihao wrote on 10 Nov 2021 16:47
(address . 51747@debbugs.gnu.org)
861r3oau4u.fsf@163.com
My local source repo is not up-to-date :(, Update to resolve the
conflict with newest master.
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQTUepyLKuOQW1Y9kTW+QrNSqfaCHwUCYYvp8RUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQvkKzUqn2gh/ydAD/W0J+8w8Zr6FFM9lKDb3oOTRw95UO
8zqTG0YEJ0vPI0ABAJlMxgtCWdebe0oBbXIzMMyWlGALjbCC9tF75hJt4qoF
=s053
-----END PGP SIGNATURE-----

From 369b3cc29ac306d3b2ff9df38163be6d31b0b12b Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Wed, 10 Nov 2021 23:36:20 +0800
Subject: [PATCH 1/3] gnu: lowdown: Generate position-independent code.

* gnu/packages/markup.scm (lowdown)[arguments]<make-flags>: Use -fPIC.
---
gnu/packages/markup.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/markup.scm b/gnu/packages/markup.scm
index 06e653a1c9..474b5343e9 100644
--- a/gnu/packages/markup.scm
+++ b/gnu/packages/markup.scm
@@ -138,7 +138,9 @@ (define-public lowdown
(let ((out (assoc-ref outputs "out")))
(invoke "./configure"
(string-append "PREFIX=" out)
- (string-append "MANDIR=" out "/share/man"))))))))
+ (string-append "MANDIR=" out "/share/man"))))))
+ ;; The shared library of Nix is linked with lowdown's static archive.
+ #:make-flags '("CFLAGS=-fPIC")))
(native-inputs
`(("which" ,which)))
(home-page "https://kristaps.bsd.lv/lowdown/")
--
2.33.1
From 032740ed0e85dc20f49133358b1206c4a56efcec Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Wed, 10 Nov 2021 23:37:24 +0800
Subject: [PATCH 2/3] gnu: Add libcpuid.

* gnu/packages/hardware.scm (libcpuid): New variable.
---
gnu/packages/hardware.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 2bf3576d5a..fd7de013ef 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2021 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -834,3 +835,22 @@ (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
+ (package
+ (name "libcpuid")
+ (version "0.5.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/anrieff/libcpuid/releases/download/v"
+ version "/libcpuid-" version ".tar.gz"))
+ (sha256
+ (base32 "1nksdqk2w1c56lkrjcvh3nss9vq454j81j3yq14lwdn4x8bvmwfr"))))
+ (build-system gnu-build-system)
+ (supported-systems '("x86_64-linux" "i686-linux"))
+ (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.33.1
--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
Z
Z
Zhu Zihao wrote on 17 Nov 2021 12:21
(address . 51747@debbugs.gnu.org)
86lf1njad0.fsf@163.com
ping.
--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQTUepyLKuOQW1Y9kTW+QrNSqfaCHwUCYZTlyxUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQvkKzUqn2gh+JagEA4cFB9eUGpcbDvvIqppYhzCWl/Xwu
Y6ixWl5Ye1xcwk4BAIchAnXWEs71S2VSdIa/WI4Sg8onrtnf+8U3+CNT938P
=SqSO
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 4 Dec 2021 16:28
(address . 51747@debbugs.gnu.org)
86ilw4e6av.fsf@163.com
Ping again.

I know you guys are hard working on core-updates-frozen branch. But I
can't see a deadline for merging it into master.

Does it really worth abandoning non-trivial patches for master branch? IDK....

Zhu Zihao <all_but_last@163.com> writes:

Toggle quote (5 lines)
> [[PGP Signed Part:Undecided]]
>
> ping.


--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQTUepyLKuOQW1Y9kTW+QrNSqfaCHwUCYauJmBUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQvkKzUqn2gh+K1AEA/LYdJmh5QzzWKgRypZfxIHGdFQqN
04+P7NuHGhwH0bcA/A9HelPDUsnWaH5J5oh/UeDYpVs0Q6+hJ2jUs4wRbdUC
=nwS3
-----END PGP SIGNATURE-----

O
O
Oleg Pykhalov wrote on 11 Jan 2022 09:23
Re: bug#51747: [PATCH]: gnu: nix: Update to 2.4.
(name . Zhu Zihao)(address . all_but_last@163.com)(address . 51747@debbugs.gnu.org)
87y23mheag.fsf_-_@gmail.com
Hi, apologies for the slow response.

Zhu Zihao <all_but_last@163.com> writes:

Toggle quote (7 lines)
> Ping again.
>
> I know you guys are hard working on core-updates-frozen branch. But I
> can't see a deadline for merging it into master.
>
> Does it really worth abandoning non-trivial patches for master branch? IDK....

I tried to apply patches, but it does not build on the current
origin/master 537f4a1ef1cc385526b0662b2a9a1754319e1020

Updated patches on 537f4a1e and build log attached.

If you know what's the issue, please respond.
From 3ec635be703c947b0b031eb79136037d07eeedd1 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Tue, 11 Jan 2022 10:07:17 +0300
Subject: [PATCH 1/2] gnu: Add libcpuid.

* gnu/packages/hardware.scm (libcpuid): New variable.
---
gnu/packages/hardware.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 8727f0f20a..a2708e6b90 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -953,3 +954,22 @@ (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
+ (package
+ (name "libcpuid")
+ (version "0.5.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/anrieff/libcpuid/releases/download/v"
+ version "/libcpuid-" version ".tar.gz"))
+ (sha256
+ (base32 "1nksdqk2w1c56lkrjcvh3nss9vq454j81j3yq14lwdn4x8bvmwfr"))))
+ (build-system gnu-build-system)
+ (supported-systems '("x86_64-linux" "i686-linux"))
+ (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
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmHdPmcUHGdvLndpZ3Vz
dEBnbWFpbC5jb20ACgkQFn+OpQAa+pz95BAArZh9xv9Ry4RDkc5WNP17YiB0TjDd
FGE8O6jnZ+/2rzuZ5SRDG5uuw2rq1PxVgLAcYTJluB2bNayaa7Gwg5DhhGzCNt+u
owTWhXPJoHWQZE9nTkBNeJaE7MjsKno3VcAgx3c/+Sb+NQUlCWdqbmcsVRQiotu6
LSNmq24hHDOYvOSG2zurp2ITLdIUJJ/JhqmGjUCODajiUQRKxb1mn8qx+LUKBWBU
cELYDaPlQ8ijQN4+6dfCPjHL/4nTbN5CpFkTURDRGgHS9xBodkVeg+m55wdnJLmx
r6Tl2gFe1JJEoai7ZHlQPXUsGzjHAegLcPqJASLkkPrVUT9Me9zhGSgUcCHx92E8
fqYWkfLkNKnxfzoO3NjB00BqFfLi5P62V+evi4ecRjcks0QBcODHsxwpxTbffMmj
jGoWyW40szxNhkA9Co8RGP3DrG8EcLKmkwKdUvIUuStel6xqBdWGWSB/sk3z0xYl
RrzFfQ7XD0YnpfzVjypEukTB6F2dpa21EOq7OAvEH5FvbEIcDaG5YlEv+x5uRhjE
tgkLJVu3n4digKHCQolg0LuTgleuv7EGLoAPcaLq5PQusqrJa2++eYJe9+cFMvKG
cdRNrL0S08WKXOPf6EPGGmCVDhUYV5/Q/ocZsGws+VIzB+8gw5+YEhu+gDZg8zIV
ZokW7RnKyYof3NM=
=c+uM
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 11 Jan 2022 10:46
Re: bug#51747: [PATCH]: gnu: nix: Update to 2.4.
(name . Oleg Pykhalov)(address . go.wigust@gmail.com)(address . 51747@debbugs.gnu.org)
86wnj6wqje.fsf@163.com
Oleg Pykhalov <go.wigust@gmail.com> writes:

Toggle quote (3 lines)
> [[PGP Signed Part:Undecided]]
> Hi, apologies for the slow response.

Thanks for your review!

The problem is lowdown only provides a static archive.(compile without
-fPIC). But nix tries to link with it. I see the build system of Lowdown
on master now produce a shared library. But I haven't check whether they
have a new release now.

Anyway, I' ll update these patches later, move these code to label-less
style and fix the compile error.

--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYd1SpRUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/kf5gEA2diyg/wVDLxWJZ4/TRT1jzlnAeyK
lvYT5V7OeFZIWiIA/1CHDwCWv8IRhe9nm0Fib/tTKTyeyAZJ624Dq+E3/JkH
=gt/D
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 11 Jan 2022 18:19
(name . Oleg Pykhalov)(address . go.wigust@gmail.com)(address . 51747@debbugs.gnu.org)
86pmoyrxyy.fsf@163.com
Patches updated.
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYd28RRUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/nnFgEAmbxAjtsbEUbfiq40wmhy/U8vL/06
ChK6G0+pc6jvv98A/11w6XcM949W/+7NHog3A0C5aCLSg6bP9Fzn6H1APhkK
=xNmj
-----END PGP SIGNATURE-----

From 71bb95c5d9e446ecb7e395f21e6677bcba5c11e9 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Tue, 11 Jan 2022 22:56:14 +0800
Subject: [PATCH 1/5] gnu: Add libcpuid.

* gnu/packages/hardware.scm (libcpuid): New variable.
---
gnu/packages/hardware.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 8727f0f20a..a2708e6b90 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -953,3 +954,22 @@ (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
+ (package
+ (name "libcpuid")
+ (version "0.5.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/anrieff/libcpuid/releases/download/v"
+ version "/libcpuid-" version ".tar.gz"))
+ (sha256
+ (base32 "1nksdqk2w1c56lkrjcvh3nss9vq454j81j3yq14lwdn4x8bvmwfr"))))
+ (build-system gnu-build-system)
+ (supported-systems '("x86_64-linux" "i686-linux"))
+ (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
From 0455cf022615c356eea487876b318774820270a7 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Tue, 11 Jan 2022 23:01:38 +0800
Subject: [PATCH 2/5] 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(-)

Toggle diff (74 lines)
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
From a62fb3b6a1b27ab0242ee61b6decba37959b008c Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Wed, 12 Jan 2022 00:52:25 +0800
Subject: [PATCH 3/5] 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(-)

Toggle diff (42 lines)
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
From e442322866f6edd625ada09573afb7bff51f269e Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Wed, 12 Jan 2022 00:42:32 +0800
Subject: [PATCH 5/5] 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(-)

Toggle diff (39 lines)
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
--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
M
M
Maxime Devos wrote on 11 Jan 2022 20:04
Re: [bug#51747] [PATCH]: gnu: nix: Update to 2.4.
(address . 51747@debbugs.gnu.org)
190ec030edbca1c16fb030c51acd60ffc6bae269.camel@telenet.be
Zhu Zihao schreef op wo 12-01-2022 om 01:19 [+0800]:
Toggle quote (3 lines)
> + (name "libcpuid") [...]
> +    (supported-systems '("x86_64-linux" "i686-linux"))

Given that 'cpuid' is a CPU instruction, I don't think
this is Linux-specific; presumably it works on the Hurd
as well.  According to the README, it also supports some BSDs,
Mac OS and Windows!

Could you change it to

(filter (lambda (t) (or (x86-64-target? t) (or (x86-32-target? t))))
%supported-systems)

instead (untested)?

Also, the source code contains a blob
could you remove it in an origin snippet?

There might be more blobs, I didn't look at all files.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYd3UsRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lbpAQCpG26I1bwUpiq7Ji/mhLq3y6Pq
t+XwrUt1CCU0c3cOBAD+N4rGYW/pTR28yXxnMMapOTCVpPNvC3bD73PUPv2wVgQ=
=si4g
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 11 Jan 2022 20:05
(address . 51747@debbugs.gnu.org)
bfd9213afb0fa915c1faf100aca8e47751a378b8.camel@telenet.be
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYd3U9RccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7tq9AP40+BKfyO80z2ZB463q1b5GvkmG
/0bm/33jz0UJqTzuaQEA43iR40kQV9+6a8TO5YeypAJYcRWJ68gSi+uy7SoG/Qw=
=iEMs
-----END PGP SIGNATURE-----


Z
Z
Zhu Zihao wrote on 12 Jan 2022 05:21
(name . Maxime Devos)(address . maximedevos@telenet.be)
8635lto9z3.fsf@163.com
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (28 lines)
> [[PGP Signed Part:Undecided]]
> Zhu Zihao schreef op wo 12-01-2022 om 01:19 [+0800]:
>> + (name "libcpuid") [...]
>> +    (supported-systems '("x86_64-linux" "i686-linux"))
>
> Given that 'cpuid' is a CPU instruction, I don't think
> this is Linux-specific; presumably it works on the Hurd
> as well.  According to the README, it also supports some BSDs,
> Mac OS and Windows!
>
> Could you change it to
>
> (filter (lambda (t) (or (x86-64-target? t) (or (x86-32-target? t))))
> %supported-systems)
>
> instead (untested)?
>
> Also, the source code contains a blob
> <https://github.com/anrieff/libcpuid/blob/master/libcpuid/msrdriver.c>,
> could you remove it in an origin snippet?
>
> There might be more blobs, I didn't look at all files.
>
> Greetings,
> Maxime.
>
> [[End of PGP Signed Part]]

Interesting, It looks that these blobs are for Windows system. I don't
care about MS Windows, but blobs are tightly integrated in the source.

The source reports that they're compiled from the source in contrib/MSR
Driver/Kernel. They're PE COFF format, If we want to compile it ourself,
we have to use mingw cross compiler. This increase the complexity of
build script.

AFAIK, nix use libcpuid only in linux context. My idea is replace these
blobs with empty bytes. Maybe leave a note for who want mingw cross build.

--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYd5YgBUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/nLOgD8DnCTU7XPupgij02SnBBpLP4TzErg
/OLR9nlEMfSQlGUBAOCoZ7D8pmpg4+T+iOR1pXRNDtu9nSuSmJaYQ5Xs2ZQM
=qq0U
-----END PGP SIGNATURE-----

O
O
Oleg Pykhalov wrote on 12 Jan 2022 06:19
(name . Zhu Zihao)(address . all_but_last@163.com)
87wnj57cpi.fsf@gmail.com
Zhu Zihao <all_but_last@163.com> writes:

[…]

Toggle quote (11 lines)
> Interesting, It looks that these blobs are for Windows system. I don't
> care about MS Windows, but blobs are tightly integrated in the source.
>
> The source reports that they're compiled from the source in contrib/MSR
> Driver/Kernel. They're PE COFF format, If we want to compile it ourself,
> we have to use mingw cross compiler. This increase the complexity of
> build script.
>
> AFAIK, nix use libcpuid only in linux context. My idea is replace these
> blobs with empty bytes. Maybe leave a note for who want mingw cross build.

Does the current version 2.5.1 https://nixos.org/download.htmlcontains
those blobs?

And in any case, could we update to 2.5.1 instead of 2.4?
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmHeZOkUHGdvLndpZ3Vz
dEBnbWFpbC5jb20ACgkQFn+OpQAa+pwa5g/+M+QGxXXlakzHDl8Cb+CYVpcNOi0M
8qBp14w4zqixBcGPQGjJRYHcTQfdSgR0eGv863dFYrDIOCdB+yOtxoRArzo84uEw
8R0cfIUJR3ECLVyRmwnyNzHzuOulO3bsBntCZwPXLQDUVG90o2SXlcvK5PTWd47b
7TqfjzkvnQNFp2/3UiehfJL64f4OtXeQLUqBxAZ35oeb0cH4ZArIyzxvgjzmZNHN
0ZtJfvu001y29QlLW0Q3/VlclOLAf7S0khWumKhxoCBxAlvHj7cMcA3liHKbKJSX
WSsMoJX2IGa48k/iCSfqI75FnDUo0Pv/d80FjbU91y6JlmEysHo+7EC1lY8Z5/ig
sWD7Zlf9HgZ40RXvXJVjIQ9BUuwhVrMjnwG00zcjWRBRT/lPW6r7pl3gWS/Zv9D1
oZQRkstH+Q2SwqVyLYOSiy2UX2MtW7DvfMxPAC8C+nxy6AjSlVJEJT4fjPaLxizy
RfQYrs9C58BZubXb3J83tbfON4Pj2Cyg9aODnMP1GROZYk6WuyU2if89+q4UUOek
oiQgq5HpWqQqABEkCeZbYrO1lfCQ+Gt709uisB9WXdw6cvpAFjwcbPb9ls0s9wcu
rxIsiqyXNNOLqm0YK0hw4UBZiDbrWv0abLUgufafsNZqic5eG4gQP4yJq63K0ruC
Bz60MrgL3GrgvXM=
=yaQB
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 12 Jan 2022 08:08
(name . Oleg Pykhalov)(address . go.wigust@gmail.com)
86bl0hmnvi.fsf@163.com
Oleg Pykhalov <go.wigust@gmail.com> writes:

Toggle quote (23 lines)
> [[PGP Signed Part:Undecided]]
> Zhu Zihao <all_but_last@163.com> writes:
>
> […]
>
>> Interesting, It looks that these blobs are for Windows system. I don't
>> care about MS Windows, but blobs are tightly integrated in the source.
>>
>> The source reports that they're compiled from the source in contrib/MSR
>> Driver/Kernel. They're PE COFF format, If we want to compile it ourself,
>> we have to use mingw cross compiler. This increase the complexity of
>> build script.
>>
>> AFAIK, nix use libcpuid only in linux context. My idea is replace these
>> blobs with empty bytes. Maybe leave a note for who want mingw cross build.
>
> Does the current version 2.5.1 https://nixos.org/download.html contains
> those blobs?
>
> And in any case, could we update to 2.5.1 instead of 2.4?
>
> [[End of PGP Signed Part]]

Thank you for remind me the release of 2.5.1. We should update to 2.5.1

But the blob is contained in libcpuid, Nix 2.5.1 still use libcpuid for
x86 machine.

--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYd5+oRUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/nchQEA9WqHeRahDM/vT5YFL2c/Qzw2Fgcr
yk4gOplKotcXdKoBAPUBTEfVh8KZiiYP6fx1saQ1M0J+BNcu4ZVyD7f1D7wL
=wc8s
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 12 Jan 2022 09:26
(name . Zhu Zihao)(address . all_but_last@163.com)
c113a0328f7b1e7d77ce3a4e7c349bac20f4a68d.camel@telenet.be
Zhu Zihao schreef op wo 12-01-2022 om 12:21 [+0800]:
Toggle quote (13 lines)
> [
> ...]
> Interesting, It looks that these blobs are for Windows system. I don't
> care about MS Windows, but blobs are tightly integrated in the source.
>
> The source reports that they're compiled from the source in contrib/MSR
> Driver/Kernel. They're PE COFF format, If we want to compile it ourself,
> we have to use mingw cross compiler. This increase the complexity of
> build script.
>
> AFAIK, nix use libcpuid only in linux context. My idea is replace these
> blobs with empty bytes. Maybe leave a note for who want mingw cross build.

Often (but not always, cf. rust), when software has files for specific
architectures or operating systems, they will only be compiled if they
match the architecture and operating system the software is compiled
for. As such, there's a good chance the build will succeed (at least
for Linux, for Hurd, ...) if they are simply deleted.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYd6QmBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rkiAQDmhdqJZaT2Bs0NTYpfFqC4Qhv/
6moqKTwdErhf41mHIAD/TB80KqSkj2gQP1sFxz9fXVKlB48iEG2zEZfwcAzthQM=
=zf22
-----END PGP SIGNATURE-----


Z
Z
Zhu Zihao wrote on 13 Jan 2022 05:54
(name . Maxime Devos)(address . maximedevos@telenet.be)
86zgo0nsgf.fsf@163.com
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (5 lines)
> Could you change it to
>
> (filter (lambda (t) (or (x86-64-target? t) (or (x86-32-target? t))))
> %supported-systems)

I found that it actually only supports Linux & Windows. There're only
code stubs for other platform.

I've created a patch to libcpuid, make it only link with msrdriver.c

--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYd+xMBUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/n7SAD/dv2fEXmngU59jGQZGTsQV8Z+Gk19
RLkcShNEJl9uKc0A/Rfan6iConfWfXqrof3apCKBRwLftcJv4Da4SABsjAEI
=tMT1
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 13 Jan 2022 08:54
(name . Maxime Devos)(address . maximedevos@telenet.be)
86bl0g6pec.fsf@163.com
Zhu Zihao <all_but_last@163.com> writes:

Toggle quote (3 lines)
> I found that it actually only supports Linux & Windows. There're only
> code stubs for other platform.

Correction, the MSR detection is limited to Linux & Windows, while other
functionalities are not.

--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYd/a6xUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/kP9wD/dXUQ8aeLXP/rWLM8WLqbHeRXf5x/
PJTbysTkrepZ6dsBALPPHn22g+r8lgR/hjHb85H9hBhAI18/YZi73lNbcwQG
=Vq+/
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 14 Jan 2022 10:31
Re: bug#51747: [PATCH]: gnu: nix: Update to 2.4.
(name . Oleg Pykhalov)(address . go.wigust@gmail.com)(address . 51747@debbugs.gnu.org)
86h7a664rv.fsf@163.com
Finally solve these issues, I hope.
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYeFDVBUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/m0pgD+PbesFeUvXFqLjefeI0V+D8ztS1NM
l6s3fM6wddfkRyEA/37ZA8vVocZkBwGE3C04JWaBglgXQauHZuX06JLyZJIL
=fM9J
-----END PGP SIGNATURE-----

From 7ac9e6dd9d327c59d6d90dc0628a65fe26946021 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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 | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 8727f0f20a..230800e44d 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -953,3 +954,34 @@ (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
+ (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
+ ;; 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)) ;broken
+ (supported-systems '("x86_64-linux" "i686-linux"))
+ (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
From cd5285dabf027faca80c84ba2e656cd77d06ef98 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (74 lines)
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
From fd2849039d8df0831f2f5e55701f6e7ddf8ea0fe Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (42 lines)
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
From 3868c88ed278de703311fe222590b68ee57420e8 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (39 lines)
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
From 959060f15cd24e0266d5b106dbefb94c1beeccba Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (24 lines)
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
--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
M
M
Maxime Devos wrote on 14 Jan 2022 13:56
Re: [bug#51747] [PATCH]: gnu: nix: Update to 2.4.
(address . 51747@debbugs.gnu.org)
c1c3fe3a451046a4bfc6206f5000182b1658a49b.camel@telenet.be
Zhu Zihao schreef op vr 14-01-2022 om 17:31 [+0800]:
Toggle quote (8 lines)
> [...]
> +(define-public libcpuid
> +  (let ((commit "2e61160983f32ba840b2246d3c3850c44626ab0d")
> +        (revision "1"))
> +    (package
> +      (name "libcpuid")
> +      (version (git-version "0.5.1" revision commit))

There's a good reason for using an unreleases version here,
but this should ideally be documented with a comment,
maybe


Toggle quote (20 lines)
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://github.com/anrieff/libcpuid")
> +               (commit commit)))
> +         (sha256
> +          (base32
> "1mphvkiqq6z33sq6i490fq27sbyylacwrf8bg7ccvpcjms208sww"))
> +         (modules '((guix build utils)))
> +         (snippet
> +          ;; 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))              ;broken

In which manner are they broken? Maybe they can be fised.

Toggle quote (2 lines)
> +      (supported-systems '("x86_64-linux" "i686-linux"))

See my e-mail about target-x86-64? and the Hurd.

Toggle quote (7 lines)
> +      (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.")

It seems easy to confuse this with the package 'cpuid', maybe you
can mention 'cpuid' and 'libcpuid' are unrelated packages, albeit
for a similar purpose?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYeFy+RccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7oZ5AP4mecQainXGPjap85CJwYl56+b+
P0l2tZVtP0OBYXsWiQEA65G/wyTV0UzoGOsLo89HY0WcxuqJai29sTAq/l1M/wc=
=PNGh
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 14 Jan 2022 14:06
(name . Zhu Zihao)(address . all_but_last@163.com)
a075eb16fe1ac3660bdf42e5e6de7e9dd06086d8.camel@telenet.be
Zhu Zihao schreef op do 13-01-2022 om 12:54 [+0800]:
Toggle quote (10 lines)
> Maxime Devos <maximedevos@telenet.be> writes:
>
> > Could you change it to
> >
> > (filter (lambda (t) (or (x86-64-target? t) (or (x86-32-target? t))))
> >         %supported-systems)
>
> I found that it actually only supports Linux & Windows. There're only
> code stubs for other platform.

I doubt this, since libcpuid.h mentions FreeBSD and Solaris support,
and 'libcpuid/asm-bits.c' uses 'cpuid' whether it is Linux or Windows
or not.

Possibly there's more information available for Linux and Windows
than for the hurd (see e.g. 'libcpuid/rdmsr.c'), but it would seem that
_some_ usable information is available elsewhere.

Also, 'libcpuid/rdmsr.c' uses 'modprobe', does this need to be
absolutised?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYeF1UxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7q52AQDX7Z/T/D8HevVOk/5pvtH+w1//
dGJzom1HykDesPj9awD+KCO8qdctufZ9FNFVDxERWx2jqcnVKeUDfXwm3EzcIwg=
=6NM7
-----END PGP SIGNATURE-----


Z
Z
Zhu Zihao wrote on 14 Jan 2022 17:51
(name . Maxime Devos)(address . maximedevos@telenet.be)
86pmoucl3g.fsf@163.com
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.
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYeGrMxUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/kG/gD/X+CRIJK6d3C9n+ULwfB8J1lG2yKu
83q/KrIyHb5hgWsBANc8eHCPw+AvZJFq859rMNml7/P4M0KNSfsEV5yGY9gM
=Z83R
-----END PGP SIGNATURE-----

From 0de84768a9d5f46d25d9442e8d1fbad4b55674b9 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (73 lines)
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@raghavgururajan.name>
;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2022 Zhu Zihao <all_but_last@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
From a89d730d8422e703293d4569c15f4e1ede6e0d28 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (74 lines)
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
From 20f81d5df49aed828453c70bf48f73f46ea243ba Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (42 lines)
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
From 25b4055977e28a3efc8f0ee4af2906e4e923c7d9 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (39 lines)
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
From d81e689fa1acd5eb4a2fee325609216a24a9b887 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (24 lines)
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
--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
M
M
Maxime Devos wrote on 14 Jan 2022 19:39
(name . Zhu Zihao)(address . all_but_last@163.com)
f3e4bb43ef7f53b25c0edf5847d73aa1700117bd.camel@telenet.be
Zhu Zihao schreef op za 15-01-2022 om 00:51 [+0800]:
Toggle quote (6 lines)
> 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 didn't see anyting RUNPATH (*) related. It failed to run some python
script though with ‘file does not exist’ (which could maybe indicate
RUNPATH problems, but not in this case), it turned out that the shebang
wasn't patched. Adding python to the native-inputs appears to fix
things

Toggle quote (4 lines)
> I have no idea to gi.ve 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.

See attachement for a variant of the 'libcpuid' package that builds for
me (--system=x86-64-linux, with tests) and cross-builds to
--target=i586-pc-gnu (tests automatically disabled because of cross-
compilation). 'kmod' only exists on Linux, so I modified the inputs
and 'absolutize' to only use it when building for Linux.

I don't think many users look at the description either, but it seems a
logical place to look in case of trouble. I added a sentence.

I modified the package definition outside emacs and outside a git
checkout, so the indentation probably needs some fixing.

Greetings,
Maxime.

(*) IIRC Guix uses RUNPATH and not RPATH.
(use-modules (guix svn-download) ((guix licenses) #:prefix license:) (gnu packages linux) (gnu packages python) (guix packages) (guix gexp) (guix packages) (guix git-download) (guix build-system cmake) (guix utils) (srfi srfi-1)) (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 #:modules '((rnrs exceptions) (guix build cmake-build-system) (guix build utils)) #:configure-flags #~'("-DLIBCPUID_TESTS=ON") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'absolutize (lambda* (#:key inputs #:allow-other-keys) ;; modprobe doesn't exist on the Hurd (guard (c ((search-error? c) (values))) (substitute* "libcpuid/rdmsr.c" (("modprobe") (search-input-file inputs "bin/modprobe"))))))))) (inputs (if (target-linux?) (list kmod) ; linux-only '())) ;; a python from the 3. series is required by tests (native-inputs (list python-3)) (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. This library is not to be confused with the @code{cpuid} command line utility fromm the @code{cpuid} package.") (license license:bsd-2)))) libcpuid
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYeHDdBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iwFAP9RAvY9xc+xQjcgbtflxBvkWvno
aqmVa23kmc5iRH2DSAEAnn5BB8Zm0IjZdpz0ahdM8RESArLjUBAZxQTCqbQczgw=
=UDrF
-----END PGP SIGNATURE-----


Z
Z
Zhu Zihao wrote on 15 Jan 2022 02:58
(name . Maxime Devos)(address . maximedevos@telenet.be)
86o84dah9i.fsf@163.com
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (14 lines)
> [[PGP Signed Part:Undecided]]
> Zhu Zihao schreef op za 15-01-2022 om 00:51 [+0800]:
>> 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 didn't see anyting RUNPATH (*) related. It failed to run some python
> script though with ‘file does not exist’ (which could maybe indicate
> RUNPATH problems, but not in this case), it turned out that the shebang
> wasn't patched. Adding python to the native-inputs appears to fix
> things

I use -K to keep failed build and ldd the test binary found that RUNPATH
is broken, but I miss that we don't add python into inputs.. Penny wise
and pound foolish LOL.

I know Guix use RUNPATH, but RPATH is short to type and we need not to
distinguish between them in our context.
--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYeIrGRUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/nJCAEAyVP0+5itTtfPnIUzna3k70r+7oko
CfJYiH+wlgrybBsBAKHtTz7EU55vv7nHx7P3zqe0vJPu4SGneYkarnwXW0AF
=OCfL
-----END PGP SIGNATURE-----

Z
Z
Zhu Zihao wrote on 15 Jan 2022 06:47
(name . Maxime Devos)(address . maximedevos@telenet.be)
86bl0da6rn.fsf@163.com
Do some modification based on your code, and add your credit.
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYeJgPBUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/kaGwEA7JdFQb0PAs6zkmntMEZs7gEvi+I5
S1rp166YY6+eo3gA/Rk6S1U1IpZ4lMYsmr5dCJXO2aNwjqZvuetUV/qNOrwB
=dbDk
-----END PGP SIGNATURE-----

From 11e87c57046292b754c7d641b587e9eb99e688f7 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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 | 56 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 55 insertions(+), 1 deletion(-)

Toggle diff (80 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 8727f0f20a..a93db0be3f 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -9,6 +9,8 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -70,7 +72,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 +956,54 @@ (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
+ #:configure-flags #~(list "-DLIBCPUID_TESTS=ON")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'absolutize
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Linux specific
+ (when #$(target-linux?)
+ (substitute* "libcpuid/rdmsr.c"
+ (("modprobe") (which "modprobe")))))))))
+ (inputs
+ (if (target-linux?)
+ (list kmod)
+ '()))
+ (native-inputs (list python-3)) ;required by tests
+ (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. This library is not to be
+confused with the @code{cpuid} command line utility from package @code{cpuid}.")
+ (license license:bsd-2))))
--
2.34.0
From 28913dfe0c3041469ca3e2fbc93a600fb9c07656 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (74 lines)
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
From 7147a2c254e8010905fa2f02459618d28bdf7a75 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (42 lines)
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
From 2e6281516a3d909c2b031f1a7461f27801c032f4 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (39 lines)
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
From a8ff6088e543f5a7322180aa59e7c4d5447eb11c Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@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(-)

Toggle diff (24 lines)
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
--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
M
M
Maxime Devos wrote on 15 Jan 2022 11:52
(name . Zhu Zihao)(address . all_but_last@163.com)
0cb528695857acda121e58dee76b1095634ea7bb.camel@telenet.be
Hi,

I looked a bit in the source code, and it seems to be missing
some error checking. E.g., in libcpuid/cpuid_main.c:,
it is not verified that 'malloc' succeeded.

list->names = (char**) malloc(sizeof(char*) * n);
[...]
list->names[n] = (char*) malloc (i - last)
[....]
list->names[n][i - last - 1 = '\0']

It doesn't seem exploitable here, but I would recommend something
like 'xmalloc' instead to avoid (anti-)learning by bad examples.

Also, in the package definition, you are using cmake-build-system.
This works, but the README doesn't mention CMake anywhere and instead
mentions the autotools (autoconf etc.) and has configure.ac, so I would
use gnu-build-system instead.

Zhu Zihao schreef op za 15-01-2022 om 13:47 [+0800]:
Toggle quote (12 lines)
> +      (arguments
> +       (list
> +        #:configure-flags #~(list "-DLIBCPUID_TESTS=ON")
> +        #:phases
> +        #~(modify-phases %standard-phases
> +            (add-after 'unpack 'absolutize
> +              (lambda* (#:key inputs #:allow-other-keys)
> +                ;; Linux specific
> +                (when #$(target-linux?)
> +                  (substitute* "libcpuid/rdmsr.c"
> +                    (("modprobe") (which "modprobe")))))))))

This use of 'which' doesn't work when cross-compiling because it looks
in $PATH (which contains (possibly implicit) native-inputs) and not
'inputs' -- 'inputs' and 'native-inputs' are merged together when
compiling natively so this doesn't cause errors when compiling natively
but it doesn't work when cross-compiling -- try
"./pre-inst-env guix build libcpuid --target=aarch64-linux-gnu".

I would use 'search-input-file' instead:

;; using (when #$(target-linux? ...) ...) instead
;; of 'guard' would also work
#~(modify-phases %standard-phases
(add-after 'unpack 'absolutize
(lambda* (#:key inputs #:allow-other-keys)
;; modprobe doesn't exist on the Hurd
(guard (c ((search-error? c) (values)))
(substitute* "libcpuid/rdmsr.c"
(("modprobe")
(search-input-file inputs "bin/modprobe")))))))))


Toggle quote (3 lines)
> + confused with the @code{cpuid} command line utility from package
> + @code{cpuid}.")

A definite article is missing before 'package'.

Toggle quote (2 lines)
> + (native-inputs (list python-3)) ;required by tests

I would keep the original comment

;; a python from the 3. series is required by tests

here, because it is important that it comes from the 3. series
-- the shebang uses "/usr/bin/env python3", not "python3". This
comment would be helpful when updating python to the 4. series
(these versions don't exist yet but presumably they eventually will),
as it would make it clear that we cannot simply replace 'python-3' with
'python-4'.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYeKnYxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jTiAP9tz223exwQ8XEuUlo9UxVOSQ3V
jlenKR+InbQAFjTkLAD9HtBDDYber/Sn9+CdrRGY5SFZXKBOAI0cdoJqwgTysA8=
=VW7/
-----END PGP SIGNATURE-----


Z
Z
Zhu Zihao wrote on 15 Jan 2022 17:06
(name . Maxime Devos)(address . maximedevos@telenet.be)
868rvh3rqv.fsf@163.com
Maxime Devos <maximedevos@telenet.be> writes:

Please forgive me that I don't have so much time to test cross build. If
you have problem with my patches, you can modify it based on existing
patches. And don't forget to notice Guix committers to ensure they don't
miss any new patches. :)

--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQRefA5qkqvnKdl/GTlmOX+E92aT+QUCYeLxyBUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQZjl/hPdmk/napAD+MYZvv/Eewh4QvreQzrlyauka5uYl
u13LeEErr2IztwgA/RZw25CTTWlAzHS1MS+E4WPEQ6lISVELboZ8T9j2dHcG
=INAD
-----END PGP SIGNATURE-----

O
O
Oleg Pykhalov wrote on 21 Jan 2022 15:29
Re: bug#51747: [PATCH]: gnu: nix: Update to 2.4.
(name . Zhu Zihao)(address . all_but_last@163.com)
8735lh5fha.fsf_-_@gmail.com
Zhu Zihao <all_but_last@163.com> writes:

Toggle quote (7 lines)
> Maxime Devos <maximedevos@telenet.be> writes:
>
> Please forgive me that I don't have so much time to test cross build. If
> you have problem with my patches, you can modify it based on existing
> patches. And don't forget to notice Guix committers to ensure they don't
> miss any new patches. :)

Pushed to master.

Closing the issue.

Thanks,
Oleg.
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmHqw2EUHGdvLndpZ3Vz
dEBnbWFpbC5jb20ACgkQFn+OpQAa+pzyLg/9HxrgZBr3FaZhCvoNZknELOr1Xsw8
I7G1wAEty+rGW76xDccaF+C9BzTgAmREVTmmrvfVHbP/NoklzZjsMSRxQMjRYmUw
QRXtr8UbvpE+LWvgPU05DFZ64QExRhYFXyCMkqs+tZKMMRA4SepCoN4SRYpYPh2h
e2VBp3xUNaC8sJmKd3KBmOZAr4k2jMB35sovHtmgYyUPGW/WjS5fMshSbBuV7ffS
Q7TPLH2CXJQcr1tFqC5/vrIyAu2AN1jXk8rnG1atZox382roPrPwS0qFjqh0xnfb
N7HclQEoyAOhKbM6J1oQpMq2laC0fzsmhQTlnUu3oBHpnwgstOoS5Uv0KT/czo2t
JYc1CjXZIeBdpxMeH06+s9fV2x8F+/Ufe7T3F3Ib5+nOyhklD7418rwwygEScZuL
/koVcdDNJiyeQuwmAG0lFbxyZG6a80Jalp8umU+XQQYnW+Wjs6Zz7t+M7/bYRZg1
x80dBtKLfsDTq15ZK2iHb1VGC9O/lRZhDoFP+7zdWjftlEuJpck8JF6SFHBwAmyG
GxMOsXzAQUjHnKbNExnHCWtEc3YmhlKdy+JGKxAZHma4LZPsacyVKrkpuLAcfHm3
MY5vdkpzJIHa1YxYdcAXND7gxwck0QvWdx5PkgMDIwtepJhkU9ocQJXbP41y6zoq
fLIOQbF3KsrjaPI=
=Gj4C
-----END PGP SIGNATURE-----

Closed
M
M
Maxime Devos wrote on 23 Jan 2022 12:02
Re: [bug#51747] [PATCH]: gnu: nix: Update to 2.4.
(address . 51747@debbugs.gnu.org)
52358f3d22650fb57542d005307c5547c078b06d.camel@telenet.be
Maxime Devos schreef op za 15-01-2022 om 11:52 [+0100]:
Toggle quote (10 lines)
> I looked a bit in the source code, and it seems to be missing
> some error checking.  E.g., in libcpuid/cpuid_main.c:,
> it is not verified that 'malloc' succeeded.
>
>         list->names = (char**) malloc(sizeof(char*) * n);
>         [...]
>         list->names[n] = (char*) malloc (i - last)
>         [....]
>         list->names[n][i - last - 1 = '\0']

This has been addressed upstream:

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYe01qxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gBBAP4pjMhnQIbsjp9hlL/on3QZenIe
OgTU1fU/rgxCtWD6rwD/WDV9BOyo1jIvO9nDIELctE5Hz2fmhzQtKy+aFQzFcAk=
=LMqo
-----END PGP SIGNATURE-----


?
Your comment

This issue is archived.

To comment on this conversation send an email to 51747@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 51747
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch