From patchwork Mon Aug 30 19:35:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghav Gururajan X-Patchwork-Id: 32424 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A0E8A27BBE3; Mon, 30 Aug 2021 20:41:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 25B4727BBE1 for ; Mon, 30 Aug 2021 20:41:41 +0100 (BST) Received: from localhost ([::1]:35242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKnA4-0008KQ-5q for patchwork@mira.cbaines.net; Mon, 30 Aug 2021 15:41:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKn5a-0000kS-FG for guix-patches@gnu.org; Mon, 30 Aug 2021 15:37:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKn5a-0002ma-6t for guix-patches@gnu.org; Mon, 30 Aug 2021 15:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mKn5a-0000qD-3r for guix-patches@gnu.org; Mon, 30 Aug 2021 15:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50283] [PATCH v1 2/2] gnu: Add hwinfo. Resent-From: Raghav Gururajan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Aug 2021 19:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 50283@debbugs.gnu.org Cc: Raghav Gururajan Received: via spool by 50283-submit@debbugs.gnu.org id=B50283.16303521663147 (code B ref 50283); Mon, 30 Aug 2021 19:37:02 +0000 Received: (at 50283) by debbugs.gnu.org; 30 Aug 2021 19:36:06 +0000 Received: from localhost ([127.0.0.1]:60342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKn4b-0000nk-TU for submit@debbugs.gnu.org; Mon, 30 Aug 2021 15:36:06 -0400 Received: from out2.migadu.com ([188.165.223.204]:45587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKn4N-0000mv-3Q for 50283@debbugs.gnu.org; Mon, 30 Aug 2021 15:35:56 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1630352146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mHVNG6nDysNDF+tKHkvkO6nLx4kr9IsIQQVQQBXe99A=; b=DwPqtmIDTNDQsWoA9ZWp1uGqjm267b06J+5SgxUNw2XK4Of6Xx6eDrrRwaQS8R8z0SSckg xHDI1M1uPgBHwklZ3ZMNxB0TCYu95/tMEaFtE8lTNmMLfIm5csdRD3ufF4x0a2UZs6Cxhx /q9GxBwrzmZI2fZjYvtaiwGoIckZZYgZQk42pdhKMcHidSfucRnExsfOP40mMbjgLG6gf1 8pgyld/RkiTmosGgAnRAIgB6MkN0qcw4Y27svLcdN++XR8blz1sG8gi5LHCoPjCCrTMse7 TT56rIS466JXZFtw5tdhbSBTDnZUcOumt7wEure8w4L+q8EwN0hS1jO6QqYS8Q== Date: Mon, 30 Aug 2021 15:35:25 -0400 Message-Id: <20210830193525.2288-2-rg@raghavgururajan.name> In-Reply-To: <20210830193525.2288-1-rg@raghavgururajan.name> References: <20210830193525.2288-1-rg@raghavgururajan.name> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Raghav Gururajan X-ACL-Warn: , Raghav Gururajan via Guix-patches X-Patchwork-Original-From: Raghav Gururajan via Guix-patches via From: Raghav Gururajan X-getmail-retrieved-from-mailbox: Patches * gnu/packages/hardware.scm (hwinfo): New variable. --- gnu/packages/hardware.scm | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm index ff21c9c724..d7be7bf3cb 100644 --- a/gnu/packages/hardware.scm +++ b/gnu/packages/hardware.scm @@ -31,6 +31,7 @@ #:use-module (gnu packages crypto) #:use-module (gnu packages curl) #:use-module (gnu packages documentation) + #:use-module (gnu packages flex) #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) @@ -49,6 +50,7 @@ #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) #:use-module (gnu packages tls) + #:use-module (gnu packages virtualization) #:use-module (gnu packages web) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xml) @@ -66,6 +68,89 @@ ;; 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. +(define-public hwinfo + (package + (name "hwinfo") + (version "21.76") + (home-page "https://github.com/openSUSE/hwinfo") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url home-page) + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1910wzpdyp1ma1z2v0dripaljgrpl7vjq0f6b7qq9y220899hihb")) + (modules + '((guix build utils))) + (snippet + `(begin + ;; Create version file. + (call-with-output-file "VERSION" + (lambda (port) + (format port ,version))) + #t)))) + (build-system gnu-build-system) + (outputs '("out" "dev")) + (arguments + `(#:tests? #f ; no test-suite available + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (dev (assoc-ref outputs "dev")) + (include (string-append dev "/include")) + (lib (string-append dev "/lib")) + (sbin (string-append out "/sbin")) + (share (string-append out "/share"))) + ;; Remove unnecessary variables and + ;; correct values for version and prefix. + (substitute* "Makefile" + (("GIT2LOG.*\\:=.*$") "") + (("GITDEPS.*\\:=.*$") "") + (("BRANCH.*\\:=.*$") "") + (("VERSION.*\\:=.*$") + (string-append "VERSION := " ,version "\n")) + (("LIBDIR.*\\?=.*$") + (string-append "LIBDIR ?= " lib "\n")) + (("/usr/include") include) + (("/(usr|var)/(lib|lib64)") lib) + (("/usr/sbin") sbin) + (("/usr/share") share) + (("\\$\\(DESTDIR\\)/sbin ") "")) + ;; Add output "dev" to the run-path. + (substitute* "Makefile.common" + (("-Lsrc") + (string-append "-Lsrc " "-Wl,-rpath=" lib))) + ;; Correct program name of the lexical analyzer. + (substitute* "src/isdn/cdb/Makefile" + (("lex isdn_cdb.lex") "flex isdn_cdb.lex")) + ;; Patch pkgconfig file to point to output "dev". + (substitute* "hwinfo.pc.in" + (("/usr") dev))))) + (delete 'configure) + (add-before 'build 'set-env + (lambda _ + (setenv "CC" ,(cc-for-target)))) + (replace 'build + (lambda _ + (invoke "make" "shared")))))) + (native-inputs + `(("flex" ,flex) + ("perl" ,perl) + ("pkg-config" ,pkg-config))) + (inputs + `(("libx86emu" ,libx86emu) + ("util-linux:lib" ,util-linux "lib"))) + (synopsis "Hardware information tool") + (description "HwInfo is 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.") + (license license:gpl2+))) + (define-public ddcutil (package (name "ddcutil")