unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Peter Mikkelsen <petermikkelsen10@gmail.com>
To: 28380@debbugs.gnu.org
Subject: [bug#28380] [PATCH] gnu: Add godot.
Date: Thu,  7 Sep 2017 13:59:47 +0200	[thread overview]
Message-ID: <20170907115947.19777-1-petermikkelsen10@gmail.com> (raw)

* gnu/packages/game-development.scm (godot): New variable.
---
 gnu/packages/game-development.scm | 105 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 104 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index c8869a494..e04c11d7d 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2016, 2017 Julian Graham <joolean@gmail.com>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
+;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -73,7 +74,8 @@
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages mp3)
-  #:use-module (gnu packages xml))
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages tls))
 
 (define-public bullet
   (package
@@ -1019,3 +1021,104 @@ with its own editor, called OpenMW-CS which allows the user to edit or create
 their own original games.")
     (home-page "https://openmw.org")
     (license license:gpl3)))
+
+(define-public godot
+  (package
+    (name "godot")
+    (version "2.1.4")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append "https://github.com/godotengine/godot/archive/"
+                              version "-stable.tar.gz"))
+              (file-name (string-append name "-" version))
+              (sha256
+               (base32 "1mz89nafc1m7srbqvy7iagxrxmqvf5hbqi7i0lwaapkx6q0kpkq7"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; There are no tests
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'scons-use-env
+           (lambda _
+             ;; Scons does not use the environment variables by default,
+             ;; but this substitution makes it do so.
+             (substitute* "SConstruct"
+               (("env_base = Environment\\(tools=custom_tools\\)")
+                (string-append
+                 "env_base = Environment(tools=custom_tools)\n"
+                 "env_base = Environment(ENV=os.environ)")))
+             #t))
+         (replace 'build
+           (lambda _
+             (zero? (system*
+                     "scons"
+                     "platform=x11"
+                     ;; Avoid using many of the bundled libs.
+                     ;; Note: These options can be found in the SConstruct file.
+                     "builtin_freetype=no"
+                     "builtin_glew=no"
+                     "builtin_libmpdec=no"
+                     "builtin_libogg=no"
+                     "builtin_libpng=no"
+                     "builtin_libtheora=no"
+                     "builtin_libvorbis=no"
+                     "builtin_libwebp=no"
+                     "builtin_openssl=no"
+                     "builtin_opus=no"
+                     "builtin_zlib=no"))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (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)))))
+         (add-after 'install 'install-godot-desktop
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (desktop (string-append out "/share/applications"))
+                    (icon-dir (string-append out "/share/pixmaps")))
+               (mkdir-p desktop)
+               (mkdir-p icon-dir)
+               (rename-file "icon.png" "godot.png")
+               (install-file "godot.png" icon-dir)
+               (with-output-to-file
+                   (string-append desktop "/godot.desktop")
+                 (lambda _
+                   (format #t
+                           "[Desktop Entry]~@
+                           Name=godot~@
+                           Comment=The godot game engine~@
+                           Exec=~a/bin/godot~@
+                           TryExec=~@*~a/bin/godot~@
+                           Icon=godot~@
+                           Type=Application~%"
+                           out)))
+               #t))))))
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("scons" ,scons)))
+    (inputs `(("alsa-lib" ,alsa-lib)
+              ("freetype" ,freetype)
+              ("glew" ,glew)
+              ("glu" ,glu)
+              ("libtheora" ,libtheora)
+              ("libvorbis" ,libvorbis)
+              ("libwebp" ,libwebp)
+              ("libx11" ,libx11)
+              ("libxcursor" ,libxcursor)
+              ("libxinerama" ,libxinerama)
+              ("libxrandr" ,libxrandr)
+              ("mesa" ,mesa)
+              ("openssl" ,openssl)
+              ("opusfile" ,opusfile)
+              ("pulseaudio" ,pulseaudio)
+              ("python2" ,python-2)))
+    (home-page "https://godotengine.org/")
+    (synopsis "Advanced 2d and 3d game engine")
+    (description "Godot is an advanced, feature-packed, multi-platform
+2D and 3D open source game engine.")
+    (license license:expat)))
-- 
2.14.1

             reply	other threads:[~2017-09-07 12:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 11:59 Peter Mikkelsen [this message]
2017-09-08 15:45 ` [bug#28380] [PATCH] gnu: Add godot Ludovic Courtès
     [not found]   ` <CADh9keV8QPbk3OwzR4shtMdUoaeS6xRTY5_EGuS9krd=MR0V+A@mail.gmail.com>
     [not found]     ` <CADh9keUB-Ea11_-j3F+oZO_Zr+ekHO9rP+LodUGQ9sPkBussVg@mail.gmail.com>
     [not found]       ` <CADh9keXu3VSLdf3L9egQZaDcsUKKY6RGoC_4PDKnBp=dSF5M7Q@mail.gmail.com>
     [not found]         ` <CADh9keWMwQ8JYQZAaKsL+UMYcG6qFDUVPxZ=Xx+BR4WEXs8K0g@mail.gmail.com>
2017-09-08 16:13           ` Peter Mikkelsen
2017-09-14 11:41             ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170907115947.19777-1-petermikkelsen10@gmail.com \
    --to=petermikkelsen10@gmail.com \
    --cc=28380@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).