summaryrefslogtreecommitdiff
path: root/gnu/packages/game-development.scm
diff options
context:
space:
mode:
authorSughosha <sughosha@disroot.org>2026-05-04 18:54:34 +0530
committerNguyễn Gia Phong <cnx@loang.net>2026-05-13 13:56:06 +0900
commit558a9be50e56267df441359c0b564a4244e41f2c (patch)
treeb1d3115901f395734f4be33bbb76e3951138a1b1 /gnu/packages/game-development.scm
parent41c670a6c4547d84460c51e79183ae28b5c09191 (diff)
gnu: libtcod: Update to 2.2.2.
* gnu/packages/game-development.scm (libtcod): Update to 2.2.2. [source]: Realign. <snippet>: Update for this version. [build-system]: Switch to cmake-build-system. [arguments]: Switch to gexp. <#:configure-flags>: Remove unused flags. Add "-DLIBTCOD_TESTS=ON" and "-DBUILD_SHARED_LIBS=ON". <#:phases>: Remove 'change-to-build-dir. Add 'patch-commands and a replacement for 'check. [inputs]: Replace lodepng with lodepng/c and sdl2 with sdl3. Add fontconfig and stb-truetype. [native-inputs]: Remove autoconf, automake, libtool, python, stb-sprintf, and stb-truetype. Add catch2-3.8. Change-Id: I4a03d20be55954153cda5a01afe7c051168c4a36 Merges: https://codeberg.org/guix/guix/pulls/8355 Reviewed-by: Nicolas Graves <ngraves@ngraves.fr> Reviewed-by: bdunahu <bdunahu@operationnull.com> Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
Diffstat (limited to 'gnu/packages/game-development.scm')
-rw-r--r--gnu/packages/game-development.scm121
1 files changed, 67 insertions, 54 deletions
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 65c6b934db9..17c94d9c5e8 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -3620,63 +3620,76 @@ physics engine is just a system for procedural animation.")
3620(define-public libtcod 3620(define-public libtcod
3621 (package 3621 (package
3622 (name "libtcod") 3622 (name "libtcod")
3623 (version "1.15.1") 3623 (version "2.2.2")
3624 (source (origin 3624 (source
3625 (method git-fetch) 3625 (origin
3626 (uri (git-reference 3626 (method git-fetch)
3627 (url "https://github.com/libtcod/libtcod") 3627 (uri (git-reference
3628 (commit version))) 3628 (url "https://github.com/libtcod/libtcod")
3629 (file-name (git-file-name name version)) 3629 (commit version)))
3630 (sha256 3630 (file-name (git-file-name name version))
3631 (base32 3631 (sha256
3632 "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5")) 3632 (base32 "1zl1w4kpiiarh0f1q3j95k9vp90fx98hxl1ykma9hlkfw33srmy0"))
3633 (modules '((guix build utils))) 3633 (modules '((guix build utils)))
3634 (snippet '(begin 3634 (snippet
3635 (delete-file-recursively "src/vendor/utf8proc") 3635 '(begin
3636 (delete-file-recursively "src/vendor/zlib") 3636 (rmdir "vcpkg")
3637 (delete-file "src/vendor/stb_truetype.h") 3637 (with-directory-excursion "src"
3638 (delete-file "src/vendor/stb_sprintf.h") 3638 ;; Delete the bundled third party libraries.
3639 (delete-file "src/vendor/lodepng.cpp") 3639 (with-directory-excursion "vendor"
3640 (delete-file "src/vendor/lodepng.h") 3640 (for-each delete-file
3641 3641 '("khrplatform.h"
3642 (substitute* "buildsys/autotools/sources.am" 3642 "lodepng.c"
3643 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "") 3643 "lodepng.h"
3644 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\") 3644 "stb_ds.h"
3645 "../../src/vendor/stb.c") 3645 "stb_truetype.h"))
3646 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") "")) 3646 (for-each delete-file-recursively '("utf8proc" "zlib")))
3647 3647 ;; Do not fetch the libraries from their Git repositories.
3648 (substitute* "src/libtcod/sys_sdl_img_png.cpp" 3648 ;; Instead, find the required packages available in Guix and link
3649 (("\\.\\./vendor/") "")) 3649 ;; them.
3650 3650 (substitute* "CMakeLists.txt"
3651 (substitute* '("src/libtcod/color/canvas.cpp" 3651 (("FetchContent_MakeAvailable\\(SDL3\\)")
3652 "src/libtcod/sys_sdl_img_png.cpp" 3652 "find_package(SDL3 REQUIRED)")
3653 "src/libtcod/tileset/truetype.cpp" 3653 (("FetchContent_MakeAvailable\\(ZLIB\\)")
3654 "src/libtcod/tileset/tilesheet.cpp") 3654 "find_package(ZLIB REQUIRED)")
3655 (("\\.\\./\\.\\./vendor/") "")) 3655 (("FetchContent_MakeAvailable\\(lodepng-c\\)")
3656 3656 "find_library(LODEPNG_LIB NAMES lodepng REQUIRED)")
3657 (substitute* "src/libtcod/console/printing.cpp" 3657 (("lodepng-c") "${LODEPNG_LIB}")
3658 (("\\.\\./\\.\\./vendor/utf8proc/") "")) 3658 (("FetchContent_MakeAvailable\\(utf8proc\\)")
3659 #t)))) 3659 (string-append "find_package(PkgConfig REQUIRED)\n"
3660 (build-system gnu-build-system) 3660 " pkg_check_modules(UTF8PROC REQUIRED"
3661 " libutf8proc)"))
3662 (("utf8proc\\:\\:utf8proc") "utf8proc")
3663 ((".*FetchContent_MakeAvailable\\(Stb.*") "")))))))
3664 (build-system cmake-build-system)
3661 (arguments 3665 (arguments
3662 `(#:configure-flags '("--with-gnu-ld" 3666 (list
3663 "LIBS=-lutf8proc -llodepng") 3667 #:configure-flags
3664 #:phases 3668 #~(list "-DLIBTCOD_TESTS=ON"
3665 (modify-phases %standard-phases 3669 "-DBUILD_SHARED_LIBS=ON")
3666 (add-after 'unpack 'change-to-build-dir 3670 #:phases
3667 (lambda _ 3671 #~(modify-phases %standard-phases
3668 (chdir "buildsys/autotools") 3672 (add-after 'unpack 'patch-commands
3669 (patch-shebang "get_version.py")))))) 3673 (lambda* (#:key inputs #:allow-other-keys)
3674 (substitute* "src/libtcod/tileset_fallback.c"
3675 (("popen\\(\"fc-match")
3676 (string-append "popen(\""
3677 (search-input-file inputs "/bin/fc-match"))))))
3678 (replace 'check
3679 (lambda* (#:key tests? #:allow-other-keys)
3680 (when tests?
3681 (with-directory-excursion "tests"
3682 (copy-recursively "../../source/data" "data")
3683 (setenv "LD_LIBRARY_PATH" "..")
3684 (setenv "XDG_RUNTIME_DIR" (getcwd))
3685 (setenv "HOME" (getcwd))
3686 (invoke "./unittest"
3687 ;; No video device available.
3688 "~[!nonportable]"))))))))
3670 (native-inputs 3689 (native-inputs
3671 (list autoconf 3690 (list catch2-3.8 pkg-config))
3672 automake
3673 libtool
3674 python
3675 pkg-config
3676 stb-sprintf
3677 stb-truetype))
3678 (inputs 3691 (inputs
3679 (list lodepng sdl2 utf8proc zlib)) 3692 (list fontconfig lodepng/c sdl3 stb-truetype utf8proc zlib))
3680 (home-page "https://github.com/libtcod/libtcod") 3693 (home-page "https://github.com/libtcod/libtcod")
3681 (synopsis "Library specifically designed for writing roguelikes") 3694 (synopsis "Library specifically designed for writing roguelikes")
3682 (description 3695 (description