From unknown Sun Aug 10 07:38:18 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#53059] [PATCH] gnu: Add gpu-switch. Resent-From: Jorge Acereda Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 19:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53059 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53059@debbugs.gnu.org Cc: Jorge Acereda X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164149628629208 (code B ref -1); Thu, 06 Jan 2022 19:12:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Jan 2022 19:11:26 +0000 Received: from localhost ([127.0.0.1]:42339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5YAT-0007ap-9W for submit@debbugs.gnu.org; Thu, 06 Jan 2022 14:11:25 -0500 Received: from lists.gnu.org ([209.51.188.17]:52032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5YAP-0007aV-Gy for submit@debbugs.gnu.org; Thu, 06 Jan 2022 14:11:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5YAO-0000wr-Rn for guix-patches@gnu.org; Thu, 06 Jan 2022 14:11:16 -0500 Received: from [2a00:1450:4864:20::329] (port=46673 helo=mail-wm1-x329.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5YAN-0007PR-0k for guix-patches@gnu.org; Thu, 06 Jan 2022 14:11:16 -0500 Received: by mail-wm1-x329.google.com with SMTP id d187-20020a1c1dc4000000b003474b4b7ebcso1051992wmd.5 for ; Thu, 06 Jan 2022 11:11:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oStRKOLB+sfu4ATCEmMi4WHMlGUqV+ZqyTgbgh7oCXc=; b=e5nbIl2TNoMLti4gatJMSNHdcxS7650OBZ46nuR2SR+V1yOnIkIBxy/+l3B0TbZZpD 48PTPNygctvWQrvdKtGYCnvvTmL4tRBuoPqJxzzVxC/juAqRXcxwJR1duYaEEMF3F6hR APhKyyagU4G58vLYi6mphTIVwWEU0Qs1kbXsdtey8d6dP9xNTE5Rl4SpcKGCwzOV1XLw HNOoTFgz5qt5KCOz4d4TS8HMTlLedEnK1+696E+FeOHDTbX9EmTuQlGVgBOSEMRsOflC V12B0VLV4gsWBM3oGAZNeqdMZ9y0A36tV9ZjQTjgVK3khJFSLyzvRSARrBMbuX2Tm0Rj sQrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oStRKOLB+sfu4ATCEmMi4WHMlGUqV+ZqyTgbgh7oCXc=; b=J1jyE/qODL6JYA3yr+9Mq33PGTJPwAMe8w7debnoyKdDHw9LjAqCzykk6/LLF2bgwS EliHgKpogNmVzqOEDrPTW6pmoJYEg/Su4Dt9MaiY6daBw6RAMbn0mMugvKh1UZ6S3Qyi RBHpYLI23yw+cBkZYB5OrFiy6ca5LYUhyCy1VXhdvzmG9WzYrxVLLxUBMUKmleNdRhwJ tzc8XOd/4P12XhRNF+wOjIz8E8U6dc9m4/Xw/F2VVc5L/aA8zuULc2LgYakoSjeTVwqh wKsBd1OVZOt3yDANSiJ9imR52fgkA2UkOnWK1eXWZMwXPMq/El0gCry1hU6G6EZ07jeL hppA== X-Gm-Message-State: AOAM5312+D+oqfMQqJllPFPdWuTpd9d+PFmrRiUjrsSY+33kEFJUOwow otKfrQGX92Cm4e2DHYxa++VI21hTo38= X-Google-Smtp-Source: ABdhPJy94o44u/7hgjCYJ/CcL6okgzHafZJlEKdqRcNaftqzjjSCxcbseWeHsqqCnCuE1XZh2XVcaw== X-Received: by 2002:a1c:2b42:: with SMTP id r63mr8068809wmr.80.1641496272999; Thu, 06 Jan 2022 11:11:12 -0800 (PST) Received: from mbp.home ([92.186.167.53]) by smtp.gmail.com with ESMTPSA id k10sm2726230wrz.113.2022.01.06.11.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 11:11:12 -0800 (PST) From: Jorge Acereda Date: Thu, 6 Jan 2022 20:11:08 +0100 Message-Id: <79655b434893691c6647f28087652f162aad80de.1641496236.git.jacereda@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=yes Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::329 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=jacereda@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/graphics.scm (gpu-switch): New variable. --- gnu/packages/graphics.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index fe35aaad2d..b5b50f6192 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -27,6 +27,7 @@ ;;; Copyright =?UTF-8?Q?=C2?= [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jacereda[at]gmail.com) 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 1.3 SPOOFED_FREEMAIL No description available. 1.5 SPOOF_GMAIL_MID From Gmail but it doesn't seem to be... X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * gnu/packages/graphics.scm (gpu-switch): New variable. --- gnu/packages/graphics.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index fe35aaad2d..b5b50f6192 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -27,6 +27,7 @@ ;;; Copyright © 2021 Andy Tai ;;; Copyright © 2021 Ekaitz Zarraga ;;; Copyright © 2021 Vinicius Monego +;;; Copyright © 2022 Jorge Acereda ;;; ;;; This file is part of GNU Guix. ;;; @@ -113,6 +114,7 @@ (define-module (gnu packages graphics) #:use-module (guix build-system meson) #:use-module (guix build-system python) #:use-module (guix build-system qt) + #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix hg-download) @@ -2011,3 +2013,39 @@ (define-public monado such as VR and AR on mobile, PC/desktop, and any other device. Monado aims to be a complete and conforming implementation of the OpenXR API made by Khronos.") (license license:boost1.0))) + +(define-public gpu-switch + (package + (name "gpu-switch") + (version "2017-04-28") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/0xbb/gpu-switch") + (commit "a365f56d435c8ef84c4dd2ab935ede4992359e31"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1jnh43nijkqd83h7piq7225ixziggyzaalabgissyxdyz6szcn0r")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let ((out (assoc-ref %outputs "out")) + (gpu-switch (search-input-file %build-inputs "gpu-switch")) + (readme (search-input-file %build-inputs "README.md"))) + (install-file gpu-switch (string-append out "/bin")) + (install-file readme (string-append out "/share/doc/gpu-switch-" ,version)) + #t)))) + (home-page "https://github.com/0xbb/gpu-switch") + (synopsis "GPU switcher for dual-GPU MacBook Pro models") + (description + "Switch between the integrated and dedicated GPU of dual-GPU MacBook Pro +models for the next reboot. + +It aims to remove the need of booting into OS X and running gfxCardStatus +v2.2.1 to switch to the integrated card.") + (license license:expat))) + -- 2.34.0 From unknown Sun Aug 10 07:38:18 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#53059] [PATCH] gnu: Add gpu-switch. References: <79655b434893691c6647f28087652f162aad80de.1641496236.git.jacereda@gmail.com> In-Reply-To: <79655b434893691c6647f28087652f162aad80de.1641496236.git.jacereda@gmail.com> Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 21:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53059 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53059@debbugs.gnu.org Cc: Jorge Acereda Received: via spool by 53059-submit@debbugs.gnu.org id=B53059.164150289022565 (code B ref 53059); Thu, 06 Jan 2022 21:02:02 +0000 Received: (at 53059) by debbugs.gnu.org; 6 Jan 2022 21:01:30 +0000 Received: from localhost ([127.0.0.1]:42490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5Zt4-0005rs-0h for submit@debbugs.gnu.org; Thu, 06 Jan 2022 16:01:30 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:54212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5Zt3-0005rj-0M for 53059@debbugs.gnu.org; Thu, 06 Jan 2022 16:01:29 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id fZ1S2600L4UW6Th01Z1TjE; Thu, 06 Jan 2022 22:01:27 +0100 Message-ID: From: Maxime Devos Date: Thu, 06 Jan 2022 22:01:17 +0100 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-gL1LCpJzFAkBexPBuCvO" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641502887; bh=j6+EvXZvDJzCX96jFrR6fne8Q7xQNGdLerbybuMu70o=; h=Subject:From:To:Cc:Date; b=maDxmxg0OL6DQgIOq6wyL9vnEfj1Encu8sATl1OuvEfzc2s+IMZbyQ7ISMLNVflW9 eXK3azYez/nyCLdc/sXY5AdDknLNQ52W/EixrrXGVkoe+AdBOmUWYZY1GcyArRgOzL ofGBLn9CKWroBrgtEiEuj69pClkZJrPOdhZJdxIAzySModOG8Jii8UkIChsGeJoQ8A 494gerKm1WdRQj5AkhRyD18OjMZUyWwzfADG7FJhP84A7QrRyRdLpD6p3dk+4M1PIS 58gN4WSfbhJF5T1dKhFLBndR5q7+nXH+Q7l5OOpoAhiVVU76RwTEbfZPD85QV42NZ8 pHSddVQon0nkA== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-gL1LCpJzFAkBexPBuCvO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Looking at , it appears that it uses 'chattr', 'mount', 'grep', 'cat' and 'basename'. So the corresponding packages would need to be added to 'inputs' and a few 'substitute*' are required such that gpu-switch doesn't require 'chattr' & friends to be in the environment. /sys/firmware/efi/efivars is rather Linux-specific, presumably non-existent on the hurd, so the hurd systems need to be removed from supported-systems. > + (name "gpu-switch") > + (version "2017-04-28") > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/0xbb/gpu-switch") > + (commit "a365f56d435c8ef84c4dd2ab935ede4992359e31"))) Where did you get this version/commit pair from? I'm not seeing it on . Greetings, Maxime. --=-gL1LCpJzFAkBexPBuCvO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYddYnRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rtSAQC/JnfwUBSOkNb4sk1VXhifFZyl Hv0lPy1I3YOyINm3CAEAtDO5VIaoC3QcZpXdkq2sKps3xI3w7pdEQHwB1gGbrgU= =PWPp -----END PGP SIGNATURE----- --=-gL1LCpJzFAkBexPBuCvO-- From unknown Sun Aug 10 07:38:18 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#53059] [PATCH] gnu: Add gpu-switch. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Jan 2022 10:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53059 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jorge Acereda Cc: 53059@debbugs.gnu.org Received: via spool by 53059-submit@debbugs.gnu.org id=B53059.164155236623558 (code B ref 53059); Fri, 07 Jan 2022 10:47:02 +0000 Received: (at 53059) by debbugs.gnu.org; 7 Jan 2022 10:46:06 +0000 Received: from localhost ([127.0.0.1]:43137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5ml3-00067t-TY for submit@debbugs.gnu.org; Fri, 07 Jan 2022 05:46:06 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:37118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5mkz-00067A-D2 for 53059@debbugs.gnu.org; Fri, 07 Jan 2022 05:46:04 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by andre.telenet-ops.be with bizsmtp id fmlz2600m4UW6Th01mlzb8; Fri, 07 Jan 2022 11:45:59 +0100 Message-ID: <1b5f53af3fc918568cc384add8e74a8256218a63.camel@telenet.be> From: Maxime Devos Date: Fri, 07 Jan 2022 11:45:54 +0100 In-Reply-To: <87pmp42w9k.fsf@gmail.com> References: <87pmp42w9k.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-bFxc7g8kJ2E0KxQJHELO" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641552359; bh=EsKonWCPo6uBni551G3JemU30oZLVB7zIEh0HGZDM2s=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=YmkgOaGABjUfhCVK7U3fvMLOMvD9TD3hqmkqETn5YxHt/N9SuYZ72sjA8ENkpwt/d D0Q9VoGMQHv5STQ2rtvX4cIIieKdp7pl4Y7fLBg3Sw1ShOTJe5RB6J2Yg7I0Pg9kaN kyZIg3er/Pq1QmOZvqggN9iT8wbPwmsKmFmq5dPg7Y+put+PlyNCzS/BwxM513r556 DXFJrUOp4eaujgPKwGO0Ykun7oodPH64D+S3/Pr1rytVOecWxBlvE/ilFRvhCOdTN9 XFc5JesXqR1qJ4dxpeNHKZmD1JJFDj9NuzItdXBxWQBkVgb3cXskGKx+KEZLpbvcC6 qJDiVuNn6FL2g== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-bFxc7g8kJ2E0KxQJHELO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable [Re-adding debbugs to CC] Jorge Acereda schreef op vr 07-01-2022 om 02:02 [+0100]: > [...] > >=20 > > /sys/firmware/efi/efivars is rather Linux-specific, presumably > > non-existent on the hurd, so the hurd systems need to be removed from > > supported-systems. >=20 > Would it be better in linux.scm instead? While it currently is Linux-specific, in principle it could be ported to the Hurd, a BSD or Windows or whatever -- in fact, looking at https://github.com/0xbb/gpu-switch, it appears to support =E2=80=98osx=E2= =80=99 and Windows. linux.scm is more for Linux kernel modules, the Linux kernel, userspace bindings to kernel syscalls ... There probably are a few misplaced packages in linux.scm. Greetings, Maxime --=-bFxc7g8kJ2E0KxQJHELO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdgZ4hccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gRRAQCZA9T9a4zmyCKEAPOhGbIem2cm 4r0WfpXoHlXdZzMUOwD+Ph4sqzlOWmSue35G2JB1TN+eFBXPbi5oc+SRcGV/6ww= =Lvbw -----END PGP SIGNATURE----- --=-bFxc7g8kJ2E0KxQJHELO-- From unknown Sun Aug 10 07:38:18 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#53059] [PATCH v2] gnu: Add gpu-switch. References: <79655b434893691c6647f28087652f162aad80de.1641496236.git.jacereda@gmail.com> In-Reply-To: <79655b434893691c6647f28087652f162aad80de.1641496236.git.jacereda@gmail.com> Resent-From: Jorge Acereda Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Jan 2022 18:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53059 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53059@debbugs.gnu.org Cc: Jorge Acereda Received: via spool by 53059-submit@debbugs.gnu.org id=B53059.164158103624046 (code B ref 53059); Fri, 07 Jan 2022 18:44:02 +0000 Received: (at 53059) by debbugs.gnu.org; 7 Jan 2022 18:43:56 +0000 Received: from localhost ([127.0.0.1]:45890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5uDQ-0006Fg-OU for submit@debbugs.gnu.org; Fri, 07 Jan 2022 13:43:56 -0500 Received: from mail-wr1-f48.google.com ([209.85.221.48]:35651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5uDJ-0006FI-GU for 53059@debbugs.gnu.org; Fri, 07 Jan 2022 13:43:51 -0500 Received: by mail-wr1-f48.google.com with SMTP id e9so11230077wra.2 for <53059@debbugs.gnu.org>; Fri, 07 Jan 2022 10:43:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0jOmp8sm+I0njEp1KAjAqRcU4CBb9i/a5zPESWjyQ0I=; b=FcAQhKLPl2tC1zf0Xnaphd5vezVxCBRNAqCdokwrqjzJP3QD+j+vae/Ll3ymqBZvk/ Zc4KsGzAQCmuCiO4wd4tUkyaOiWRiDN2yyUW6Iorv9kaqo7Xbqk3EjF8dV/K1i/4JPHv 6u6Vbm7jDGTLVm5hqwSw9TBSL6kL8X90e0Mc9AQ6KKgXaMRtzON+ua5vHe9iyuy2ZTEh kO9RXuhr7DKKTNNRlE0ZEfwI/GLBTZd6eKTZqhDiv+D7Of65xHKTAHLYaZGPmbV2KJ0w LKhEpLety+qyot/IefQxXAnA6PvebNfaLEIB1kd9EUThc+alcfyv7cH9vmYYWGzjOH1O 99LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0jOmp8sm+I0njEp1KAjAqRcU4CBb9i/a5zPESWjyQ0I=; b=3avCeziLWncHrc7dK1B4USVHnt1BlvtTKTotmrqA3DI5kSocHm0IwVg0HadP7g0R+9 ca9HzDWUqPOmn1ER+tgYkjOQp0d0Ga99ttMJZ7hO4Cfhu+TxHndC7m/aqwHGp+iipN+M +FxUoM5/yxYcyUeDGKfo0+j9hddtVWT+O0E7KSIVpZB9lpA291yh6VY6Ix0oO8VZ3CNt 7oYTAN502IrvblYnAyVj3ZMhPC0X8lcTfoGoKU8GtgDfktzI7h3XwBJpDHRdxLQMRvXK LFJ3igWeN8dGNX78mkpNy2LBn01CO5ctkJ1hfKl/yyNsKXnaPbqBIpKIX76VIo8oLKRq Dezg== X-Gm-Message-State: AOAM530/ZFy65t8rV5WrJQeYcQA95Z+KhGFhGglsTL5WewKVBspFUglt dfS/4QrNjCekT3Ozmm1maMxZDfYbOUYQ2w== X-Google-Smtp-Source: ABdhPJzHzUN2afFc27mPMSrQhbbV45BEK6gJ3/AiK+aRTxmfEA2szMo2G0Yd7j7GcERfa/utdywYLA== X-Received: by 2002:a5d:6389:: with SMTP id p9mr295197wru.125.1641580645954; Fri, 07 Jan 2022 10:37:25 -0800 (PST) Received: from localhost.localdomain ([185.39.42.151]) by smtp.gmail.com with ESMTPSA id b14sm5616018wrg.15.2022.01.07.10.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 10:37:25 -0800 (PST) From: Jorge Acereda Date: Fri, 7 Jan 2022 19:37:20 +0100 Message-Id: <6a263efbca6f379b056e06887de50e6cccac9929.1641580314.git.jacereda@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=yes Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The package version is the same one used in nixpkgs (current tip). Should I add some "unstable" string somewhere? Also, I'm pretty sure I overcomplicated things, there must be some easier way to patch the executable paths. * gnu/packages/graphics.scm (gpu-switch): New variable. --- gnu/packages/graphics.scm | 58 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index fe35aaad2d..d425a18c18 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -27,6 +27,7 @@ ;;; Copyright © 2021 Andy Tai ;;; Copyright © 2021 Ekaitz Zarraga ;;; Copyright © 2021 Vinicius Monego +;;; Copyright © 2022 Jorge Acereda ;;; ;;; This file is part of GNU Guix. ;;; @@ -113,12 +114,14 @@ (define-module (gnu packages graphics) #:use-module (guix build-system meson) #:use-module (guix build-system python) #:use-module (guix build-system qt) + #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix hg-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) - #:use-module (guix utils)) + #:use-module (guix utils) + #:use-module (ice-9 match)) (define-public mmm (package @@ -2011,4 +2014,56 @@ (define-public monado such as VR and AR on mobile, PC/desktop, and any other device. Monado aims to be a complete and conforming implementation of the OpenXR API made by Khronos.") (license license:boost1.0))) + +(define-public gpu-switch + (package + (name "gpu-switch") + (version "2017-04-28") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/0xbb/gpu-switch") + (commit "a365f56d435c8ef84c4dd2ab935ede4992359e31"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1jnh43nijkqd83h7piq7225ixziggyzaalabgissyxdyz6szcn0r")))) + (build-system trivial-build-system) + (inputs + (list bash e2fsprogs util-linux grep coreutils which)) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils) (ice-9 match)) + (let* ((out (assoc-ref %outputs "out")) + (gpu-switch (search-input-file %build-inputs "gpu-switch")) + (bin (string-append out "/bin")) + (out-gpu-switch (string-append bin "/gpu-switch")) + (readme (search-input-file %build-inputs "README.md"))) + (install-file gpu-switch bin) + (for-each + (match-lambda + ((pkg . nm) (substitute* out-gpu-switch + ((nm) + (string-append (assoc-ref %build-inputs pkg) + "/bin/" nm))))) + '(("coreutils" . "basename") + ("bash" . "bash") + ("util-linux" . "mount") + ("which" . "which") + ("coreutils" . "cat") + ("e2fsprogs" . "chattr") + ("grep" . "grep"))) + (install-file readme (string-append out "/share/doc/gpu-switch-" ,version)) + #t)))) + (home-page "https://github.com/0xbb/gpu-switch") + (synopsis "GPU switcher for dual-GPU MacBook Pro models") + (description + "Switch between the integrated and dedicated GPU of dual-GPU MacBook Pro +models for the next reboot. + +It aims to remove the need of booting into OS X and running gfxCardStatus +v2.2.1 to switch to the integrated card.") + (license license:expat))) + -- 2.34.0 From unknown Sun Aug 10 07:38:18 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#53059] [PATCH v2] gnu: Add gpu-switch. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 08 Jan 2022 15:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53059 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jorge Acereda , 53059@debbugs.gnu.org Received: via spool by 53059-submit@debbugs.gnu.org id=B53059.164165631720046 (code B ref 53059); Sat, 08 Jan 2022 15:39:01 +0000 Received: (at 53059) by debbugs.gnu.org; 8 Jan 2022 15:38:37 +0000 Received: from localhost ([127.0.0.1]:48637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6Dnc-0005DA-TX for submit@debbugs.gnu.org; Sat, 08 Jan 2022 10:38:37 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:39386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6DnY-0005Cv-Ux for 53059@debbugs.gnu.org; Sat, 08 Jan 2022 10:38:32 -0500 Received: from [172.20.10.5] ([213.132.158.202]) by baptiste.telenet-ops.be with bizsmtp id gFeR260074NHtyl01FeStz; Sat, 08 Jan 2022 16:38:27 +0100 Message-ID: <7a15b34a40868bcbc7a63c3aea787b0f176e6077.camel@telenet.be> From: Maxime Devos Date: Sat, 08 Jan 2022 15:38:20 +0000 In-Reply-To: <6a263efbca6f379b056e06887de50e6cccac9929.1641580314.git.jacereda@gmail.com> References: <6a263efbca6f379b056e06887de50e6cccac9929.1641580314.git.jacereda@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-a+QYe9mEPpn1ckpVoN+b" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641656307; bh=God1taptmzmTmr+NgGX6NwMQZTnHwbjmOZDvOKKjKo8=; h=Subject:From:To:Date:In-Reply-To:References; b=Tn2r9SsIyfjKRXt8Er1w5dEi99/gu4NPrmXXA8Xs3VRqf8kgvZ673jOCQwsuYyozE p3+njTDna4DgMygd3UH6AoI7Y0ihC3CP6Pf8kWwCOGHOcerNWTWecpaShFng7BerYa xTrQZ7h7VQEqFYUMaqGrpRX3OwgQycXvh2R9gThP88u8L/56QYxxkOe9oFrjA7gLdv ayNdB+NI071CPsYFYgOjg0zxXcU8pXcIO6kNcWux6yvGHGfR22CSUeLIHOnctTfuP4 nQKPEWKFze+65/9ujTWdeXQm12uNo1Pssmwf+ZcLXakiE3LijXbm2T+9ft1WeW1tqS x1yAse+S/atyg== X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-a+QYe9mEPpn1ckpVoN+b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Jorge Acereda schreef op vr 07-01-2022 om 19:37 [+0100]: > The package version is the same one used in nixpkgs (current tip). > Should I add some "unstable" string somewhere?=C2=A0 Also, I'm pretty sur= e > I overcomplicated things, there must be some easier way to patch the > executable paths. Ok, but anyone looking at the package definition of gpu-switch would be having a hard time figuring out these reasons. Also, the version used by nixpkgs isn't very relevant; nixpkgs might be out-of-date. An "-unstable" version suffix isn't very informative, and doesn't seem correct here: there haven't been any changes in gpu-switch for about five years, which seems rather stable to me. I suggest having a look at =E2=80=9817.4.3 Version Numbers=E2=80=99 in the = manual, in particular the text about VCS vs formal releases. Because upstream isn't formally releasing anything, using a revision from git seems appropriate to me, but the reasons needs to be documented with a comment. E.g., see 'emacs-graphql-mode'. > * gnu/packages/graphics.scm (gpu-switch): New variable. > --- > =C2=A0gnu/packages/graphics.scm | 58 ++++++++++++++++++++++++++++++++++++= ++- > =C2=A01 file changed, 57 insertions(+), 1 deletion(-) >=20 > diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm > index fe35aaad2d..d425a18c18 100644 > --- a/gnu/packages/graphics.scm > +++ b/gnu/packages/graphics.scm GPUs aren't only used for graphics, see e.g. . I would put it in hardware.scm instead. > @@ -27,6 +27,7 @@ > =C2=A0;;; Copyright =C2=A9 2021 Andy Tai > =C2=A0;;; Copyright =C2=A9 2021 Ekaitz Zarraga > =C2=A0;;; Copyright =C2=A9 2021 Vinicius Monego > +;;; Copyright =C2=A9 2022 Jorge Acereda > =C2=A0;;; > =C2=A0;;; This file is part of GNU Guix. > =C2=A0;;; > @@ -113,12 +114,14 @@ (define-module (gnu packages graphics) > =C2=A0=C2=A0 #:use-module (guix build-system meson) > =C2=A0=C2=A0 #:use-module (guix build-system python) > =C2=A0=C2=A0 #:use-module (guix build-system qt) > +=C2=A0 #:use-module (guix build-system trivial) > =C2=A0=C2=A0 #:use-module (guix download) > =C2=A0=C2=A0 #:use-module (guix git-download) > =C2=A0=C2=A0 #:use-module (guix hg-download) > =C2=A0=C2=A0 #:use-module ((guix licenses) #:prefix license:) > =C2=A0=C2=A0 #:use-module (guix packages) > -=C2=A0 #:use-module (guix utils)) > +=C2=A0 #:use-module (guix utils) > +=C2=A0 #:use-module (ice-9 match)) Not needed, the use of 'match' is only at the build side. > =C2=A0 > =C2=A0(define-public mmm > =C2=A0=C2=A0 (package > @@ -2011,4 +2014,56 @@ (define-public monado > =C2=A0such as VR and AR on mobile, PC/desktop, and any other device.=C2= =A0 Monado aims to be > =C2=A0a complete and conforming implementation of the OpenXR API made by = Khronos.") > =C2=A0=C2=A0=C2=A0=C2=A0 (license license:boost1.0))) > =C2=A0+ > +(define-public gpu-switch > +=C2=A0 (package > +=C2=A0=C2=A0=C2=A0 (name "gpu-switch") > +=C2=A0=C2=A0=C2=A0 (version "2017-04-28") > +=C2=A0=C2=A0=C2=A0 (source > +=C2=A0=C2=A0=C2=A0=C2=A0 (origin > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (method git-fetch) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (uri (git-reference > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (url "https://github.com/0xbb/gpu-switch") > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (commit "a365f56d435c8ef84c4dd2ab935ede4992359e31"))) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (file-name (git-file-name name vers= ion)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (sha256 > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (base32 "1jnh43nijkqd83h7piq7= 225ixziggyzaalabgissyxdyz6szcn0r")))) > +=C2=A0=C2=A0=C2=A0 (build-system trivial-build-system) > +=C2=A0=C2=A0=C2=A0 (inputs > +=C2=A0=C2=A0=C2=A0=C2=A0 (list bash e2fsprogs util-linux grep coreutils = which)) I suggest bash-minimal and coreutils-minimal to reduce the closure. > +=C2=A0=C2=A0=C2=A0 (arguments > +=C2=A0=C2=A0=C2=A0=C2=A0 `(#:modules ((guix build utils)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #:builder > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (begin > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (use-modules (guix buil= d utils) (ice-9 match)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let* ((out (assoc-ref = %outputs "out")) %outputs is sort-of deprecated, it is recommended to use G-exps instead: (let* ((out #$output) ...) ...) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (gpu-switch (search-input-file %build-inputs "gpu-switch= ")) Likewise, %build-inputs is deprecated, and it doesn't do the right thing when cross-compiling, because (implicit) native inputs go before native inputs. In this particular case, it would work, but I'd avoid this fragility, by doing something like (let (... (inputs #$inputs) (gpu-switch (search-input-file inputs "gpu-switch"))) ...) instead. Personally, I'd do #$(file-append source "/gpu-switch") instead though. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (bin (string-append out "/bin")) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (out-gpu-switch (string-append bin "/gpu-switch")) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (readme (search-input-file %build-inputs "README.md"))) Likewise. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (install-fi= le gpu-switch bin) The shebang starts with #!/usr/bin/env /gnu/store/[a hash]-bash-5.1.8/bin/bash so the script depends on the system's /usr/bin/env. Can this dependency be removed, e.g. using patch-shebang? The script has a line $(/gnu/store/y5jxkx484x7s2c2n7dc8wprh5sbps7pl-coreutils- 8.32/bin/basename $0) --integrated # Switch to the integrated GPU but this is fragile, what if I create a symlink named "switch the gpu" pointing to gpu-switch (without the quotes, and with the spaces)? Then I get $ ./switch\ the\ gpu=20 /gnu/store/y5jxkx484x7s2c2n7dc8wprh5sbps7pl-coreutils- 8.32/bin/basename: extra operand 'gpu' Try '/gnu/store/y5jxkx484x7s2c2n7dc8wprh5sbps7pl-coreutils- 8.32/bin/basename --help' for more information. /gnu/store/y5jxkx484x7s2c2n7dc8wprh5sbps7pl-coreutils- 8.32/bin/basename: extra operand 'gpu' Try '/gnu/store/y5jxkx484x7s2c2n7dc8wprh5sbps7pl-coreutils- 8.32/bin/basename --help' for more information. /gnu/store/y5jxkx484x7s2c2n7dc8wprh5sbps7pl-coreutils- 8.32/bin/basename: extra operand 'gpu' Try '/gnu/store/y5jxkx484x7s2c2n7dc8wprh5sbps7pl-coreutils- 8.32/bin/basename --help' for more information. Can this be fixed (upstream)? Putting "" around the $0 would probably be enough. Also, I thought it might be required to place -- before the "$0" (in case the symlink is named "--help"), but it seems to work without in my tests. I would still recommend an -- argument though, to make things less fragile. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (for-each > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (matc= h-lambda > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ((pkg . nm) (substitute* out-gpu-switch I see the following line in the output of "gpu-switch" gpu-switch --dedi/gnu/store/y5jxkx484x7s2c2n7dc8wprh5sbps7pl- coreutils-8.32/bin/cated # Switch to the dedi/gnu/store/y5jxkx484x7s2c2n7dc8wprh5sbps7pl-coreutils- 8.32/bin/cated GPU =20 Likewise: printf "Fatal: Couldn't /gnu/store/64d0mxsjqifrpashlhyd3rf7zm2r709x-util-linux-2.37.1/bin/mount '${sysfs_efi_vars}'.\n" 1>&2 Seems like the substitutions are not sufficiently specific. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 ((nm) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (string-append (assoc-ref %build-inputs pkg) %build-inputs -> #$inputs? Or maybe even use search-input-file. Also, you can substitute multiple things with a single substitute*. E.g.,=20 ;; From the manual, see (guix)Build Utilities (substitute* file (("hello") "good morning\n") (("foo([a-z]+)bar(.*)$" all letters end) (string-append "baz" letter end))) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #t)))) Returning #true in phases is not required anymore, presumably the same holds for #:builder. > +=C2=A0=C2=A0=C2=A0 (home-page "https://github.com/0xbb/gpu-switch") > +=C2=A0=C2=A0=C2=A0 (synopsis "GPU switcher for dual-GPU MacBook Pro mode= ls") > +=C2=A0=C2=A0=C2=A0 (description > +=C2=A0=C2=A0=C2=A0=C2=A0 "Switch between the integrated and dedicated GP= U of dual-GPU MacBook Pro > +models for the next reboot. Is this specific for =E2=80=98MacBook Pro models=E2=80=99, or does it work = for any computer that has a certain combination of =E2=80=98integrated=E2=80=99 and= =E2=80=98dedicated=E2=80=99 GPU? > +It aims to remove the need of booting into OS X and running gfxCardStatu= s > +v2.2.1 to switch to the integrated card.") Is this v2.2.1 important? Greetings, Maxime. --=-a+QYe9mEPpn1ckpVoN+b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdmv7BccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lKlAQCGU7vkcgB8PqgN7Zg8KiwTMd4a TavQS8YHsXOtHFX93QD9G6NnyWSQvtvt1yVQSPJ0JF5CiEkFtzR59i1F3sUtxwQ= =DQxB -----END PGP SIGNATURE----- --=-a+QYe9mEPpn1ckpVoN+b-- From unknown Sun Aug 10 07:38:18 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#53059] [PATCH v3] gnu: Add gpu-switch. References: <79655b434893691c6647f28087652f162aad80de.1641496236.git.jacereda@gmail.com> In-Reply-To: <79655b434893691c6647f28087652f162aad80de.1641496236.git.jacereda@gmail.com> Resent-From: Jorge Acereda Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 08 Jan 2022 19:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53059 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53059@debbugs.gnu.org Cc: Jorge Acereda Received: via spool by 53059-submit@debbugs.gnu.org id=B53059.164167098713947 (code B ref 53059); Sat, 08 Jan 2022 19:44:02 +0000 Received: (at 53059) by debbugs.gnu.org; 8 Jan 2022 19:43:07 +0000 Received: from localhost ([127.0.0.1]:48747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6HcI-0003cr-Rq for submit@debbugs.gnu.org; Sat, 08 Jan 2022 14:43:07 -0500 Received: from mail-wm1-f50.google.com ([209.85.128.50]:53211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6HcG-0003cM-JE for 53059@debbugs.gnu.org; Sat, 08 Jan 2022 14:43:05 -0500 Received: by mail-wm1-f50.google.com with SMTP id v123so6183178wme.2 for <53059@debbugs.gnu.org>; Sat, 08 Jan 2022 11:43:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jGOw0ZC0utE7DaUqQzioLA2kfXK1FfCx1weZe1dhXKY=; b=e6e6n3teRVY/+MWDVLAlBotlSwrdG8nH5D42Fy7plFhuQcieuJMcp9qFRsn2SYZjCV dMQ3/3C4bkDI1qalxfZmmCoVDRe6zj/YQi/ztGJQR5YdPVYUa0HvTP691E04Ws4nfxXf Hub55x+vW88xi+r8mUXuV8y0kidUQuWAb+/8GKPEvg1i4LrmaaWWc0oWoDP4yZCUlMjs KgbfSh1PmhRID3TW0/DgqI7reC7RFSBpHTvWanUXYqeOsboUcAu9ezfd4qcjhs5q60Eg KRfw4AhrxeLMzHMiZCrNzobqNy3rFLjoc5NHFL557/fumCNf7HlPctpBZQ2Rj2+JNwLv LvMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jGOw0ZC0utE7DaUqQzioLA2kfXK1FfCx1weZe1dhXKY=; b=7jmIayz2URNZMEfMDEYLyw9TOD0ieHZmGW9UB3tyoSPHyQtk695xpe3Vg7WQo5xEiY XIoV24GbE5o5RLWudGj+W3GNxYHSs0eOEwtdkRVB4Ir6j3rFb6lfZYXcUtlEmdSo9McH S91pByPqiCc4DLVM8dzZgff1X/BPPb9vkyNGL7YzsV6yl2aKZt2xGvqdQuBugOAr0QZA PYhIIEkzvI8XFtT4N9CSFNtDiGr4SDGofkL68FBpU/w01PYrbc1JXjHPZpwxhMKz52Ay tzrzoNgEix9pvWZ96MCj0P4RKrr6oruHC4W+KsVr9OcAT4WNxwTV1Sr2ruDWWXknlWkJ gPUA== X-Gm-Message-State: AOAM5335KsLsq0f5Y7mvWorCY/mqj0kGPP+UVeiS3U8DlSqH0F6jQ151 JAbLwHZVm7GBwPUB1OPxBL9bj0ys9IXycA== X-Google-Smtp-Source: ABdhPJwUaBcRf6EQLO952zxI6RoAc9y7GsFEyprpvPvTM6YuNw5sZKUov6ctx1B0qt1kMFSkqe+G+A== X-Received: by 2002:a05:600c:3b28:: with SMTP id m40mr6171388wms.192.1641670978777; Sat, 08 Jan 2022 11:42:58 -0800 (PST) Received: from mbp.lan ([185.39.42.151]) by smtp.gmail.com with ESMTPSA id m10sm2268367wms.25.2022.01.08.11.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jan 2022 11:42:58 -0800 (PST) From: Jorge Acereda Date: Sat, 8 Jan 2022 20:42:23 +0100 Message-Id: <2352d01612e4ba02e0021fd8d4bca4215c149b45.1641670916.git.jacereda@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=yes Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/graphics.scm (gpu-switch): New variable. --- gnu/packages/hardware.scm | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm index 28647477fe..8ec82f1297 100644 --- a/gnu/packages/hardware.scm +++ b/gnu/packages/hardware.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2021 Raghav Gururajan ;;; Copyright © 2021 Vinicius Monego ;;; Copyright © 2021 John Kehayias +;;; Copyright © 2022 Jorge Acereda ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,6 +30,7 @@ (define-module (gnu packages hardware) #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages autotools) + #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages check) @@ -64,7 +66,9 @@ (define-module (gnu packages hardware) #:use-module (guix build-system gnu) #:use-module (guix build-system meson) #:use-module (guix build-system python) + #:use-module (guix build-system trivial) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix svn-download) #:use-module ((guix licenses) #:prefix license:) @@ -844,3 +848,49 @@ (define-public tpm2-tss libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm and libtss2-tcti-mssim.") (license license:bsd-2))) + +(define-public gpu-switch + ;; No tagged commit. No "Version" keyword either. + (let ((commit "a365f56d435c8ef84c4dd2ab935ede4992359e31") + (revision "1")) + (package + (name "gpu-switch") + (version (git-version "0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/0xbb/gpu-switch") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1jnh43nijkqd83h7piq7225ixziggyzaalabgissyxdyz6szcn0r")))) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (install-file #$(file-append source "/gpu-switch") + (string-append #$output "/bin")) + (substitute* (string-append #$output "/bin/gpu-switch") + (("basename") #$(file-append coreutils-minimal "/bin/basename")) + (("cat ") #$(file-append coreutils-minimal "/bin/cat ")) + (("chattr") #$(file-append e2fsprogs "/bin/chattr")) + (("/usr/bin/env bash") #$(file-append bash-minimal "/bin/bash")) + (("grep") #$(file-append grep "/bin/grep")) + (("! mount") + (string-append "! " #$(file-append util-linux "/bin/mount")))) + (install-file + #$(file-append source "/README.md") + (string-append #$output "/share/doc/gpu-switch-" #$version))))) + (home-page "https://github.com/0xbb/gpu-switch") + (synopsis "GPU switcher for dual-GPU MacBook Pro models") + (description + "Switch between the integrated and dedicated GPU of dual-GPU MacBook Pro +models for the next reboot. + +It aims to remove the need of booting into OS X and running gfxCardStatus +v2.2.1 to switch to the integrated card.") + (license license:expat)))) -- 2.34.0 From unknown Sun Aug 10 07:38:18 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#53059] [PATCH v4] gnu: Add gpu-switch. References: <79655b434893691c6647f28087652f162aad80de.1641496236.git.jacereda@gmail.com> In-Reply-To: <79655b434893691c6647f28087652f162aad80de.1641496236.git.jacereda@gmail.com> Resent-From: Jorge Acereda Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 08 Jan 2022 19:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53059 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53059@debbugs.gnu.org Cc: Jorge Acereda Received: via spool by 53059-submit@debbugs.gnu.org id=B53059.164167164015206 (code B ref 53059); Sat, 08 Jan 2022 19:54:02 +0000 Received: (at 53059) by debbugs.gnu.org; 8 Jan 2022 19:54:00 +0000 Received: from localhost ([127.0.0.1]:48755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6Hmq-0003xC-Dp for submit@debbugs.gnu.org; Sat, 08 Jan 2022 14:54:00 -0500 Received: from mail-wr1-f53.google.com ([209.85.221.53]:42594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6Hmm-0003wt-MX for 53059@debbugs.gnu.org; Sat, 08 Jan 2022 14:53:59 -0500 Received: by mail-wr1-f53.google.com with SMTP id k30so688619wrd.9 for <53059@debbugs.gnu.org>; Sat, 08 Jan 2022 11:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/i2JarDuxaYe9jiXCGGs0zNyvMIiUMHed8C+1arbvz4=; b=YgpD6QsCtqbyUHlNbHS9/K564rWMBWYsycISPmtsYfC091Br2eNa09QLxDfhRvs+ny dOo+0fw82LOWCdM5ukOWW63Kyub+cUGGHTmchjCIzdzZZ+BedbrYwWe5dPzgUcVEQ7dY a/OnWi+UhoSKmyymrGlZlnsT3SdAhJ9pNXPC9BIEdtsyMzQa9daE2BYQUKHoF1jqdhXu Pe1sAnkKRIB10is6jDKe/p9qYE9CIu1XIM5dWj3pAdQQ6eYlJuh4AszCvLM6J3TZFk8h a758I56uBaoodQQYHhDv966XRtnLLrytd+2DEFOJtUYPM2Q9caZvSJrP5hEvh4zcJJ6F zaZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/i2JarDuxaYe9jiXCGGs0zNyvMIiUMHed8C+1arbvz4=; b=3KoPN4OBD6zLRsu+MCyGwOdEhAjPuppg99JK+bUkXfeBgqBlYqeJFvUgBKTxhbNTRz p4sbK/kSoidYumNVUsRw9BO072IGIpBgQRn7N4Bg6DQfCct9vkQE1sTb0laMnad2inxc 0WSDIwp2AijbdYmVA2JVbtygNG0Gk1GJPGMv1AhduQNtTYtByvZTw04moVWBzuFjiA2R k/w9mhATcTLt54p49xA/YMBgCjxu8Vd3V/d6aoVx+/FWzmsJOSGwpcI0fDwylvebMOYM B0b7Ek70hRyBeJgL+W12W5SfErTu3pSBZU1uftSmUX8lTLvuTLVmYadenzAqecziQiym 1vyQ== X-Gm-Message-State: AOAM530U0evPxTlFa7IX1/ZzC83RsSRzA37mqPGkUhe/ca2N6TSaCfLE Qtq7W6ddYbiyDKVqRKJJQADzZ3tOvnchmg== X-Google-Smtp-Source: ABdhPJwleoRNxQtX2MBXJq/Tt5aVpSh+4sxiUwCJHiFHqf0sOeMm394k3IBTvKpeAqL/pP4h0vuXUg== X-Received: by 2002:a05:6000:15cd:: with SMTP id y13mr59802033wry.28.1641671630866; Sat, 08 Jan 2022 11:53:50 -0800 (PST) Received: from mbp.lan ([185.39.42.151]) by smtp.gmail.com with ESMTPSA id n41sm2526707wms.32.2022.01.08.11.53.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jan 2022 11:53:50 -0800 (PST) From: Jorge Acereda Date: Sat, 8 Jan 2022 20:53:04 +0100 Message-Id: <4cd31369f81c4d3ced341bbe9d0e3aaba95cdf47.1641671488.git.jacereda@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=yes Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Forgot to specify supported-systems. * gnu/packages/graphics.scm (gpu-switch): New variable. --- gnu/packages/hardware.scm | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm index 28647477fe..a8ec6567cd 100644 --- a/gnu/packages/hardware.scm +++ b/gnu/packages/hardware.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2021 Raghav Gururajan ;;; Copyright © 2021 Vinicius Monego ;;; Copyright © 2021 John Kehayias +;;; Copyright © 2022 Jorge Acereda ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,6 +30,7 @@ (define-module (gnu packages hardware) #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages autotools) + #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages check) @@ -64,7 +66,9 @@ (define-module (gnu packages hardware) #:use-module (guix build-system gnu) #:use-module (guix build-system meson) #:use-module (guix build-system python) + #:use-module (guix build-system trivial) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix svn-download) #:use-module ((guix licenses) #:prefix license:) @@ -844,3 +848,50 @@ (define-public tpm2-tss libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm and libtss2-tcti-mssim.") (license license:bsd-2))) + +(define-public gpu-switch + ;; No tagged commit. No "Version" keyword either. + (let ((commit "a365f56d435c8ef84c4dd2ab935ede4992359e31") + (revision "1")) + (package + (name "gpu-switch") + (version (git-version "0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/0xbb/gpu-switch") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1jnh43nijkqd83h7piq7225ixziggyzaalabgissyxdyz6szcn0r")))) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (install-file #$(file-append source "/gpu-switch") + (string-append #$output "/bin")) + (substitute* (string-append #$output "/bin/gpu-switch") + (("basename") #$(file-append coreutils-minimal "/bin/basename")) + (("cat ") #$(file-append coreutils-minimal "/bin/cat ")) + (("chattr") #$(file-append e2fsprogs "/bin/chattr")) + (("/usr/bin/env bash") #$(file-append bash-minimal "/bin/bash")) + (("grep") #$(file-append grep "/bin/grep")) + (("! mount") + (string-append "! " #$(file-append util-linux "/bin/mount")))) + (install-file + #$(file-append source "/README.md") + (string-append #$output "/share/doc/gpu-switch-" #$version))))) + (home-page "https://github.com/0xbb/gpu-switch") + (supported-systems '("x86_64-linux")) + (synopsis "GPU switcher for dual-GPU MacBook Pro models") + (description + "Switch between the integrated and dedicated GPU of dual-GPU MacBook Pro +models for the next reboot. + +It aims to remove the need of booting into OS X and running gfxCardStatus +v2.2.1 to switch to the integrated card.") + (license license:expat)))) -- 2.34.0