From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QCJOJwyLEWMsAAAAbAwnHQ (envelope-from ) for ; Fri, 02 Sep 2022 06:48:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iLVyJwyLEWMufAEA9RJhRA (envelope-from ) for ; Fri, 02 Sep 2022 06:48:12 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2C9CB868C for ; Fri, 2 Sep 2022 06:48:12 +0200 (CEST) Received: from localhost ([::1]:46212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTybC-0003uk-K0 for larch@yhetil.org; Fri, 02 Sep 2022 00:48:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTyb4-0003ua-66 for guix-patches@gnu.org; Fri, 02 Sep 2022 00:48:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTyb3-0005wo-Tp for guix-patches@gnu.org; Fri, 02 Sep 2022 00:48:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTyb3-00046z-P7 for guix-patches@gnu.org; Fri, 02 Sep 2022 00:48:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57537] [PATCH v2] gnu: Add ec Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Sep 2022 04:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57537 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Denis 'GNUtoo' Carikli Cc: 57537@debbugs.gnu.org Received: via spool by 57537-submit@debbugs.gnu.org id=B57537.166209407015734 (code B ref 57537); Fri, 02 Sep 2022 04:48:01 +0000 Received: (at 57537) by debbugs.gnu.org; 2 Sep 2022 04:47:50 +0000 Received: from localhost ([127.0.0.1]:44599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTyas-00045e-6I for submit@debbugs.gnu.org; Fri, 02 Sep 2022 00:47:50 -0400 Received: from tobias.gr ([80.241.217.52]:57570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTyao-000450-NM for 57537@debbugs.gnu.org; Fri, 02 Sep 2022 00:47:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=g7TkzGhifzSFH VxE+Y6v58kWn0N1p/KinqNZAgyfsmY=; h=references:in-reply-to:subject:cc: to:from:date; d=tobias.gr; b=FR/sOk6T0pTR1XW2ywz1PyvOgNp3Tp/SSoyNTe+1T gvBQyxUheFngPjEG3P7xKsHS5UDeEQ3ieBVklUnuWVghLJJd+gIR666KTgTes+Won2OYDu A159GKnuN0Srezozi1fENlkpJllc60CMpYamT95LAtE7tZDgAIBi1+Igzid8QNeo7YecEp cxNlkxgxvztxaJ6cfx15YSN9deGCO1AAvWeTUBFv/DKo2zaWQNWyuyqrgZ4N/u1sPQlouJ ED+l8Kh9BvqFzTxE4AMU+We6iDHpN/K80Vx0nlgdaccl5NJjbNp11BuRZEg6jz3kkYH7sf ghDNc76OpO/eAcL77T3Cw== Received: by submission.tobias.gr (OpenSMTPD) with ESMTP id 7490a88c; Fri, 2 Sep 2022 04:47:40 +0000 (UTC) MIME-Version: 1.0 Date: Fri, 02 Sep 2022 06:47:39 +0200 In-Reply-To: <20220902023239.26540-1-GNUtoo@cyberdimension.org> References: <20220902020049.15420-1-GNUtoo@cyberdimension.org> <20220902023239.26540-1-GNUtoo@cyberdimension.org> Message-ID: <5f8e53d3d302729b6bf61823b2c5139b@tobias.gr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662094092; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=g7TkzGhifzSFHVxE+Y6v58kWn0N1p/KinqNZAgyfsmY=; b=AJBAeygsjU5jzyyaBg21ct3dwE/UfspGXCRzRuzxUluW4eOx/+yPMYzi3u4WhyHn2f0P1B WGJ61CdT5UzRVuD98LveKO07BgFXVJXHjCNloP9u2ck0dQQfXdydyviMGNneUKv8Mwq3ge EAgO7kn3HzyaWYkhwmYn4jmlU5Cz8cKeVlbze4K+teUvrGbAoLFIDJap/gkCOdg/p0M7AW F8uiQomNCRCOBYZ7oUj7r8msy1q2JZa0MvxIfxCcXDt8DpCgnwgbdvSxgCD4zwI7/SN/pY jhLH5CsYfDnUXlIKb/l1hrpLgN7edIBm0trbK18WHhw1ob2lhXbhARfpednMXg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662094092; a=rsa-sha256; cv=none; b=cafPDBeybPdH/z8j+/gH55xepn2xfsMrfveiqVepMzt/Tw3RV6bXgPi1oG1Nd1PD4Xy4Bs C5J7CNfZWTFlywcG/C/u0Fcgke18Wblu+dngF11OCVm+b0IwxyoJqr1nduCiOIpN/8VwnI zATFy7+14mJf1xjBH5wRNRoMkUeq1351JXc9xVc2zhjRcdItfXIiSChupIfHUmKJFAaJCx 4T/UDRSr0oy9VE2dYeIk2TyRRSxzWBqmcHFcSX4LMi9d89i9qtI9WRDenFVMaBIl8u12x7 5nUGPKEaNUYgHQ7KgLpDYV+9Chuy5MsSQwmcm3l5sdWslJW1dP2pRqGn+63mHQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b="FR/sOk6T"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.27 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b="FR/sOk6T"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2C9CB868C X-Spam-Score: -3.27 X-Migadu-Scanner: scn1.migadu.com X-TUID: 2+WJ3MN4mJBl Hi Denis, This tool has come in handy a few times. (But did I package it? Nope…) Thank you for doing so! Don't forget to add a copyright line for yourself at the top of the file. Denis 'GNUtoo' Carikli 写道: > This installs the 'ec' binary in DESTDIR/usr/sbin which is wrong. Indeed, using ‘DESTDIR’ is almost always a mistake. There are a handful of occurrences in Guix, as a hack to get a buggy Makefile to work, but those are (thankfully) rare. Your v2 still has the ‘DESTDIR’ in it, though. Missed when committing? > gnu: Add ec We ♥ full stops, even here. > +(define-public ec > + (package > + (name "ec") > + (version (package-version linux-libre)) > + (source (package-source linux-libre)) > + (build-system gnu-build-system) > + (native-inputs (list coreutils)) I doubt this has any effect? > + (arguments > + '(#:make-flags (list (string-append "DESTDIR=" > + (assoc-ref %outputs "out")) The magical %output{s,} is fragile and almost never necessary in new code. Make the arguments a list of keywords/gexps and use #$output instead. > + "sbindir=/sbin") > + #:phases (modify-phases %standard-phases > + (delete 'configure) ;no configure script It makes no difference to Guix, but for the sake of humans: manipulate phases in their original order when there's no reason not to. Here, 'configure runs after 'unpack. > + (add-after 'unpack 'patch-Makefile > + (lambda _ > + (substitute* "tools/power/acpi/Makefile.config" > + (("/bin/true") > + (which "true"))) > + (substitute* "tools/power/acpi/Makefile.config" > + (("/usr/bin/install") > + (which "install"))) #t)) Aside: no need to call substitute* twice on the exact same (list of) file(s). Nor is it necessary to look up binaries in PATH ‘by hand’. Most tools do that already. (substitute* "Makefile.config" (("/bin/true") "true") (("/usr/bin/install") "install")) However, substitution is overkill as that Makefile doesn't hard-code either name. Instead, let's just use the make-flags upstream provides: λ grep '= /.*bin' Makefile* Makefile.config:INSTALL = /usr/bin/install -c Makefile.config: STRIPCMD = /bin/true -Since_we_are_debugging > + (add-after 'patch-Makefile 'enter-subdirectory > + (lambda _ > + (chdir "tools/power/acpi/tools/ec") #t))) I'm happy to be the one to inform you that trailing #ts are long-obsolete. Feel free to remove them whenever you encounter them. It is very satisfying. > + #:tests? #f)) ;no tests > + (home-page (package-home-page linux-libre)) > + (synopsis > + "Low level utility for reading or writing Embedded Controller > registers") > + (description > + "This utility can read or write specific registers or all the > +available registers of the Embedded Controllers supported by the Linux The ‘ec’ description should probably mention the word ‘EC’ *somewhere*… ;-) → ‘@acronym{EC, Embedded Controller}’ > +kernel. To work it needs to run as root, to have the ec_sys driver > +loaded, and to have the debugfs filesystem mounted at > +/sys/kernel/debug/. ‘@code{ec_sys} module loaded’, ‘@code{debugfs} file system’, ‘@file{/sys/kernel/debug}’. > To make write support work, the ec_sys module > +needs to be loaded with the write_support=1 parameter. Write support > +can also be enabled after loading the module with > +the 'echo 1 > /sys/module/ec_sys/parameters/write_support' command.") Using @code{}/@file{}/@samp{}… also applies here, but do you know if there's *any* documentation we could install? This kind of highly-specific how-to isn't a great package description. I wanted to send back a proper patch but this (below) is all I have time for. I can't push yet anyway, so no rush. Thanks again, T G-R (define-public ec (package (name "ec") (version (package-version linux-libre)) (source (package-source linux-libre)) (build-system gnu-build-system) (arguments (list #:tests? #f ; no tests #:make-flags #~(list (string-append "sbindir=" #$output "/sbin") "INSTALL=install" "STRIPCMD=true") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'enter-subdirectory (lambda _ (chdir "tools/power/acpi/tools/ec"))) (delete 'configure)))) ; no configure script (home-page (package-home-page linux-libre)) (synopsis "Low level utility to read or write Embedded Controller registers") (description "…") (license license:gpl2)))