From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 ReN4LmV+rGLgWAEAbAwnHQ (envelope-from ) for ; Fri, 17 Jun 2022 15:15:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WFogLWV+rGJ6XwEAauVa8A (envelope-from ) for ; Fri, 17 Jun 2022 15:15:17 +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 5303713BC8 for ; Fri, 17 Jun 2022 15:15:17 +0200 (CEST) Received: from localhost ([::1]:43436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2Boh-0005RC-Ep for larch@yhetil.org; Fri, 17 Jun 2022 09:15:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2BoX-0005Qw-4Z for guix-patches@gnu.org; Fri, 17 Jun 2022 09:15:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2BoW-0004Oh-I7 for guix-patches@gnu.org; Fri, 17 Jun 2022 09:15:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o2BoU-0002Xc-BN for guix-patches@gnu.org; Fri, 17 Jun 2022 09:15:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55424] [PATCH 1/4] gnu: Add back the distinction between python-renpy and renpy. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Jun 2022 13:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55424 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: 55424@debbugs.gnu.org Received: via spool by 55424-submit@debbugs.gnu.org id=B55424.16554716749711 (code B ref 55424); Fri, 17 Jun 2022 13:15:02 +0000 Received: (at 55424) by debbugs.gnu.org; 17 Jun 2022 13:14:34 +0000 Received: from localhost ([127.0.0.1]:44327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2Bno-0002WG-Sz for submit@debbugs.gnu.org; Fri, 17 Jun 2022 09:14:34 -0400 Received: from mail-qk1-f170.google.com ([209.85.222.170]:35524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2Bnl-0002W2-7D for 55424@debbugs.gnu.org; Fri, 17 Jun 2022 09:14:19 -0400 Received: by mail-qk1-f170.google.com with SMTP id b142so3108713qkg.2 for <55424@debbugs.gnu.org>; Fri, 17 Jun 2022 06:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=zBb3wqf5MHo+7lvI9M5eqLDhvz5U4ppsTfZpG8DxgX0=; b=Sspp/+0Foy38VHr6yAaPU9uwvfMzMqyzgrx6EL7Nu5T4xH0ryu7zVvjDTGF0IGkYIi Y+/4FO+INPPHT1N2yAgWxyfDnTFbgJlEesnHSgfCrgT4KgzIfPiaznc/6b2VAQfpGn/5 d+qic7E+/cSoulJLtOyOUc6NCHW68ajrrbS+V73eRlGu6ZI8Ka1yHD4iSAMIrTIVOXup hbr4jR8I32pi/86zLK9e4ogd8hxC4PF6tbodOfEIib16iwt3D+1EJcjhfwxVx8A4oLGs TOzqty8c0kc/qvHFA48iRF2bMZ++4Vi1mb7aa/mufz+ZWo1pG+Gnal9pYYwsxGgbuYZD ETiA== 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:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=zBb3wqf5MHo+7lvI9M5eqLDhvz5U4ppsTfZpG8DxgX0=; b=5WAWaU/JMUaqYpCGSH2J36EVFDMkAY/9nssAVhWSOA9C4c4CgCRoaY/PfQSYb8pyvN YF+AW+ePv1WYo4H8DQg12yaO+beg406SKSzbt6LcCf5TjfTFj0KfyQ/9PQra0m4GkFwz OwAc0uow5V//3I2VCdbaMxxlRq9Cxzgea2z9LPuCaKvwbxM/Z1CdXJPTl79Zd1eJ6dzP ufkOhSScaU+kXJKhrMp+kkZLW6du4+qrHUSRVCq7xYZ5tAU7rWHdvj31JQexmxGRmB+n /iaBpCZBEtPa6tCXQ+8FXai0c7rp1ZAyr1gk+K332TCxu/4AID46Lm0TsCtiMy6svaog hT2A== X-Gm-Message-State: AJIora8GYHNZ7yVVRr8zN7wbInfawdWAZT+erjhR7vaTFQOMFyDxvI2y OWZP3H5q1gbFvmHxtOBKn4DT4ZzjxnlzRQ== X-Google-Smtp-Source: AGRyM1vueO8umf9OebtrWPQiStvvQwRGT/fMxe4j6kXq4f4mq7S5x5Nd46roQuDHRv2R8C+ziZ/e7w== X-Received: by 2002:a05:620a:8003:b0:6a7:1d8e:65b6 with SMTP id ee3-20020a05620a800300b006a71d8e65b6mr7123455qkb.662.1655471650671; Fri, 17 Jun 2022 06:14:10 -0700 (PDT) Received: from hurd (dsl-205-233-124-10.b2b2c.ca. [205.233.124.10]) by smtp.gmail.com with ESMTPSA id i21-20020a05620a405500b0069fe1dfbeffsm4615559qko.92.2022.06.17.06.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 06:14:10 -0700 (PDT) From: Maxim Cournoyer References: <710ed912d21f90d7349a75a31e6985ab79fda575.camel@gmail.com> Date: Fri, 17 Jun 2022 09:14:09 -0400 In-Reply-To: <710ed912d21f90d7349a75a31e6985ab79fda575.camel@gmail.com> (Liliana Marie Prikler's message of "Fri, 17 Jun 2022 08:49:05 +0200") Message-ID: <87wndfa0v2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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" 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=1655471717; h=from:from:sender:sender: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=zBb3wqf5MHo+7lvI9M5eqLDhvz5U4ppsTfZpG8DxgX0=; b=oDTj0js7/WfsgWpTuWbz9CbyEp6FWHZ6R4o6q3B+MN+wttWP6SrA3bYtBkspIrjqaorazk d+GoLsP/xvZDYuA43Kg7kfA8lgx5vQi/3ZtsxMiTv3HjF7KQRicF693pbcmRgK2At5276Z qEzxKHBHn26rejtBf8TTRVJy11VQJVMg2/tY5SRjZzQoOj9MatP4ZxsLh2cmalePF1IwSL IOhJoRliZeS5lcCBzWqAT8jdEllyOWEO4xuWaRo22fVKbbpC2D+ssjeePazCYY+fjLkmTe ZnUvHes+6ZyQuuU1InjQ4/RdNiqpFtVXnZjKKZM6+zgNYJG/9AObesBx0V9x5g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655471717; a=rsa-sha256; cv=none; b=qckXFLp520Mi4JXi527Yd+5EOvqqLmxcMyRaANyxtYa0lHn8IDWd26ID1+YkJlBLVLdNoE pSDAx6/uqKGXpQkpoxih285I9zeqf9Sqq05q9WCUt1qlhl0dk+WWlRRXmeVum+RdtobDQ/ htgB0GiEAWA4B3tSEwJlirYLN1W7CleiEgo5DOiLHFjzk4ChaZwWnBhIbKqGZEuIOVBJGY Takky9OLIha38eIappB9SoFfgMuaVeJE8IvjyzQvSD7bVDlqYtq6Z1Vvet/2E9FpwySXzp 0TAQdSMIgzwvEHVsmxVdivYV5rTImJpKZqq2lxhl3wWChB0dLvvZI88R6ZW2rw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="Sspp/+0F"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 4.91 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="Sspp/+0F"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 5303713BC8 X-Spam-Score: 4.91 X-Migadu-Scanner: scn0.migadu.com X-TUID: ib3oT6HFR8WO Hello Liliana, Thanks for doing this! Liliana Marie Prikler writes: > This partially reverts commit 9f1bd63fb5b6916f07d454ffde27cd3a66c95bb5. > Note, that with this patch renpy fails to build due to incompatibilities = with > Python 3. > > * gnu/packages/game-development.scm (renpy): Split into =E2=80=98python-r= enpy=E2=80=99 for the > python modules and =E2=80=98renpy=E2=80=99 for the games and binaries. > --- > gnu/packages/game-development.scm | 171 +++++++++++++++++++++++++++++- > 1 file changed, 169 insertions(+), 2 deletions(-) > > diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-develo= pment.scm > index 4c1b97f041..44f8ca57fc 100644 > --- a/gnu/packages/game-development.scm > +++ b/gnu/packages/game-development.scm > @@ -1257,9 +1257,9 @@ (define-public python-pygame-sdl2 > developed mainly for Ren'py.") > (license (list license:lgpl2.1 license:zlib))))) >=20=20 > -(define-public renpy > +(define-public python-renpy > (package > - (name "renpy") > + (name "python-renpy") > (version "7.4.11") > (source > (origin > @@ -1342,6 +1342,173 @@ (define-public renpy > are only used to bootstrap it.") > (license license:expat))) >=20=20 > +(define-public renpy > + (package > + (inherit python-renpy) > + (name "renpy") > + (build-system python-build-system) > + (arguments > + `(#:tests? #f ; see python2-renpy The comment should mention 'python-renpy' instead, right? Also, the arguments could use gexps... > + #: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 inputs outputs #:allow-other-keys) > + (substitute* "launcher/game/choose_directory.rpy" > + (("/usr/bin/python") > + (search-input-file inputs "/bin/python3"))) > + (substitute* "launcher/game/front_page.rpy" > + (("xdg-open") > + (search-input-file inputs "/bin/xdg-open"))) > + (substitute* "launcher/game/project.rpy" > + (("cmd =3D \\[ executable, \"-EO\", sys.argv\\[0\\] \\]") > + (string-append "cmd =3D [ \"" (assoc-ref outputs "out") > + "/bin/renpy\" ]")) > + ;; Projects are still created in the usual style, so we n= eed > + ;; to adjust the path. > + (("cmd.append\\(self.path\\)") > + "cmd.append(self.path + \"/game\")")) > + #t)) And the trailing #t can be removed. > + (add-after 'unpack 'drop-game-from-paths > + (lambda _ > + (substitute* (list "launcher/game/gui7.rpy" > + "launcher/game/gui7/images.py") > + ((", \"game\",") ",")) > + #t)) > + (add-before 'build 'start-xserver > + (lambda* (#:key inputs native-inputs #:allow-other-keys) > + (let ((Xvfb (search-input-file (or native-inputs inputs) > + "/bin/Xvfb"))) > + (setenv "HOME" (getcwd)) > + (system (format #f "~a :1 &" Xvfb)) > + (setenv "DISPLAY" ":1") > + #t))) > + (replace 'build > + (lambda _ > + (invoke "python" "renpy.py" "launcher" "quit") > + (invoke "python" "renpy.py" "the_question" "quit") > + (invoke "python" "renpy.py" "tutorial" "quit") > + #t)) > + (replace 'install > + (lambda* (#:key inputs outputs #:allow-other-keys) > + ;; Here we install our custom renpy program. > + ;; After finishing this step, "out" will have the following: > + ;; |-- bin/renpy > + ;; `-- share/renpy ; i.e. path_to_renpy_base() > + ;; |-- common > + ;; `-- gui > + ;; > + ;; Note that common shares the source files that would be i= nstalled > + ;; by python2-renpy (which are instead deleted from that pa= ckage), > + ;; but also contains their byte-compiled versions. > + ;; On other systems, renpy_base would point to site-package= s or > + ;; even somewhere in /opt. > + ;; The former approach is not as straightforward as it seems > + ;; -- it causes renpy to load files twice for some weird re= ason -- > + ;; and the latter is impossible on Guix. Hence the detour t= hrough > + ;; share/renpy and the custom renpy program. > + ;; > + ;; As a convention, other games should be installed as > + ;; subdirectories of share/renpy in their respective output= s as > + ;; well. This differs from the traditional layout, which is > + ;; roughly the following: > + ;; `-- Super Awesome Game > + ;; |-- game ; <- the folder we actually want > + ;; |-- lib ; compiled renpy module and dependenc= ies > + ;; |-- renpy ; yet another copy of Ren'py's code > + ;; | |-- common ; the common folder from above > + ;; | `-- ... ; Python code (source + compiled) > + ;; |-- Super Awesome Game.py > + ;; `-- Super Awesome Game.sh > + (let* ((out (assoc-ref outputs "out")) > + (bin/renpy (string-append out "/bin/renpy"))) > + (copy-recursively "renpy/common" > + (string-append out "/share/renpy/common= ")) > + (copy-recursively "gui" > + (string-append out "/share/renpy/gui")) > + > + (mkdir-p (string-append out "/bin")) > + (copy-file (assoc-ref inputs "renpy.in") bin/renpy) > + (substitute* bin/renpy > + (("@PYTHON@") (search-input-file inputs "bin/python3")) > + (("@RENPY_BASE@") (string-append out "/share/renpy"))) > + (chmod bin/renpy #o755)))) > + > + (add-after 'install 'install-games > + (lambda* (#:key outputs #:allow-other-keys) > + (define renpy (assoc-ref outputs "out")) > + ;; TODO: We should offer a renpy-build-system to make the > + ;; installation of Ren'py games easier. > + (define* (install-renpy-game #:key output game name (renpy = renpy) > + #:allow-other-keys) > + (let* ((name (or name (basename game))) > + (launcher (string-append output "/bin/renpy-" name= )) > + (share (string-append output "/share/renpy/" name)= )) > + (copy-recursively (string-append game "/game") share) > + (mkdir-p (string-append output "/bin")) > + (with-output-to-file launcher > + (lambda () > + (format #t > + "#!~a~%~a ~a \"$@\"" > + (which "bash") > + (string-append renpy "/bin/renpy") > + share))) > + (chmod launcher #o755))) > + > + (install-renpy-game #:output (assoc-ref outputs "out") > + #:game "launcher") > + > + (install-renpy-game #:output (assoc-ref outputs "the-questi= on") > + #:game "the_question" > + #:name "the-question") > + > + (install-renpy-game #:output (assoc-ref outputs "tutorial") > + #:game "tutorial") > + #t)) > + (replace 'wrap > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (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") > + `("GUIX_PYTHONPATH" =3D > + (,@(delete-duplicates > + (map > + (lambda (store-path) > + (string-append store-path site)) > + (cons (assoc-ref outputs "out") > + (map cdr > + (filter > + (lambda (input) > + (string-prefix? "python" (car inpu= t))) > + inputs)))))))) > + #t)))))) > + (inputs > + `(("renpy.in" ,(search-auxiliary-file "renpy/renpy.in")) > + ("python-renpy" ,python-renpy) > + ("python-tkinter" ,python "tk") > + ("python" ,python) ; for =E2=80=98fix-commands=E2=80=99 and =E2= =80=98wrap=E2=80=99 > + ("xdg-utils" ,xdg-utils))) > + (propagated-inputs '()) > + (native-inputs > + (list xorg-server-for-tests)) > + (outputs > + (list "out" "tutorial" "the-question")) Can we use new style inputs here? Otherwise it LGTM.