summaryrefslogtreecommitdiff
path: root/guix.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix.scm')
-rw-r--r--guix.scm183
1 files changed, 183 insertions, 0 deletions
diff --git a/guix.scm b/guix.scm
new file mode 100644
index 0000000..05161db
--- /dev/null
+++ b/guix.scm
@@ -0,0 +1,183 @@
+;;; Starling Game Engine
+;;; Copyright © 2018 David Thompson <davet@gnu.org>
+;;;
+;;; Starling is free software: you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published
+;;; by the Free Software Foundation, either version 3 of the License,
+;;; or (at your option) any later version.
+;;;
+;;; Starling is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with Starling. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Development environment for GNU Guix.
+;;
+;; To setup the development environment, run the following:
+;;
+;; guix environment -l guix.scm
+;; ./bootstrap && ./configure;
+;;
+;; To build the development snapshot, run:
+;;
+;; guix build -f guix.scm
+;;
+;; To install the development snapshot, run:
+;;
+;; guix install -f guix.scm
+;;
+;;; Code:
+
+(use-modules (ice-9 match)
+ (srfi srfi-1)
+ (guix packages)
+ (guix licenses)
+ (guix download)
+ (guix git-download)
+ (guix build-system gnu)
+ (gnu packages)
+ (gnu packages autotools)
+ (gnu packages pkg-config)
+ (gnu packages texinfo)
+ (gnu packages guile)
+ (gnu packages gl)
+ (gnu packages sdl)
+ (gnu packages maths)
+ (gnu packages image))
+
+(define (package-with-guile p guile)
+ (package
+ (inherit p)
+ (inputs
+ (map (match-lambda
+ (("guile" _)
+ `("guile" ,guile))
+ (input input))
+ (package-inputs p)))))
+
+(define (package-with-guile-2.2 p)
+ (package-with-guile p guile-2.2.4))
+
+(define guile-sdl2
+ (let ((commit "5a6ea82c9ad859972c01d2908b2f66fb3addcfbb"))
+ (package
+ (name "guile-sdl2")
+ (version "0.2.0-1.")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "git://dthompson.us/guile-sdl2.git")
+ (commit commit)))
+ (sha256
+ (base32
+ "1gc8f24l2y939a673kix0jd0kqr4zgwr8kd5qy60czqbqbjqrn96"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:configure-flags
+ (list (string-append "--with-libsdl2-prefix="
+ (assoc-ref %build-inputs "sdl2"))
+ (string-append "--with-libsdl2-image-prefix="
+ (assoc-ref %build-inputs "sdl2-image"))
+ (string-append "--with-libsdl2-ttf-prefix="
+ (assoc-ref %build-inputs "sdl2-ttf"))
+ (string-append "--with-libsdl2-mixer-prefix="
+ (assoc-ref %build-inputs "sdl2-mixer")))
+ #:make-flags '("GUILE_AUTO_COMPILE=0")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'bootstrap
+ (lambda _
+ (zero? (system* "sh" "bootstrap"))))
+ (add-after 'configure 'patch-makefile
+ (lambda _
+ ;; Install compiled Guile files in the expected place.
+ (substitute* '("Makefile")
+ (("^godir = .*$")
+ "godir = $(moddir)\n")))))))
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("pkg-config" ,pkg-config)
+ ("texinfo" ,texinfo)))
+ (inputs
+ `(("guile" ,guile-2.2.4)
+ ("sdl2" ,sdl2)
+ ("sdl2-image" ,sdl2-image)
+ ("sdl2-mixer" ,sdl2-mixer)
+ ("sdl2-ttf" ,sdl2-ttf)))
+ (synopsis "Guile bindings for SDL2")
+ (description "Guile-sdl2 provides pure Guile Scheme bindings to the
+SDL2 C shared library via the foreign function interface.")
+ (home-page "https://git.dthompson.us/guile-sdl2.git")
+ (license lgpl3+))))
+
+(define chickadee
+ (let ((commit "8163e4b415bcf1f6a696ccbf06e3136aea1a261f"))
+ (package
+ (name "chickadee")
+ (version "0.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "git://dthompson.us/chickadee.git")
+ (commit commit)))
+ (sha256
+ (base32
+ "0wsn01mxvmkgfmc7s97hq5vwi86p5qn0bylxi3ilbp0b7i9g7x50"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:make-flags '("GUILE_AUTO_COMPILE=0")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'bootstrap
+ (lambda _
+ (zero? (system* "sh" "bootstrap"))))
+ (add-after 'configure 'patch-makefile
+ (lambda _
+ ;; Install compiled Guile files in
+ ;; the expected place.
+ (substitute* '("Makefile")
+ (("^godir = .*$")
+ "godir = $(moddir)\n")))))))
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("pkg-config" ,pkg-config)
+ ("texinfo" ,texinfo)))
+ (inputs
+ `(("guile" ,guile-2.2.2)))
+ (propagated-inputs
+ `(("guile-opengl" ,(package-with-guile-2.2 guile-opengl))
+ ("guile-sdl2" ,guile-sdl2)))
+ (synopsis "Game development toolkit for Guile Scheme")
+ (description "Chickadee is a game development toolkit for Guile
+Scheme. It contains all of the basic components needed to develop
+2D/3D video games.")
+ (home-page "https://dthompson.us/projects/chickadee.html")
+ (license gpl3+))))
+
+(package
+ (name "starling")
+ (version "0.1")
+ (source #f)
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("pkg-config" ,pkg-config)
+ ("texinfo" ,texinfo)))
+ (inputs
+ `(("guile" ,guile-2.2.4)))
+ (propagated-inputs
+ `(("guile-opengl" ,(package-with-guile-2.2 guile-opengl))
+ ("guile-sdl2" ,guile-sdl2)
+ ("chickadee" ,chickadee)))
+ (synopsis "Game engine for Scheme programmers")
+ (description "Starling is a game engine written in Guile Scheme.")
+ (home-page "https://dthompson.us/projects/chickadee.html")
+ (license gpl3+))