+
+(define-public fna
+ (package
+ (name "fna")
+ (version "19.12.01")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/FNA-XNA/FNA.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:tests? #f ; No tests.
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'link-dep-src
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
+ (mojoshader (assoc-ref inputs "mojoshader-src"))
+ (faudio (assoc-ref inputs "faudio-src"))
+ (theorafile (assoc-ref inputs "theorafile-src")))
+ (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
+ (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
+ (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
+ (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
+ (delete 'configure)
+ (replace 'build
+ (lambda _
+ (invoke "make" "release")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
+ #t))))))
+ (native-inputs
+ `(("mono" ,mono)))
+ (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
+ ("mojoshader-src" ,(package-source mojoshader-cs))
+ ("faudio-src" ,(package-source faudio))
+ ("theorafile-src" ,(package-source theorafile))))
+ (home-page "https://fna-xna.github.io/")
+ (synopsis "Accuracy-focused XNA4 reimplementation")
+ (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
+focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
+ (license (list license:ms-pl ; FNA
+ license:lgpl2.1 ; LzxDecoder.cs
+ ;; Mono.Xna:
+ license:expat))))
+
+(define-public libccd
+ (package
+ (name "libccd")
+ (version "2.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/danfis/libccd.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
+ "-DBUILD_TESTING=ON"
+ "-DENABLE_DOUBLE_PRECISION=ON")))
+ (native-inputs
+ `(("python-sphinx" ,python-sphinx)))
+ (home-page "https://github.com/danfis/libccd")
+ (synopsis "Library for collision detection between two convex shapes")
+ (description "@code{libccd} is library for a collision detection
+between two convex shapes. @code{libccd} implements variation on
+Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
+and also implements algorithm Minkowski Portal Refinement (MPR,
+a.k.a. XenoCollide) as described in Game Programming Gems 7.")
+ (license license:expat)))
+
+(define-public ode
+ (package
+ (name "ode")
+ (version "0.16.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
+ "ode-" version ".tar.gz"))
+ (sha256
+ (base32 "1flfdqgdbcn1bx8nrrd4qnp6cvsxrhvk8cdg7vaq2dzkh6nsqa5j"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ (delete-file-recursively "libccd")
+ #t))))
+ (build-system cmake-build-system)
+ (arguments
+ ;; Tests fail on all systems but x86_64. This is fixed upstream and can
+ ;; be removed in 0.16.2+.
+ `(#:tests? ,(string-prefix? "x86_64-"
+ (or (%current-target-system)
+ (%current-system)))
+ #:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'unbundle-libccd
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ (("configure_file\\(libccd/.*") ""))
+ #t)))))
+ (inputs
+ `(("glu" ,glu)
+ ("libccd" ,libccd)
+ ("mesa" ,mesa)))
+ (home-page "https://www.ode.org/")
+ (synopsis "High performance library for simulating rigid body dynamics")
+ (description "ODE is a high performance library for simulating
+rigid body dynamics. It is fully featured, stable, mature and
+platform independent with an easy to use C/C++ API. It has advanced
+joint types and integrated collision detection with friction. ODE is
+useful for simulating vehicles, objects in virtual reality
+environments and virtual creatures. It is currently used in many
+computer games, 3D authoring tools and simulation tools.")
+ ;; Software is dual-licensed.
+ (license (list license:lgpl2.1+ license:expat))))
+
+(define-public chipmunk
+ (package
+ (name "chipmunk")
+ (version "7.0.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/slembcke/Chipmunk2D.git")
+ (commit (string-append "Chipmunk-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:tests? #f ;no test
+ #:configure-flags '("-DBUILD_STATIC=OFF"
+ "-DBUILD_DEMOS=OFF")))
+ (inputs
+ `(("freeglut" ,freeglut)
+ ("libxmu" ,libxmu)
+ ("libxrandr" ,libxrandr)))
+ (home-page "https://chipmunk-physics.net/")
+ (synopsis "Fast and lightweight 2D game physics library")
+ (description "Chipmunk is a simple, lightweight, fast and portable 2D
+rigid body physics library written in C.")
+ (license license:expat)))
+
+(define-public libtcod
+ (package
+ (name "libtcod")
+ (version "1.15.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/libtcod/libtcod.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ (delete-file-recursively "src/vendor/utf8proc")
+ (delete-file-recursively "src/vendor/zlib")
+ (delete-file "src/vendor/stb_truetype.h")
+ (delete-file "src/vendor/stb_sprintf.h")
+ (delete-file "src/vendor/lodepng.cpp")
+ (delete-file "src/vendor/lodepng.h")
+
+ (substitute* "buildsys/autotools/sources.am"
+ (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
+ (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
+ "../../src/vendor/stb.c")
+ (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
+
+ (substitute* "src/libtcod/sys_sdl_img_png.cpp"
+ (("\\.\\./vendor/") ""))
+
+ (substitute* '("src/libtcod/color/canvas.cpp"
+ "src/libtcod/sys_sdl_img_png.cpp"
+ "src/libtcod/tileset/truetype.cpp"
+ "src/libtcod/tileset/tilesheet.cpp")
+ (("\\.\\./\\.\\./vendor/") ""))
+
+ (substitute* "src/libtcod/console/printing.cpp"
+ (("\\.\\./\\.\\./vendor/utf8proc/") ""))
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags '("--with-gnu-ld"
+ "LIBS=-lutf8proc -llodepng")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'change-to-build-dir
+ (lambda _
+ (chdir "buildsys/autotools")
+ (patch-shebang "get_version.py")
+ #t)))))
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)
+ ("python" ,python)
+ ("pkg-config" ,pkg-config)
+ ("stb-sprintf" ,stb-sprintf)
+ ("stb-truetype" ,stb-truetype)))
+ (inputs
+ `(("lodepng" ,lodepng)
+ ("sdl2" ,sdl2)
+ ("utf8proc" ,utf8proc)
+ ("zlib" ,zlib)))
+ (home-page "https://github.com/libtcod/libtcod")
+ (synopsis "Library specifically designed for writing roguelikes")
+ (description
+ "libtcod is a fast, portable and uncomplicated API for roguelike
+developers providing an advanced true color console, input, and lots of other
+utilities frequently used in roguelikes.")
+ (license license:bsd-3)))