+
+(define-public chipmunk
+ (package
+ (name "chipmunk")
+ (version "7.0.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/slembcke/Chipmunk2D")
+ (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")
+ (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)))
+
+(define-public warsow-qfusion
+ ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
+ ;; The 2.5 beta as published on the homepage is commit
+ ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
+ (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
+ (package
+ (name "warsow-qfusion")
+ (version (git-version "2.5" "1" commit)) ; 2.5-beta
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Warsow/qfusion/")
+ (commit commit)
+ (recursive? #t)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
+ ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
+ (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ (delete-file-recursively "platforms")
+ (delete-file-recursively "debian")
+ (delete-file-recursively "libsrcs")
+ #t))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:tests? #f ; No tests.
+ #:configure-flags '("-DQFUSION_GAME=Warsow")
+ #:modules
+ ((guix build utils)
+ (guix build cmake-build-system)
+ (ice-9 match))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'change-to-build-dir
+ (lambda _
+ (chdir "source")
+ #t))
+ (add-after 'install 'really-install
+ (lambda* (#:key outputs system #:allow-other-keys)
+ (let ((arch (match system
+ ("x86_64-linux" "x86_64")
+ ("i686-linux" "i386")))
+ (out (assoc-ref outputs "out")))
+ (install-file (string-append "../source/build/basewsw/libgame_"
+ arch ".so")
+ (string-append out "/lib/"))
+ (install-file (string-append "../source/build/libui_" arch ".so")
+ (string-append out "/lib/"))
+ (for-each
+ (lambda (file)
+ (install-file file (string-append out "/bin/")))
+ (append (find-files "../source/build" "warsow")
+ (find-files "../source/build" "wsw_server."))))
+ #t)))))
+ (inputs
+ `(("alsa-lib" ,alsa-lib)
+ ("curl" ,curl)
+ ("freetype" ,freetype)
+ ("ffmpeg" ,ffmpeg)
+ ("libjpeg" ,libjpeg-turbo)
+ ("libogg" ,libogg)
+ ("libpng" ,libpng)
+ ("libtheora" ,libtheora)
+ ("libvorbis" ,libvorbis)
+ ("mesa" ,mesa)
+ ("openal" ,openal)
+ ("pulseaudio" ,pulseaudio)
+ ("qtbase" ,qtbase)
+ ("qtdeclarative" ,qtdeclarative)
+ ("sdl2" ,sdl2)
+ ("uuid.h" ,util-linux "lib")
+ ("zlib" ,zlib)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (home-page "https://github.com/Warsow/qfusion")
+ (supported-systems '("i686-linux" "x86_64-linux"))
+ (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
+ (description
+ "This package contains the game engine of Warsow, a first-person
+shooter video game. The engine is based on qfusion, the id Tech 2 derived
+game engine. id Tech 2 is the engine originally behind Quake 2.")
+ (license license:gpl2+))))
+
+(define-public dhewm3
+ (package
+ (name "dhewm3")
+ (version "1.5.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/dhewm/dhewm3/releases/download/"
+ version "/dhewm3-" version "-src.tar.xz"))
+ (sha256
+ (base32
+ "0dmd1876az5q8gbjrd1jk8zidz11ydj607z3m8m5kvw2yj136jzv"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:tests? #f ; No tests.
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'change-to-build-dir
+ (lambda _
+ (chdir "neo")
+ #t)))))
+ (inputs
+ `(("curl" ,curl)
+ ("libjpeg" ,libjpeg-turbo)
+ ("libogg" ,libogg)
+ ("libvorbis" ,libvorbis)
+ ("libx11" ,libx11)
+ ("openal" ,openal)
+ ("sdl2" ,sdl2)
+ ("zlib" ,zlib)))
+ (home-page "https://dhewm3.org/")
+ (synopsis "Port of the original Doom 3 engine")
+ (description
+ "@command{dhewm3} is a source port of the original Doom 3 engine (not
+Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
+version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
+sound effects on all operating systems and hardware (via OpenAL Softs EFX
+support), has much better support for widescreen resolutions and has 64bit
+support.")
+ (license license:gpl3)))
+
+(define-public tesseract-engine
+ (let ((svn-revision 2411))
+ (package
+ (name "tesseract-engine")
+ (version (string-append "20200615-" (number->string svn-revision)))
+ (source
+ (origin
+ (method svn-fetch)
+ (uri (svn-reference
+ (url "svn://svn.tuxfamily.org/svnroot/tesseract/main")
+ (revision svn-revision)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1av9jhl2ivbl7wfszyhyna84llvh1z2d8khkmadm8d105addj10q"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ (for-each delete-file-recursively
+ '("bin" "bin64"
+ ;; Remove "media" since some files such as
+ ;; media/sound/game/soundsnap/info.txt refer to a
+ ;; non-commercial license.
+ "media"
+ "server.bat"
+ "tesseract.bat"
+ "src/lib"
+ "src/lib64"))
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags (list "CC=gcc")
+ #:tests? #f ; No tests.
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'cd-src
+ (lambda _ (chdir "src") #t))
+ (add-before 'build 'fix-env
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "CPATH"
+ (string-append (assoc-ref inputs "sdl2-union")
+ "/include/SDL2:"
+ (or (getenv "CPATH") "")))
+ #t))
+ (add-after 'install 'really-install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (share (string-append out "/share/tesseract"))
+ (bin (string-append out "/bin/tesseract"))
+ (client (string-append out "/bin/tesseract-client")))
+ (chdir "..") ; Back to root.
+ (for-each
+ (lambda (dir)
+ (mkdir-p (string-append share "/" dir))
+ (copy-recursively dir (string-append share "/" dir)))
+ '("config"))
+ (mkdir-p (string-append out "/bin/"))
+ (copy-file "bin_unix/native_client" client)
+ (copy-file "bin_unix/native_server"
+ (string-append out "/bin/tesseract-server"))
+ (call-with-output-file bin
+ (lambda (p)
+ (format p "#!~a
+TESS_DATA=~a
+TESS_BIN=~a
+TESS_OPTIONS=\"-u$HOME/.tesseract\"
+cd \"$TESS_DATA\"
+exec \"$TESS_BIN\" \"$TESS_OPTIONS\" \"$@\""
+ (which "bash")
+ share
+ client)))
+ (chmod bin #o755)
+ (install-file "src/readme_tesseract.txt"
+ (string-append out "/share/licenses/tesseract/LICENSE")))
+ #t)))))
+ (inputs
+ `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-mixer sdl2-image)))
+ ("zlib" ,zlib)
+ ("libpng" ,libpng)
+ ("libgl" ,mesa)))
+ (home-page "http://tesseract.gg/")
+ (synopsis "First-person shooter engine with map editing, instagib, DM and CTF")
+ (description "This package contains the game engine of Tesseract, a
+first-person shooter focused on cooperative in-game map editing.
+
+The engine is derived from @emph{Cube 2: Sauerbraten} technology but with
+upgraded modern rendering techniques. The new rendering features include
+fully dynamic omnidirectional shadows, global illumination, HDR lighting,
+deferred shading, morphological / temporal / multisample anti-aliasing, and
+much more.")
+ (license license:zlib))))