unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Packaging hwinfo
@ 2021-07-24 15:56 phodina
  2021-07-24 17:44 ` Wiktor Żelazny
  2021-07-24 20:57 ` Tobias Geerinckx-Rice
  0 siblings, 2 replies; 6+ messages in thread
From: phodina @ 2021-07-24 15:56 UTC (permalink / raw)
  To: help-guix@gnu.org

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-26  6:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-24 15:56 Packaging hwinfo phodina
2021-07-24 17:44 ` 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

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