From patchwork Thu Jan 6 19:11:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jorge Acereda X-Patchwork-Id: 36049 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 CA82C27BBEA; Thu, 6 Jan 2022 19:12:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 43B1C27BBE9 for ; Thu, 6 Jan 2022 19:12:09 +0000 (GMT) Received: from localhost ([::1]:50468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5YBE-00019h-FO for patchwork@mira.cbaines.net; Thu, 06 Jan 2022 14:12:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5YB8-00019X-Ez for guix-patches@gnu.org; Thu, 06 Jan 2022 14:12:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5YB8-0007p9-3o for guix-patches@gnu.org; Thu, 06 Jan 2022 14:12:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n5YB7-0007cp-UQ for guix-patches@gnu.org; Thu, 06 Jan 2022 14:12:01 -0500 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 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-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" X-getmail-retrieved-from-mailbox: Patches * 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))) +