unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Zhu Zihao <all_but_last@163.com>
Cc: Oleg Pykhalov <go.wigust@gmail.com>, 51747@debbugs.gnu.org
Subject: [bug#51747] [PATCH]: gnu: nix: Update to 2.4.
Date: Fri, 14 Jan 2022 18:39:48 +0000	[thread overview]
Message-ID: <f3e4bb43ef7f53b25c0edf5847d73aa1700117bd.camel@telenet.be> (raw)
In-Reply-To: <86pmoucl3g.fsf@163.com>


[-- Attachment #1.1: Type: text/plain, Size: 1403 bytes --]

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 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.

[-- Attachment #1.2: stuff.scm --]
[-- Type: text/x-scheme, Size: 2613 bytes --]


(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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-01-14 18:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 12:35 [bug#51747] [PATCH]: gnu: nix: Update to 2.4 Zhu Zihao
     [not found] ` <handler.51747.B.16365478179399.ack@debbugs.gnu.org>
2021-11-10 13:53   ` [bug#51747] Acknowledgement ([PATCH]: gnu: nix: Update to 2.4. ) Zhu Zihao
2021-11-10 15:47     ` Zhu Zihao
2021-11-17 11:21       ` Zhu Zihao
2021-12-04 15:28         ` Zhu Zihao
2022-01-11  8:23           ` [bug#51747] [PATCH]: gnu: nix: Update to 2.4 Oleg Pykhalov
2022-01-11  9:46             ` Zhu Zihao
2022-01-11 17:19             ` Zhu Zihao
2022-01-11 19:04               ` Maxime Devos
2022-01-12  4:21                 ` Zhu Zihao
2022-01-12  5:19                   ` Oleg Pykhalov
2022-01-12  7:08                     ` Zhu Zihao
2022-01-12  8:26                   ` Maxime Devos
2022-01-13  4:54                 ` Zhu Zihao
2022-01-13  7:54                   ` Zhu Zihao
2022-01-14 13:06                   ` Maxime Devos
2022-01-14 16:51                     ` Zhu Zihao
2022-01-14 18:39                       ` Maxime Devos [this message]
2022-01-15  1:58                         ` Zhu Zihao
2022-01-15  5:47                         ` Zhu Zihao
2022-01-15 10:52                           ` Maxime Devos
2022-01-15 16:06                             ` Zhu Zihao
2022-01-21 14:29                               ` bug#51747: " Oleg Pykhalov
2022-01-23 11:02                             ` [bug#51747] " Maxime Devos
2022-01-11 19:05               ` Maxime Devos
2022-01-14  9:31             ` Zhu Zihao
2022-01-14 12:56               ` Maxime Devos

Reply instructions:

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

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

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

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

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

  git send-email \
    --in-reply-to=f3e4bb43ef7f53b25c0edf5847d73aa1700117bd.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=51747@debbugs.gnu.org \
    --cc=all_but_last@163.com \
    --cc=go.wigust@gmail.com \
    /path/to/YOUR_REPLY

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

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

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

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