From patchwork Fri Jul 2 13:58:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Prikler X-Patchwork-Id: 31041 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 AB91B27BC81; Fri, 2 Jul 2021 14:59:34 +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,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 B1A5E27BC78 for ; Fri, 2 Jul 2021 14:59:33 +0100 (BST) Received: from localhost ([::1]:56622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzJhc-0004qU-Qt for patchwork@mira.cbaines.net; Fri, 02 Jul 2021 09:59:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzJh9-0004lI-DO for guix-patches@gnu.org; Fri, 02 Jul 2021 09:59:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzJh9-0002KY-67 for guix-patches@gnu.org; Fri, 02 Jul 2021 09:59:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lzJh8-0000rc-S5 for guix-patches@gnu.org; Fri, 02 Jul 2021 09:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49329] [PATCH 4/4] gnu: renpy: Correct inputs. Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Jul 2021 13:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49329 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49329@debbugs.gnu.org Received: via spool by 49329-submit@debbugs.gnu.org id=B49329.16252343223271 (code B ref 49329); Fri, 02 Jul 2021 13:59:02 +0000 Received: (at 49329) by debbugs.gnu.org; 2 Jul 2021 13:58:42 +0000 Received: from localhost ([127.0.0.1]:36838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzJgo-0000qg-1f for submit@debbugs.gnu.org; Fri, 02 Jul 2021 09:58:42 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:40846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzJgk-0000q9-K9 for 49329@debbugs.gnu.org; Fri, 02 Jul 2021 09:58:39 -0400 Received: from localhost.localdomain (80-121-26-175.adsl.highway.telekom.at [80.121.26.175]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4GGcB443Pxz1LZWn for <49329@debbugs.gnu.org>; Fri, 2 Jul 2021 15:58:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4GGcB443Pxz1LZWn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1625234316; bh=vrUaaG1fXhNhDOq9hmM/m+xmUmqF0kxH5AbZL969yfY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TNAU48daRB0QeOxOREqFTp51/SzGz0ib8MmobHfWBGjHbgl+Y2tYwtJslYHfOluWX Dk1Zae5pFkpsjD0IcBF9wDbN0weDl4jJ2QcwyoHG/VFagtjBnCwemaJl9+zAiBYLyk JEa0PQ9A7ejmnxOSE0ExC9rdrzhdJXc5T1ogtp2s= From: Leo Prikler Date: Fri, 2 Jul 2021 15:58:18 +0200 Message-Id: <20210702135818.16084-4-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210702135818.16084-1-leo.prikler@student.tugraz.at> References: <20210702135818.16084-1-leo.prikler@student.tugraz.at> MIME-Version: 1.0 X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 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/game-development.scm (renpy)[#:modules]: Add SRFI-1. [#:imported-modules]: Likewise. [#:phases]: Search for ‘python2’ and ‘xdg-open’ in inputs. : Search for ‘xorg-server’ in native-inputs. : Search for ‘python2’ in inputs. : Search for python dependencies in inputs. [inputs]: Add python2, drop python2-pygame (already propagated by python2-renpy). Move xorg-server from here… [native-inputs]: … to here. [propagated-inputs]: Empty. --- gnu/packages/game-development.scm | 54 +++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index 7c5d45c412..5d5fa5cf8b 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -1266,15 +1266,22 @@ are only used to bootstrap it.") (arguments `(#:tests? #f ; see python2-renpy #:python ,python-2 + #:modules ((srfi srfi-1) + (guix build python-build-system) + (guix build utils)) + #:imported-modules ((srfi srfi-1) ,@%python-build-system-modules) #:phases (modify-phases %standard-phases (add-after 'unpack 'fix-commands - (lambda* (#:key outputs #:allow-other-keys) + (lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "launcher/game/choose_directory.rpy" - (("/usr/bin/python") (which "python2"))) + (("/usr/bin/python") + (string-append (assoc-ref inputs "python2") + "/bin/python2"))) (substitute* "launcher/game/front_page.rpy" (("xdg-open") - (which "xdg-open"))) + (string-append (assoc-ref inputs "xdg-utils") + "/bin/xdg-open"))) (substitute* "launcher/game/project.rpy" (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]") (string-append "cmd = [ \"" (assoc-ref outputs "out") @@ -1291,8 +1298,9 @@ are only used to bootstrap it.") ((", \"game\",") ",")) #t)) (add-before 'build 'start-xserver - (lambda* (#:key inputs #:allow-other-keys) - (let ((xorg-server (assoc-ref inputs "xorg-server"))) + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (let ((xorg-server (assoc-ref (or native-inputs inputs) + "xorg-server"))) (setenv "HOME" (getcwd)) (system (format #f "~a/bin/Xvfb :1 &" xorg-server)) (setenv "DISPLAY" ":1") @@ -1344,7 +1352,8 @@ are only used to bootstrap it.") (call-with-output-file bin/renpy (lambda (port) - (format port "#!~a~%" (which "python2")) + (format port "#!~a/bin/python2~%" + (assoc-ref inputs "python2")) (format port " from __future__ import print_function @@ -1433,15 +1442,32 @@ if __name__ == \"__main__\": #t)) (replace 'wrap (lambda* (#:key inputs outputs #:allow-other-keys) - (wrap-program (string-append (assoc-ref outputs "out") - "/bin/renpy") - `("PYTHONPATH" = (,(getenv "PYTHONPATH")))) - #t))))) + (let ((out (assoc-ref outputs "out")) + (site (string-append "/lib/python" + (python-version + (assoc-ref inputs "python")) + "/site-packages"))) + (wrap-program (string-append out "/bin/renpy") + `("PYTHONPATH" = + (,@(delete-duplicates + (map + (lambda (store-path) + (string-append store-path site)) + (cons (assoc-ref outputs "out") + (map cdr + (filter + (lambda (input) + (string-prefix? "python2" (car input))) + inputs)))))))) + #t)))))) (inputs - `(("python2-tkinter" ,python-2 "tk") - ("python2-pygame" ,python2-pygame-sdl2) - ("python2-renpy" ,python2-renpy) - ("xorg-server" ,xorg-server))) + `(("python2-renpy" ,python2-renpy) + ("python2-tkinter" ,python-2 "tk") + ("python2" ,python-2) ; for ‘fix-commands’ and ‘wrap’ + ("xdg-utils" ,xdg-utils))) + (propagated-inputs '()) + (native-inputs + `(("xorg-server" ,xorg-server-for-tests))) (outputs (list "out" "tutorial" "the-question")) (home-page "https://www.renpy.org/")