From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sGZ/KLZewV7FUgAA0tVLHw (envelope-from ) for ; Sun, 17 May 2020 15:56:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0J9cJLZewV76RQAA1q6Kng (envelope-from ) for ; Sun, 17 May 2020 15:56:38 +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 47489940143 for ; Sun, 17 May 2020 15:56:38 +0000 (UTC) Received: from localhost ([::1]:59322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaLeX-0001pi-85 for larch@yhetil.org; Sun, 17 May 2020 11:56:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaLdz-000127-K1 for guix-patches@gnu.org; Sun, 17 May 2020 11:56:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:32844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaLdz-0007AQ-9r for guix-patches@gnu.org; Sun, 17 May 2020 11:56:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaLdz-0005d7-8j for guix-patches@gnu.org; Sun, 17 May 2020 11:56:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41365] [PATCH 3/5] gnu: godot: Build and install the headless version. Resent-From: Timotej Lazar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 May 2020 15:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41365 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41365@debbugs.gnu.org Cc: Timotej Lazar Received: via spool by 41365-submit@debbugs.gnu.org id=B41365.158973095821600 (code B ref 41365); Sun, 17 May 2020 15:56:03 +0000 Received: (at 41365) by debbugs.gnu.org; 17 May 2020 15:55:58 +0000 Received: from localhost ([127.0.0.1]:44386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaLdt-0005cC-Ix for submit@debbugs.gnu.org; Sun, 17 May 2020 11:55:57 -0400 Received: from araneo.si ([90.157.193.204]:49476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaLdn-0005bQ-SX for 41365@debbugs.gnu.org; Sun, 17 May 2020 11:55:54 -0400 Received: from araneo.si (localhost.lan [127.0.0.1]) by araneo.si (OpenSMTPD) with ESMTP id b07a6875 for <41365@debbugs.gnu.org>; Sun, 17 May 2020 15:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=araneo.si; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=20180623; bh=5A60GDM6EqeksQeS59Z+B vM7GuE=; b=QWxo+L6iJaP7uyZ+dm0SaQr/I5Sq6j0+WX24xrtGF5mX73xh+igMG nYw81pRwii5sUrm/j9eJOkxnPrH6qq3Wy8UHfF8KyWs3Ic/SlYi9p2omOB2dFHHK 131IqZZ+77vsyOtaMY6aWERcmvGW5XM4CWqzfiWLojGdfx++IbdVkibERnW435iG S1PvRHK4Hr8eUvkm3J0mvYNFsA7l08ur4ypQaF/eO5AstSaPA8L/YKM4DuN60rXu b1eF0rs2OKbX5e7a4ZVpmSDdH1g0+eHKPoiBlmkmDoL1PWSZQM2VjS2UeAwAMWwp AfQL3eCzaIjfBLAF/KjmTe1GUMImJz/5w== Received: by araneo.si (OpenSMTPD) with ESMTPSA id 32f277f4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 17 May 2020 15:55:40 +0000 (UTC) From: Timotej Lazar Date: Sun, 17 May 2020 17:55:18 +0200 Message-Id: <20200517155520.26183-3-timotej.lazar@araneo.si> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200517155520.26183-1-timotej.lazar@araneo.si> References: <20200517155520.26183-1-timotej.lazar@araneo.si> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=araneo.si header.s=20180623 header.b=QWxo+L6i; dmarc=fail reason="SPF not aligned (relaxed)" header.from=araneo.si (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 5.09 X-TUID: ezvo5gsCG5Fb * gnu/packages/game-development.scm (godot): Build the headless (server) binary. This is needed to package games using Godot without depending on X. [outputs]: Add "headless". [arguments]<#:phases>[build-headless]: New phase. [arguments]<#:phases>[install]: Install headless version to separate output. --- gnu/packages/game-development.scm | 32 ++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index d84b3fb24a..2ed3055cfc 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -1617,20 +1617,29 @@ games.") "env_base = Environment(tools=custom_tools)\n" "env_base = Environment(ENV=os.environ)"))) #t)) + ;; Build headless tools, used for packaging games without depending on X. + (add-after 'build 'build-headless + (lambda* (#:key scons-flags #:allow-other-keys) + (apply invoke "scons" + `(,(string-append "-j" (number->string (parallel-job-count))) + "platform=server" ,@(delete "platform=x11" scons-flags))))) (replace 'install - (lambda* (#:key outputs #:allow-other-keys) + (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin"))) + (headless (assoc-ref outputs "headless")) + (zenity (assoc-ref inputs "zenity"))) + ;; Strip build info from filenames. (with-directory-excursion "bin" - (if (file-exists? "godot.x11.tools.64") - (rename-file "godot.x11.tools.64" "godot") - (rename-file "godot.x11.tools.32" "godot")) - (install-file "godot" bin)) - ;; Tell Godot where to find zenity for OS.alert(). - (wrap-program (string-append bin "/godot") - `("PATH" ":" prefix - (,(string-append (assoc-ref %build-inputs "zenity") "/bin")))) - #t))) + (for-each (lambda (file) + (let ((dest (car (string-split (basename file) #\.)))) + (rename-file file dest))) + (find-files "." "godot.*\\.x11\\.opt\\.tools.*")) + (install-file "godot" (string-append out "/bin")) + (install-file "godot_server" (string-append headless "/bin"))) + ;; Tell the editor where to find zenity for OS.alert(). + (wrap-program (string-append out "/bin/godot") + `("PATH" ":" prefix (,(string-append zenity "/bin"))))) + #t)) (add-after 'install 'install-godot-desktop (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -1652,6 +1661,7 @@ games.") Type=Application~%" out))) #t)))))) + (outputs '("out" "headless")) (native-inputs `(("pkg-config" ,pkg-config))) (inputs `(("alsa-lib" ,alsa-lib) ("bullet" ,bullet) -- 2.26.2