From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eLE6HpyzvWE83QAAgWs5BA (envelope-from ) for ; Sat, 18 Dec 2021 11:10:36 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qFT4GZyzvWGpagAA1q6Kng (envelope-from ) for ; Sat, 18 Dec 2021 10:10:36 +0000 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 13B9A1D923 for ; Sat, 18 Dec 2021 11:10:36 +0100 (CET) Received: from localhost ([::1]:37558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myWfj-0001Os-9r for larch@yhetil.org; Sat, 18 Dec 2021 05:10:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myWfD-0000vp-Fn for guix-patches@gnu.org; Sat, 18 Dec 2021 05:10:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57984) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myWfD-0005Mx-6f for guix-patches@gnu.org; Sat, 18 Dec 2021 05:10:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1myWfD-0004BD-0J for guix-patches@gnu.org; Sat, 18 Dec 2021 05:10:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52595] [PATCH 3/5] gnu: renpy: Move renpy command to aux-files. References: <9af1bb4930763c511306573bbf032d6ed700ff25.camel@gmail.com> In-Reply-To: <9af1bb4930763c511306573bbf032d6ed700ff25.camel@gmail.com> Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 18 Dec 2021 10:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52595 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52595@debbugs.gnu.org Received: via spool by 52595-submit@debbugs.gnu.org id=B52595.163982215215977 (code B ref 52595); Sat, 18 Dec 2021 10:10:02 +0000 Received: (at 52595) by debbugs.gnu.org; 18 Dec 2021 10:09:12 +0000 Received: from localhost ([127.0.0.1]:41291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myWeL-00049Y-4z for submit@debbugs.gnu.org; Sat, 18 Dec 2021 05:09:12 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myWeG-00048P-58 for 52595@debbugs.gnu.org; Sat, 18 Dec 2021 05:09:04 -0500 Received: by mail-wr1-f68.google.com with SMTP id j9so8858345wrc.0 for <52595@debbugs.gnu.org>; Sat, 18 Dec 2021 02:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:subject:to:content-transfer-encoding:message-id :mime-version; bh=RKPSwWwooxzAztREVnuTAQ5Ox8UGibO06pWMDrlBT+8=; b=UUry4t0L69kApmKRXOUAXLRfwBMTYra0yYm74wXGjT5m6KdqYmFQtGq96itKpClcZg HkJrtl5nKwaxUcItkAilFOXA6OBEnY+jfnejyCCvTVDPonmH+jCEHsW0cBZLYgUAC00n CrrwybDkr3xlQygET074jold3i78BDjhsKPHATTfCFWuD7hQOXLVWOX0ixuSHeF3BSlk NJzNB+FQW5nxB5H7S2N4eM4zDOfX4z5pQUynFTuK21MLxYOBRrfCOF1q3bOfUQo81pnN vYKlQD448tGwFEVs2+0USqZLuRoATaNuTrGNLdGmu1qqA36mIRIkHV7YWDM1CQlhH1aE vvBw== 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:content-transfer-encoding :message-id:mime-version; bh=RKPSwWwooxzAztREVnuTAQ5Ox8UGibO06pWMDrlBT+8=; b=fc2Jcz2BDOt874RrYvXkOO/vWRJ/QoXIpPps/2daUzfhyVQJjW8oJBYheFelM7/gJG HcKJ8AhekUSvw+g0GfMqd3egiR8JgCdidG0TTntuK8BqU51CVBNRE0j7gSrjsIiGuhjl ew8DYyFnmFNLsIYx6HI4sl9iof5AmSNxZ9BbJeqJU5GO+6+OYAGTwPY/QuXjq9g1EZQG P0ydfPnfXKNqPN6ifh2DmYejUECYsleqM6iuAVNKloWzijRy0c/KBcp/EdveVoOOGyng 3180l7OLawcXBUOJvzeoy4GQb2lNj4MN5vNkwjhy8hCfm7NJAfBuQj/UFUAC+8w8vkLB MWNg== X-Gm-Message-State: AOAM533J43bBZNR3xGFRcavYFLDSsIAbEpDlFtPMTwVXcNtbALY4DiLz 5IvKzqaE58eDORt2lC4kxkPuGr1MuXNPkw== X-Google-Smtp-Source: ABdhPJwvXcZteb+HCShCX5rVj1Nh5Q3IfYc20P0PFCw0shlmHDWZRLWhkfWZZyc+4qDY+irpkxc6lg== X-Received: by 2002:adf:8b0e:: with SMTP id n14mr5540941wra.281.1639822138659; Sat, 18 Dec 2021 02:08:58 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id r8sm12119060wrz.43.2021.12.18.02.08.58 for <52595@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Dec 2021 02:08:58 -0800 (PST) From: Liliana Marie Prikler Date: Fri, 17 Dec 2021 19:59:05 +0100 Content-Transfer-Encoding: 8bit Message-ID: <4a4bfdf0cc27a32ed72abaf80e17032925d2b9a6.camel@gmail.com> 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639822236; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=RKPSwWwooxzAztREVnuTAQ5Ox8UGibO06pWMDrlBT+8=; b=Ro9+iRVAN7Imnf6Ozr76LcvVO8jDqzCEss13ZqXw0dAMHOofg37KoNzQbvI/gkr0hp4hI6 1uoBTg9VecxCaPlBM2gS6df9jqZ3IQY1ESw8Xdjsal857omUAw1oukJPx6HRlTVvQLI3wH hQqCAMoAb/AWD3yNrPUmZIHr4/ty3XNykJZRLNYsivMFdDcuk3sjA9sdF9nP5rmvHLpKFW XDqRDbHjGnoqCdYytas8/d5Fov5nUbxk0VzC04LL/VGAdacxS88xrDYUFltjoKcLIZKoCs 3IEb0Y0Pgx2uKVIpbxx/Gj/qvrLYC1dThx5/+W47WzbyFHZeCBVCRwdOc8KvbA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639822236; a=rsa-sha256; cv=none; b=FdzrauF/B4HzuUKGqeJuXGzGa6k0RLDZW9TRgkiGwGfcn8WfSD/Ywo8WqjMPZWjtbMQ9mF A8eyOn7GJDcqC9QNPWmkDVZZe7K+9KPXho3EWm1PN+pishbIypiRASqQS1yTIMfTNPBCXC gO8ZKjr8G9DFnx4sUCNWthAtR6XPTWhxFGk7uTQD7jhqxi8YhBgysXUhCuuM9sLx+QExIE MxtRCV9gFLOz46/NDLR4ZNMxr07Ws0YFCOhXHKbZzEH59q4RSjM4CfFazE8Av7TRE/ALAY MYHuDN1dV+8RNETO2WOn08oP6kKKYWyGg/Clp3iKWl7ltJTL+hCHUPVgFAxQ2w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=UUry4t0L; 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: -0.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=UUry4t0L; 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: 13B9A1D923 X-Spam-Score: -0.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: wgV3XVJNn//0 * gnu/packages/aux-files/renpy/renpy.in: New file. * gnu/packages/game-development.scm (renpy)[install]: Use renpy.in with substitute*. * Makefile.am (AUX_FILES): Add it here. --- Makefile.am | 1 + gnu/packages/aux-files/renpy/renpy.in | 48 +++++++++++++++++++ gnu/packages/game-development.scm | 68 ++++----------------------- 3 files changed, 57 insertions(+), 60 deletions(-) create mode 100644 gnu/packages/aux-files/renpy/renpy.in diff --git a/Makefile.am b/Makefile.am index c4ccee65f1..627cf3ca64 100644 --- a/Makefile.am +++ b/Makefile.am @@ -403,6 +403,7 @@ AUX_FILES = \ gnu/packages/aux-files/pack-audit.c \ gnu/packages/aux-files/python/sanity-check.py \ gnu/packages/aux-files/python/sitecustomize.py \ + gnu/packages/aux-files/renpy/renpy.in \ gnu/packages/aux-files/run-in-namespace.c # Templates, examples. diff --git a/gnu/packages/aux-files/renpy/renpy.in b/gnu/packages/aux-files/renpy/renpy.in new file mode 100644 index 0000000000..914a735fa4 --- /dev/null +++ b/gnu/packages/aux-files/renpy/renpy.in @@ -0,0 +1,48 @@ +#! @PYTHON@ +# -*- mode: python -*- + +from __future__ import print_function + +import os +import sys +import warnings + +def path_to_common(renpy_base): + return renpy_base + "/common" + +def path_to_saves(gamedir, save_directory=None): + import renpy + + if save_directory is None: + save_directory = renpy.config.save_directory + save_directory = renpy.exports.fsencode(save_directory) + + if not save_directory: + return gamedir + "/saves" + + return os.path.join(os.path.expanduser("~/.renpy"), save_directory) + +def main(): + try: + import renpy.bootstrap + import renpy.arguments + except ImportError: + print("""Could not import renpy.bootstrap. +Please ensure you decompressed Ren'py correctly, preserving the directory +structure.""", file=sys.stderr) + raise + + args = renpy.arguments.bootstrap() + if not args.basedir: + print("""This Ren'py requires a basedir to launch. +The basedir is the directory, in which .rpy source files or compiled .rpyc files +live -- usually the 'game' subdirectory of a game packaged by Ren'py. + +If you want the Ren'py launcher, use \"renpy-launcher\" instead.""", + file=sys.stderr) + sys.exit() + + renpy.bootstrap.bootstrap("@RENPY_BASE@") + +if __name__ == "__main__": + main() diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index fb8744382c..955d630704 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -1444,70 +1444,17 @@ (define-public renpy ;; `-- Super Awesome Game.sh (let* ((out (assoc-ref outputs "out")) (bin/renpy (string-append out "/bin/renpy"))) - (mkdir-p (string-append out "/bin")) (copy-recursively "renpy/common" (string-append out "/share/renpy/common")) (copy-recursively "gui" (string-append out "/share/renpy/gui")) - (call-with-output-file bin/renpy - (lambda (port) - (format port "#!~a/bin/python2~%" - (assoc-ref inputs "python2")) - (format port " -from __future__ import print_function - -import os -import sys -import warnings - -def path_to_common(renpy_base): - return renpy_base + \"/common\" - -def path_to_saves(gamedir, save_directory=None): - import renpy # @UnresolvedImport - - if save_directory is None: - save_directory = renpy.config.save_directory - save_directory = renpy.exports.fsencode(save_directory) - - if not save_directory: - return gamedir + \"/saves\" - - return os.path.expanduser(\"~~/.renpy/\" + save_directory) - -def path_to_renpy_base(): - return \"~a\" - -def main(): - renpy_base = path_to_renpy_base() - try: - import renpy.bootstrap - import renpy.arguments - except ImportError: - print(\"\"\"Could not import renpy.bootstrap. -Please ensure you decompressed Ren'Py correctly, preserving the directory -structure.\"\"\", file=sys.stderr) - raise - - args = renpy.arguments.bootstrap() - if not args.basedir: - print(\"\"\"This Ren'py requires a basedir to launch. -The basedir is the directory, in which .rpy files live -- usually the 'game' -subdirectory of a game packaged by Ren'py. - -If you want the Ren'py launcher, use renpy-launcher instead.\"\"\", - file=sys.stderr) - sys.exit() - - renpy.bootstrap.bootstrap(renpy_base) - -if __name__ == \"__main__\": - main() -" - (string-append out "/share/renpy")))) - (chmod bin/renpy #o755) - #t))) + (mkdir-p (string-append out "/bin")) + (copy-file (assoc-ref inputs "renpy.in") bin/renpy) + (substitute* bin/renpy + (("@PYTHON@") (search-input-file inputs "bin/python2")) + (("@RENPY_BASE@") (string-append out "/share/renpy"))) + (chmod bin/renpy #o755)))) (add-after 'install 'install-games (lambda* (#:key outputs #:allow-other-keys) @@ -1561,7 +1508,8 @@ (define* (install-renpy-game #:key output game name (renpy renpy) inputs)))))))) #t)))))) (inputs - `(("python2-renpy" ,python2-renpy) + `(("renpy.in" ,(search-auxiliary-file "renpy/renpy.in")) + ("python2-renpy" ,python2-renpy) ("python2-tkinter" ,python-2 "tk") ("python2" ,python-2) ; for ‘fix-commands’ and ‘wrap’ ("xdg-utils" ,xdg-utils))) -- 2.34.0