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 6ODoKv2arGKNQwAAbAwnHQ (envelope-from ) for ; Fri, 17 Jun 2022 17:17: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 gDylKv2arGKuCQAAauVa8A (envelope-from ) for ; Fri, 17 Jun 2022 17:17: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 0134217889 for ; Fri, 17 Jun 2022 17:17:17 +0200 (CEST) Received: from localhost ([::1]:33250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2Dim-0006E1-4f for larch@yhetil.org; Fri, 17 Jun 2022 11:17:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2Dia-000686-6o for guix-patches@gnu.org; Fri, 17 Jun 2022 11:17:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2DiZ-0003ZH-Uh for guix-patches@gnu.org; Fri, 17 Jun 2022 11:17:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o2DiZ-0002OF-RI for guix-patches@gnu.org; Fri, 17 Jun 2022 11:17:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55424] [PATCH v2 5/6] gnu: renpy: Use new style. References: <20220515044412.6697-1-maxim.cournoyer@gmail.com> In-Reply-To: <20220515044412.6697-1-maxim.cournoyer@gmail.com> Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Jun 2022 15:17:03 +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: Maxim Cournoyer Cc: 55424@debbugs.gnu.org Received: via spool by 55424-submit@debbugs.gnu.org id=B55424.16554790169136 (code B ref 55424); Fri, 17 Jun 2022 15:17:03 +0000 Received: (at 55424) by debbugs.gnu.org; 17 Jun 2022 15:16:56 +0000 Received: from localhost ([127.0.0.1]:46675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2DiR-0002NH-Vl for submit@debbugs.gnu.org; Fri, 17 Jun 2022 11:16:56 -0400 Received: from mail-ej1-f65.google.com ([209.85.218.65]:35730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2DiF-0002Lr-UA for 55424@debbugs.gnu.org; Fri, 17 Jun 2022 11:16:50 -0400 Received: by mail-ej1-f65.google.com with SMTP id me5so9406267ejb.2 for <55424@debbugs.gnu.org>; Fri, 17 Jun 2022 08:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:subject:to:cc:content-transfer-encoding:message-id :mime-version; bh=5YMVx6vdMZa1GbKtpvr291Y1wiL2m8SvvU+Td7hLm3k=; b=H76uWivST9C/RvWKwHBqeqP4HQ885ezb+qBwxmZXcZztO8R6gOp1UYIYkZqqXlWuVa Gw8e4iUQIYzi8VssK6i7X1WDE8MUeTwpY/BxxrCufeTFl0OmrrWLYr/4tfvQKeAjVD9s Dj5vfTiVo3iqblpqYISxxxzj8IltiY06gKC3+EE3KGm+m17pooc3R7GrY2D2tvPX3t// aP3dEhXbvTtAbGcmdiUIT3yczLRc121zrpQ3p6qYG2UNLnFlZLUJjIXtYNXMAjFP72qh SEEKK83rmYwaUI7r/irN9jX/DrYpW6Xqp2Qt6p/+wA2HvS7v5olXM7tc7qB+5K0AfFvi mt8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:to:cc :content-transfer-encoding:message-id:mime-version; bh=5YMVx6vdMZa1GbKtpvr291Y1wiL2m8SvvU+Td7hLm3k=; b=b9jwJ3UGo+iu5RdOmkvIgiZ1IJHfy98BWUG41TvVFvhZWNA9NmidXbRhUr/ZacIFNM KTVPvQ+/9grpwEe7am/ii1nPXflIHShK4/yclAt9+sZone7dXEpqNGCxxSiFhbF+GmOo YVV9grRT2g/jtkfGYj76cRyzezitBqw19NwaT2ZjuGZpx3cvCod9GVjx7l8RloQm87KL u1ESyiciT+lywCquzxTuZeVQELcKaAT6AXzNx4Hh1rqROWxZeBQVBPBdp0DOEI4OL/b/ deqRO/m0Hd8d9k1O7cWc+dq3EZSgYEY7QjYbthfPc8UZg9x8LvwbRZ7LhUlLBM9LakyO V8Pg== X-Gm-Message-State: AJIora/FLE2Q8dMV/vtIcZtcOzBQ+GS0AxSPviCu6Yf7KKVE5Q0mW74X SBpcUvjNrlVr5xNRJphNS70= X-Google-Smtp-Source: AGRyM1vzRxxkNiiuoR9Qz93yxPKPfvvA7ptImknjiCwNzzCk/kQlmFCxWJ5a0Ikxn/Hji8goA8RK5w== X-Received: by 2002:a17:907:6ea8:b0:711:3404:440d with SMTP id sh40-20020a1709076ea800b007113404440dmr9574275ejc.764.1655478998237; Fri, 17 Jun 2022 08:16:38 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id u20-20020aa7d554000000b0042a2d9af0f8sm3801083edr.79.2022.06.17.08.16.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 08:16:38 -0700 (PDT) From: Liliana Marie Prikler Date: Fri, 17 Jun 2022 16:01:32 +0200 Content-Transfer-Encoding: 8bit Message-ID: 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+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=1655479037; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=5YMVx6vdMZa1GbKtpvr291Y1wiL2m8SvvU+Td7hLm3k=; b=hxhdtM4hs6fiADqKrLDu32t3mCy9eZXksQ12IoinvMQujgb+X5aZ3LMSMkBdroXQ2K1ctT LjsR8f8R/6Zv1pJyewHxKhb3GrCx0rg569JWd2pX5dfCEOZWYOCBAsM8jtCry2z+fHKCrD zBvUSeKICidnwB69Gex7GmqXoPdA8bbEylp7i8EqP0wP1hMuFtMD/ch9HyUSRkjv+og2zy qBS4Y00JCCOn0JdlLHoEnj6MAUw92ZvP9zjXyfvZ5QKROaTRrp9dnJ+a+HvEn1/0cQxgn9 qH/Q7UVU3KqdO2VXeSRWLHF5Kh+5RYKgwRqxP2apPmiVOM6CPz8heMW0/RWSPg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655479037; a=rsa-sha256; cv=none; b=VAXPsdsZ5/xoUP7e0a2smfjRox7zsClsoIFxGQCqVH9giOTNPaG0+/nToLe4FrwpdZTflW lTLIykOmbviESAlsCflUk0zfKhqNcX/79CBL20l2gi1GU0ALd2S225PNdv7NkAOhwYetHL WKb/79Buv9ZgIEHQ3wTx8cNxhV1KGWtdhbSw7abEHweWZi2wfQbANhemaMxYfxBwABbStZ ukWTpU7zJYvPKV2+HrRyUkni55B3KmLSVLbysdGVI+vT8tiRdBlNSdUC2xLjmavkOEibtu WrZAb/xCS66EQola/WKDS7oaY7L2KAVicZ8NddUZW5rH0oPKNZPcEicyRazayA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=H76uWivS; 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: 8.01 X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=H76uWivS; 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: 0134217889 X-Spam-Score: 8.01 X-Migadu-Spam: Yes X-Migadu-Scanner: scn1.migadu.com X-TUID: O4Q7f9BDhmKG * gnu/packages/game-development.scm (renpy)[arguments]: Change to list of G-Expressions. [inputs]: Drop labels. [native-inputs, outputs]: Squash to single line. --- gnu/packages/game-development.scm | 293 +++++++++++++++--------------- 1 file changed, 146 insertions(+), 147 deletions(-) diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index 4377654f8f..04f2b061fc 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -48,6 +48,7 @@ (define-module (gnu packages game-development) #:use-module (ice-9 match) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) + #:use-module (guix gexp) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix svn-download) @@ -1352,156 +1353,154 @@ (define-public renpy (name "renpy") (build-system python-build-system) (arguments - `(#:tests? #f ; see python-renpy - #:modules ((srfi srfi-1) + (list + #:tests? #f ; see python-renpy + #: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 = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]") - (string-append "cmd = [ \"" (assoc-ref outputs "out") - "/bin/renpy\" ]")) - ;; Projects are still created in the usual style, so we need - ;; to adjust the path. - (("cmd.append\\(self.path\\)") - "cmd.append(self.path + \"/game\")")))) - (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")))) - (replace 'build - (lambda _ - (invoke "python" "renpy.py" "launcher" "quit") - (invoke "python" "renpy.py" "the_question" "quit") - (invoke "python" "renpy.py" "tutorial" "quit"))) - (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 installed - ;; by python-renpy (which are instead deleted from that package), - ;; but also contains their byte-compiled versions. - ;; On other systems, renpy_base would point to site-packages 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 reason -- - ;; and the latter is impossible on Guix. Hence the detour through - ;; share/renpy and the custom renpy program. - ;; - ;; As a convention, other games should be installed as - ;; subdirectories of share/renpy in their respective outputs 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 dependencies - ;; |-- 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 inputs 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 \"$@\"" - (search-input-file inputs "/bin/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-question") - #:game "the_question" - #:name "the-question") - - (install-renpy-game #:output (assoc-ref outputs "tutorial") - #:game "tutorial"))) - (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" = - (,@(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 input))) - inputs)))))))))))))) - (inputs - `(("bash-minimal" ,bash-minimal) - ("renpy.in" ,(search-auxiliary-file "renpy/renpy.in")) - ("python-pefile" ,python-pefile) - ("python-requests" ,python-requests) - ("python-renpy" ,python-renpy) - ("python:tk" ,python "tk") - ("python-six" ,python-six) - ("python" ,python) ; for ‘fix-commands’ and ‘wrap’ - ("xdg-utils" ,xdg-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 = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]") + (string-append "cmd = [ \"" (assoc-ref outputs "out") + "/bin/renpy\" ]")) + ;; Projects are still created in the usual style, so we need + ;; to adjust the path. + (("cmd.append\\(self.path\\)") + "cmd.append(self.path + \"/game\")")))) + (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")))) + (replace 'build + (lambda _ + (invoke "python" "renpy.py" "launcher" "quit") + (invoke "python" "renpy.py" "the_question" "quit") + (invoke "python" "renpy.py" "tutorial" "quit"))) + (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 installed + ;; by python2-renpy (which are instead deleted from that package), + ;; but also contains their byte-compiled versions. + ;; On other systems, renpy_base would point to site-packages 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 reason -- + ;; and the latter is impossible on Guix. Hence the detour through + ;; share/renpy and the custom renpy program. + ;; + ;; As a convention, other games should be installed as + ;; subdirectories of share/renpy in their respective outputs 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 dependencies + ;; |-- 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 #$(local-file (search-auxiliary-file "renpy/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 inputs 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 \"$@\"" + (search-input-file inputs "/bin/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-question") + #:game "the_question" + #:name "the-question") + + (install-renpy-game #:output (assoc-ref outputs "tutorial") + #:game "tutorial"))) + (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" = + (,@(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 input))) + inputs)))))))))))))) + (inputs (list bash-minimal + python + python-pefile + python-requests + python-renpy + python-six + `(,python "tk") + xdg-utils)) (propagated-inputs '()) - (native-inputs - (list xorg-server-for-tests)) - (outputs - (list "out" "tutorial" "the-question")) + (native-inputs (list xorg-server-for-tests)) + (outputs (list "out" "tutorial" "the-question")) (home-page "https://www.renpy.org/") (synopsis "Visual Novel Engine") (description "Ren'Py is a visual novel engine that helps you use words, -- 2.36.1