From patchwork Fri Aug 26 14:37:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Kortkamp X-Patchwork-Id: 41979 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 6200227BBEA; Fri, 26 Aug 2022 16:09:38 +0100 (BST) 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, 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 CC3E627BBE9 for ; Fri, 26 Aug 2022 16:09:37 +0100 (BST) Received: from localhost ([::1]:34028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRaxk-0002ib-Pq for patchwork@mira.cbaines.net; Fri, 26 Aug 2022 11:09:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaTD-0000Bb-HG for guix-patches@gnu.org; Fri, 26 Aug 2022 10:38:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oRaTC-00081y-8D for guix-patches@gnu.org; Fri, 26 Aug 2022 10:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oRaTB-0005YT-UR for guix-patches@gnu.org; Fri, 26 Aug 2022 10:38:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57429] [PATCH 1/3] gnu: piper: Fix runtime. Resent-From: Tobias Kortkamp Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Aug 2022 14:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57429 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57429@debbugs.gnu.org Cc: Tobias Kortkamp Received: via spool by 57429-submit@debbugs.gnu.org id=B57429.166152465421288 (code B ref 57429); Fri, 26 Aug 2022 14:38:01 +0000 Received: (at 57429) by debbugs.gnu.org; 26 Aug 2022 14:37:34 +0000 Received: from localhost ([127.0.0.1]:54276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRaSj-0005XI-VV for submit@debbugs.gnu.org; Fri, 26 Aug 2022 10:37:34 -0400 Received: from mail-ed1-f47.google.com ([209.85.208.47]:37687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRaSi-0005X5-5P for 57429@debbugs.gnu.org; Fri, 26 Aug 2022 10:37:32 -0400 Received: by mail-ed1-f47.google.com with SMTP id b16so2364251edd.4 for <57429@debbugs.gnu.org>; Fri, 26 Aug 2022 07:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=yGijjfXXUIORKVXbTD3CsVwaf1+4Sm8Texd9AX6n9DI=; b=A6SlKIOZcLBfup+p0NkANL/0nVbrjtj8D6SMmB+cEw158uDNgw6o3+T5VK5xznkjqM GwCEoZsnGPGnd3nqYGZTBWdGoUDu63epLn6x+vO2YcsC+kAK0KWEX/EHpWMlgeTYUSot ubDHUgXEkeWQKuB61jYPG1vkqGiKYa0tfc3G7cF4r+gdr5K4Vof1W5Gay9q8Q9am20EE yXiD6ziqYj1ZoJCvVCW5X4psKZnpJLtBnqYMzHNgOoeg1DVNIuxOnIaVrxe3oRrP7qt7 J/hSuoD9Uc0B5sTS2szopE6Eu/CRSRSB3OKF4VmaEuDd5gBSeaY1IK03JHvFIjBlwy7P CJJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=yGijjfXXUIORKVXbTD3CsVwaf1+4Sm8Texd9AX6n9DI=; b=MNbbdpfnqR+J9yYPOfzXQA2XwPM0FfT70g9e4c89IdA4ygZJqB3RoxYMqwuXxd0id9 AC3z13VDSdDi4DXKMBzfxjuLpW0tT0egJFAv47b4Yah8WtjDLicozsFlvySG7CXipIKP tk+PptRdZaxYQOxnAED5pL7TgvpiyiNPv14y/zFxOHSURef3BcwDNq9QFG1oP4Oelezj aGFTKWu2akL26DEJpYoptztpjfdzT03oTR+IMphcPUjWRRCPdLl1LuJWTZ7ZelbauQAA jr58Z8wxAqSdAs0yUTscY3a+WejGcHvtFa3ejy7X+wpWkRPT868sNF/Vsw8oad1rtw2z 5aLw== X-Gm-Message-State: ACgBeo1BeA+oqi3Sr5zJ8PmTlrwIydzQIFvR1MMiGpXJU5PQefngKoAq jTpEwviPKbntCENehHGdbQ85H+POi5o= X-Google-Smtp-Source: AA6agR5wFPvezgd40T/1d09JVmpedeW4wKpDGS46ZgalbGwKxbEnAuGjCD6RuMSMYzCHxc//MukN3A== X-Received: by 2002:a05:6402:35d2:b0:446:b50d:ac56 with SMTP id z18-20020a05640235d200b00446b50dac56mr6778609edc.316.1661524646074; Fri, 26 Aug 2022 07:37:26 -0700 (PDT) Received: from anubis.kortkamp.xyz (p200300ff7f02ab00bb3a869e030b0f74.dip0.t-ipconnect.de. [2003:ff:7f02:ab00:bb3a:869e:30b:f74]) by smtp.gmail.com with ESMTPSA id h8-20020a50ed88000000b004463b99bc09sm1356875edr.88.2022.08.26.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Aug 2022 07:37:25 -0700 (PDT) From: Tobias Kortkamp Date: Fri, 26 Aug 2022 16:37:12 +0200 Message-Id: <15561be9725d1c50253afb227acf25e285aa3dfe.1661501683.git.tobias.kortkamp@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 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 The wrapper script does not add piper's own Python files to GUIX_PYTHONPATH. Copy the approach from gtg to solve this. Traceback (most recent call last): File "/gnu/store/9fq062kva6ffidilg0qn8liqn6a8yf1w-piper-0.6/bin/.piper-real", line 36, in from piper.application import Application ModuleNotFoundError: No module named 'piper' * gnu/packages/gnome.scm (piper): Fix runtime. --- gnu/packages/gnome.scm | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index ae46e55c51..fe822eb035 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -12122,26 +12122,25 @@ (define-public piper python-pycairo python-pygobject)) (arguments - `(#:imported-modules ((guix build python-build-system) - ,@%meson-build-system-modules) - #:modules (((guix build python-build-system) #:prefix python:) - (guix build meson-build-system) - (guix build utils)) - #:tests? #f ;; The flake8 test fails trying to validate piper.in as code. - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'dont-update-gtk-icon-cache - (lambda _ - (substitute* "meson.build" - (("meson.add_install_script('meson_install.sh')") "")))) - ;; TODO: Switch to wrap-script when it is fixed. - (add-after 'install 'wrap-python - (assoc-ref python:%standard-phases 'wrap)) - (add-after 'wrap-python 'wrap - (lambda* (#:key outputs #:allow-other-keys) - (wrap-program - (string-append (assoc-ref outputs "out" )"/bin/piper") - `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH"))))))))) + (list #:glib-or-gtk? #t + #:tests? #f ;; The flake8 test fails trying to validate piper.in as code. + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'dont-update-gtk-icon-cache + (lambda _ + (substitute* "meson.build" + (("meson.add_install_script('meson_install.sh')") "")))) + (add-after 'glib-or-gtk-wrap 'python-and-gi-wrap + (lambda _ + (let ((pylib (string-append #$output + "/lib/python" + #$(version-major+minor + (package-version python)) + "/site-packages"))) + (wrap-program + (string-append #$output "/bin/piper") + `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH") ,pylib)) + `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))))))) (home-page "https://github.com/libratbag/piper/") (synopsis "Configure bindings and LEDs on gaming mice") (description "Piper is a GTK+ application for configuring gaming mice with