From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:59768) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1is9Cc-0005tD-Rp for guix-patches@gnu.org; Thu, 16 Jan 2020 12:45:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1is9CY-00074F-E3 for guix-patches@gnu.org; Thu, 16 Jan 2020 12:45:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1is9CY-000749-6w for guix-patches@gnu.org; Thu, 16 Jan 2020 12:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1is9CY-0003HK-4d for guix-patches@gnu.org; Thu, 16 Jan 2020 12:45:02 -0500 Subject: [bug#39153] [PATCH] gnu: Refactor renpy build. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:59629) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1is9BW-0004nk-6M for guix-patches@gnu.org; Thu, 16 Jan 2020 12:44:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1is9BS-0006Pe-3e for guix-patches@gnu.org; Thu, 16 Jan 2020 12:43:57 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:12373) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1is9BR-0006MI-FZ for guix-patches@gnu.org; Thu, 16 Jan 2020 12:43:54 -0500 Received: from localhost.localdomain (193-80-82-122.hdsl.highway.telekom.at [193.80.82.122]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 47zBPr6qcFz1LgFS for ; Thu, 16 Jan 2020 18:43:44 +0100 (CET) From: Leo Prikler Date: Thu, 16 Jan 2020 18:43:10 +0100 Message-Id: <20200116174309.3058-1-leo.prikler@student.tugraz.at> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39153@debbugs.gnu.org * gnu/packages/game-development.scm (python2-renpy): Use directory excurs= ions instead of invoking `chdir' directly. --- gnu/packages/game-development.scm | 54 +++++++++++++------------------ 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-develo= pment.scm index 7aef6b09d2..697ede89e1 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -1086,39 +1086,31 @@ developed mainly for Ren'py.") (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) = ":")) #t)) (replace 'build - (lambda args - (apply - (lambda* (build-root #:key inputs outputs #:allow-other-ke= ys) - ;; The "module" subdirectory contains a python (really c= ython) - ;; project, which is built using a script, that is thank= fully - ;; named "setup.py". - (chdir "module") - (apply (assoc-ref %standard-phases 'build) args) - ;; the above causes renpy.__init__ to be compiled but do= es not - ;; compile anything else, hence we do that here - (chdir build-root) - (delete-file "renpy/__init__.pyc") - (invoke "python" "-m" "compileall" "renpy")) - (getcwd) args) + (lambda* (#:key inputs outputs #:allow-other-keys #:rest args= ) + ;; The "module" subdirectory contains a python (really cyth= on) + ;; project, which is built using a script, that is thankful= ly + ;; named "setup.py". + (with-directory-excursion "module" + (apply (assoc-ref %standard-phases 'build) args)) + ;; the above causes renpy.__init__ to be compiled but does = not + ;; compile anything else, hence we do that here + (delete-file "renpy/__init__.pyc") + (invoke "python" "-m" "compileall" "renpy") #t)) (replace 'install - (lambda args - (apply - (lambda* (build-root #:key inputs outputs #:allow-other-ke= ys) - ;; Again, we have to wrap the module installation. - ;; Additionally, we want to install the python code - ;; (both source and compiled) in the same directory. - (let* ((out (assoc-ref outputs "out")) - (site (string-append "/lib/python" - ,(version-major+minor - (package-version python-2)= ) - "/site-packages"))) - (chdir "module") - (apply (assoc-ref %standard-phases 'install) args) - (chdir build-root) - (copy-recursively "renpy" - (string-append out site "/renpy")))) - (getcwd) args) + (lambda* (#:key inputs outputs #:allow-other-keys #:rest args= ) + ;; Again, we have to wrap the module installation. + ;; Additionally, we want to install the python code + ;; (both source and compiled) in the same directory. + (let* ((out (assoc-ref outputs "out")) + (site (string-append "/lib/python" + ,(version-major+minor + (package-version python-2)) + "/site-packages"))) + (with-directory-excursion "module" + (apply (assoc-ref %standard-phases 'install) args)) + (copy-recursively "renpy" + (string-append out site "/renpy"))) #t))))) (inputs `(("ffmpeg" ,ffmpeg) --=20 2.25.0