unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: phodina <phodina@protonmail.com>
To: "help-guix@gnu.org" <help-guix@gnu.org>
Subject: Packaging hwinfo
Date: Sat, 24 Jul 2021 15:56:33 +0000	[thread overview]
Message-ID: <xfxGnQpbAwfZ-JnYj-l_SzE9WikpjC9tymHZfysizrO1Yqca9Ot1mn8WkAsKu4RrWrKwE4VcfkavgIYmmyVDx77WaQyHDeTkTNvvhcRGVWQ=@protonmail.com> (raw)

Dear All,

I'm attempting to package hwinfo which gathers HW information about the machine.
You'll find the package definition attached below together with the definition for libx86emu.

The issue I'm currently facing is that the libhd which is inside the repo is not detected by Makefile:

starting phase `build'
gcc -c -O2 -Wall -Wno-pointer-sign -pipe -g   -I/tmp/guix-build-hwinfo-21.75.drv-0/source/src/hd  -Lsrc hwinfo.c
make: *** No rule to make target '/tmp/guix-build-hwinfo-21.75.drv-0/source/src/libhd.a', needed by 'hwinfo'.  Stop.

The build continues but obviously fails when linking the final binary together. Does anybody have an idea how to tell make where to find the target?

Kind regards
Petr

---
(define-public libx86emu
(package
  (name "libx86emu")
  (version "3.1")
  (source (origin
            (method git-fetch)
            (uri
	      (git-reference
		(url "https://github.com/wfeldt/libx86emu")
		(commit version)))
	    (file-name (git-file-name name version))
            (sha256
             (base32
              "104xqc6nj9rpi7knl3dfqvasf087hlz2n5yndb1iycw35a6j509b"))))
  (build-system gnu-build-system)
  (native-inputs `(("git" ,git) ("perl" ,perl)))
  (arguments
    `(#:tests? #f
      #:make-flags (list (string-append "CC=" ,(cc-for-target)) (string-append "DESTDIR=" %output) (string-append "LIBDIR=/lib"))
      #:phases (modify-phases %standard-phases
		(delete 'configure)
		(add-after 'unpack 'fix-version-and-usr
                 (lambda* (#:key inputs #:allow-other-keys)
	          (delete-file "git2log")
		  (let* ((file (open-file "VERSION" "a")))
			(display ,version file)
			(close-port file))
                  (substitute* "Makefile"
                           (("/usr") "/"))
		   #t)))))
  (synopsis "x86 emulation library")
  (description "libx86emu is a small library to emulate x86 instructions. The focus here is not a complete emulation (go for qemu for this) but to cover enough for typical firmware blobs.
@enumerate
@item intercept any memory access or directly map real memory ranges
@item intercept any i/o access, map real i/o ports, or block any real i/o
@item intercept any interrupt
@item provides hook to run after each instruction
@item recognizes a special x86 instruction that can trigger logging
@item has integrated logging
@end enumerate")
  (home-page "https://github.com/wfeldt/libx86emu")
  (license license:bsd-1)))

(define-public hwinfo
(package
  (name "hwinfo")
  (version "21.75")
  (source (origin
            (method git-fetch)
            (uri
	      (git-reference
		(url "https://github.com/openSUSE/hwinfo")
		(commit version)))
	    (file-name (git-file-name name version))
            (sha256
             (base32
              "139bgzwi8iy1dz0g8mqpq9iig8klsmnb5c2sp0v7qgbgh7xxnqn3"))))
  (build-system gnu-build-system)
  (native-inputs `(("flex" ,flex) ("perl" ,perl) ("pkg-config" ,pkg-config)))
  (inputs `(("libx86emu" ,libx86emu) ("util-linux:lib" ,util-linux "lib")))
  (arguments
    `(#:tests? #f
      #:make-flags (list (string-append "DESTDIR=" %output) (string-append "CC=" ,(cc-for-target)) (string-append "HWINFO_VERSION=" ,version) (string-append "LIBDIR=" (assoc-ref %outputs "out") "/usr/lib"))
      #:phases (modify-phases %standard-phases
		(delete 'configure)
		(add-after 'unpack 'fix-sbin-and-flex
                 (lambda* (#:key inputs #:allow-other-keys)
	          (delete-file "git2log")
		  (let* ((file (open-file "VERSION" "a")))
			(display ,version file)
			(close-port file))
                  (substitute* "Makefile.common"
                           (("-I$(TOPDIR)/src/hd") (string-append (assoc-ref build-inputs "source") "/src/hd")))
                  (substitute* "Makefile"
                           (("/sbin") "/bin")
			   (("^TARGETS.*") "TARGETS = hwinfo hwinfo.pc\n")
			   (("/usr") "/"))
		  (substitute* "src/isdn/cdb/Makefile"
			   (("lex isdn_cdb.lex") "flex isdn_cdb.lex"))
		  (substitute* "hwinfo.pc.in"
			   (("prefix=/usr") (string-append "prefix=" %output)))
		   #t)))))
  (synopsis "Hardware information tool")
  (description "hwinfo/libhd are used to probe for the hardware present in the system. It can be used to generate a system overview log which can be later used for support.")
  (home-page "https://github.com/openSUSE/hwinfo")
  (license license:gpl2)))



             reply	other threads:[~2021-07-24 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-24 15:56 phodina [this message]
2021-07-24 17:44 ` Packaging hwinfo Wiktor Żelazny
2021-07-24 18:20   ` phodina
2021-07-24 19:50     ` Wiktor Żelazny
2021-07-24 20:57 ` Tobias Geerinckx-Rice
2021-07-26  6:09   ` phodina

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='xfxGnQpbAwfZ-JnYj-l_SzE9WikpjC9tymHZfysizrO1Yqca9Ot1mn8WkAsKu4RrWrKwE4VcfkavgIYmmyVDx77WaQyHDeTkTNvvhcRGVWQ=@protonmail.com' \
    --to=phodina@protonmail.com \
    --cc=help-guix@gnu.org \
    /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.
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).